Soil pollution detection methods and devices, electronic equipment, and storage media

CN122567548APending Publication Date: 2026-08-14HEBEI CHENGRUI ENVIRONMENTAL PROTECTION GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-07
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

光谱检测法凭借快速、无损伤的优势得到广泛应用,但该方法对混合污染的区分能力弱、检测误差大;传感器检测法侧重单一污染物类型识别,对多类型污染物共存的混合污染场景适配性差,且检测结果的特异性和准确性不足

Benefits of technology

本申请实施例通过分阶段提取不同维度的光谱特征与理化特征,先初步判定样本类型,再针对污染超标样本精准识别重金属污染、有机污染物污染及混合污染等具体类型。不同维度特征的差异化提取,可充分挖掘与污染类型相关的关键信息,避免单一维度特征的信息局限,从而精准区分混合污染与单一污染,提升污染类型识别的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122567548A_ABST
    Figure CN122567548A_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for soil pollution detection, electronic equipment, and storage medium, belonging to the field of soil detection technology. The method includes: extracting a first spectral feature from soil spectral data of a soil sample and extracting a first physicochemical feature from soil property data of the soil sample; determining the sample type based on the first spectral feature and the first physicochemical feature; if the sample type is a polluted sample exceeding the standard, extracting a second spectral feature from the soil spectral data and extracting a second physicochemical feature from the soil property data; determining the pollution type based on the second spectral feature and the second physicochemical feature; weightedly fusing the first spectral feature and the second spectral feature based on the pollution type to obtain a third spectral feature; fusing the first physicochemical feature and the second physicochemical feature based on the pollution type to obtain a third physicochemical feature; and obtaining the pollution detection result based on the third spectral feature and the third physicochemical feature. This application can improve the detection accuracy of complex polluted soils.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of soil testing technology, and more specifically, relates to soil pollution testing methods and devices, electronic equipment, and storage media. Background Technology

[0002] Soil pollution is a prominent issue in the field of ecological and environmental protection. Heavy metal pollution, organic pollutant pollution, and other pollutants can damage the soil's ecological structure, affect crop growth, and harm human health through the food chain. Therefore, accurate detection of soil pollution is crucial for pollution control and remediation.

[0003] Existing methods for soil pollution detection mainly include spectroscopic detection and sensor detection. Spectroscopic detection is widely used due to its advantages of speed and non-destructiveness, but it has weak ability to distinguish between mixed pollution and large detection errors. Sensor detection focuses on identifying single pollutant types and has poor adaptability to mixed pollution scenarios where multiple types of pollutants coexist, and its detection results lack specificity and accuracy. Summary of the Invention

[0004] The purpose of this application is to provide methods and apparatus for soil pollution detection, electronic equipment, and storage media to improve the detection accuracy of complex polluted soils.

[0005] A first aspect of this application provides a method for detecting soil pollution, comprising: First spectral features are extracted from the soil spectral data of the target soil sample, and first physicochemical features are extracted from the soil property data of the target soil sample; the sample type of the target soil sample is determined based on the first spectral features and the first physicochemical features. If the sample type is a polluted sample exceeding the standard, then the second spectral feature is extracted from the soil spectral data, and the second physicochemical feature is extracted from the soil property data; the target pollution type of the target soil sample is determined based on the second spectral feature and the second physicochemical feature; the feature dimensions of the first spectral feature and the second spectral feature are different, and the feature dimensions of the first physicochemical feature and the second physicochemical feature are different; the target pollution type includes heavy metal pollution, organic pollutant pollution, or mixed pollution; A third spectral feature is obtained by weighted fusion of the first and second spectral features based on the target pollution type; a third physicochemical feature is obtained by weighted fusion of the first and second physicochemical features based on the target pollution type. Based on the third spectral characteristics and the third physicochemical characteristics, pollution detection was performed on the target soil sample to obtain the pollution detection results.

[0006] A second aspect of this application provides a soil pollution detection device, comprising: The sample type identification module is used to extract a first spectral feature from the soil spectral data of the target soil sample and extract a first physicochemical feature from the soil property data of the target soil sample; and determine the sample type of the target soil sample based on the first spectral feature and the first physicochemical feature. The pollution type identification module is used to extract a second spectral feature from soil spectral data and a second physicochemical feature from soil property data if the sample type is a sample with excessive pollution. Based on the second spectral feature and the second physicochemical feature, the target pollution type of the target soil sample is determined. The feature dimensions of the first spectral feature and the second spectral feature are different, and the feature dimensions of the first physicochemical feature and the second physicochemical feature are different. The target pollution type includes heavy metal pollution, organic pollutant pollution, or mixed pollution. The feature fusion module is used to perform weighted fusion of the first spectral feature and the second spectral feature based on the target pollution type to obtain the third spectral feature; and to perform weighted fusion of the first physicochemical feature and the second physicochemical feature based on the target pollution type to obtain the third physicochemical feature. The pollution detection and analysis module is used to detect pollution in target soil samples based on third spectral characteristics and third physicochemical characteristics, and obtain pollution detection results.

[0007] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the soil pollution detection method described above.

[0008] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described soil pollution detection method.

[0009] The beneficial effects of the soil pollution detection method and apparatus, electronic equipment, and storage medium provided in this application embodiment are as follows: This application's embodiments extract spectral and physicochemical features from different dimensions in stages. First, the sample type is preliminarily determined. Then, for samples exceeding pollution standards, specific types such as heavy metal pollution, organic pollutant pollution, and mixed pollution are accurately identified. The differentiated extraction of features from different dimensions fully uncovers key information related to pollution type, avoiding the information limitations of single-dimensional features, thereby accurately distinguishing between mixed and single pollution and improving the accuracy of pollution type identification.

[0010] This application's embodiments are based on a targeted fusion of spectral and physicochemical characteristics according to pollution type. This integration of the synergistic characterization effects of the two types of characteristics fully utilizes feature correlations and avoids the problem of insufficient detection specificity. This application's embodiments can balance detection accuracy and scenario adaptability, providing reliable data support for soil pollution control and remediation, and adapting to the actual needs of various soil pollution detection methods. Attached Figure Description

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

[0012] Figure 1 A schematic flowchart of a soil pollution detection method provided in an embodiment of this application; Figure 2 This is a structural block diagram of a soil pollution detection device provided in an embodiment of this application; Figure 3 This is a schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0013] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0014] It is understood that in the embodiments of this application, data such as user information are involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with relevant laws, regulations and standards.

[0015] It should be noted that the terms "first," "second," etc., used in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein.

[0016] Please refer to Figure 1 , Figure 1 This is a schematic flowchart of a soil pollution detection method provided in an embodiment of this application. The method can be executed by an electronic device, and specifically, the method may include S101 to S104.

[0017] S101: Extract the first spectral feature from the soil spectral data of the target soil sample, and extract the first physicochemical feature from the soil property data of the target soil sample; determine the sample type of the target soil sample based on the first spectral feature and the first physicochemical feature.

[0018] In this embodiment, extracting the first spectral feature from the soil spectral data of the target soil sample specifically includes: The soil spectral data of the target soil sample were subjected to moving average filtering and polynomial fitting baseline correction to obtain standardized spectral data; The first wavelength range is determined based on the characteristic absorption peak data of heavy metal elements, and the second wavelength range is determined based on the characteristic absorption peak data of organic pollutants. The target wavelength range is obtained by merging the first wavelength range and the second wavelength range. Effective characteristic peaks are identified from the standardized spectral data corresponding to the target wavelength range, and the mean intensity, standard deviation, and density of all effective characteristic peaks are calculated. Calculate the background noise intensity based on the standardized spectral data corresponding to the non-target wavelength range; The effective signal-to-noise ratio of the characteristic peaks is calculated based on the background noise intensity and the mean intensity of the characteristic peaks. The coefficient of variation of characteristic peak intensity is calculated based on the mean and standard deviation of characteristic peak intensity. For each effective characteristic peak, calculate the matching degree between the wavelength corresponding to the effective characteristic peak and the standard wavelengths of multiple pollutants, and take the maximum matching degree corresponding to the effective characteristic peak as the characteristic peak wavelength matching degree of the effective characteristic peak. The effective characteristic peak signal-to-noise ratio, effective characteristic peak density, characteristic peak intensity variation coefficient, and wavelength matching degree of all characteristic peaks are used as the first spectral features.

[0019] In this embodiment, the sample type of the target soil sample is determined based on the first spectral feature and the first physicochemical feature. Specifically, this includes: determining the sample type of the target soil sample through a target random forest model based on the first spectral feature and the first physicochemical feature; the target random forest model is trained based on multiple historical soil sample data; each historical soil sample data includes the first spectral feature and the first physicochemical feature extracted in history, and each historical soil sample data is labeled with a pollution exceeding the standard sample label or a pollution not exceeding the standard sample label.

[0020] In this embodiment, the first physicochemical feature is extracted from the soil property data of the target soil sample, specifically including: extracting soil organic matter content, soil pH value, soil moisture content and soil electrical conductivity as the first physicochemical features from the soil property data of the target soil sample.

[0021] In this embodiment, the target soil sample refers to the physical soil sample to be tested for pollution, and is the core object of the testing process. Soil spectral data refers to the light signal data of the target soil sample at different wavelengths obtained through spectral detection equipment, used to extract pollutant-related characteristics. The first spectral feature is a set of parameters extracted from the soil spectral data that characterize pollution-related signals, used to preliminarily determine the sample's pollution status. Soil property data refers to the raw data reflecting the soil's own physicochemical properties, and is the basis for extracting physicochemical characteristics. The first physicochemical feature is a core parameter selected from the soil property data, used in conjunction with spectral characteristics to determine the sample type.

[0022] Moving average filtering is a technique for smoothing spectral data to reduce random noise interference. Polynomial fitting baseline correction is a method to correct spectral baseline drift, ensuring the accuracy of spectral data. Standardized spectral data refers to spectral data that has been preprocessed to eliminate interference, providing a reliable basis for feature extraction. Heavy metal elements refer to metallic substances such as lead and cadmium that cause soil pollution; characteristic absorption peak data are their light absorption characteristics at specific wavelengths. The first wavelength range refers to the wavelength range corresponding to the characteristic absorption peaks of heavy metal elements, the second wavelength range refers to the wavelength range corresponding to the characteristic absorption peaks of organic pollutants, and the target wavelength range is the combined wavelength range of the two, focusing on the spectral signals related to pollutants.

[0023] Effective characteristic peaks refer to the spectral peaks related to pollutants within the target wavelength range. The mean intensity of characteristic peaks is the average value of the intensities of all effective characteristic peaks, and the standard deviation of characteristic peak intensities is a parameter reflecting the dispersion of characteristic peak intensities. Effective characteristic peak density refers to the number of effective characteristic peaks per unit wavelength range. Non-target wavelength ranges refer to the wavelength range that does not contain the characteristic absorption peaks of pollutants, and background noise intensity refers to the noise level of the spectral signal within this range. The mean intensity of characteristic peaks is the average value of the effective characteristic peak intensities, and the signal-to-noise ratio (SNR) of effective characteristic peaks is a parameter reflecting the ratio of the effective characteristic peak signal to noise, used to assess the reliability of characteristic peaks.

[0024] The coefficient of variation of characteristic peak intensity is a parameter reflecting the stability of characteristic peak intensity. The pollutant standard wavelength refers to the standard wavelength of the characteristic absorption peak corresponding to a known heavy metal or organic pollutant. The characteristic peak wavelength matching degree refers to the degree of fit between the effective characteristic peak wavelength and the standard wavelength. Sample type refers to the pollution state category to which the target soil sample belongs, including samples with pollution exceeding standards and samples with pollution not exceeding standards. The target random forest model is a machine learning model used to determine the sample type, trained based on historical soil sample data. Historical soil sample data refers to the characteristic data of soil samples that have completed testing and have their pollution status labeled. The labels for samples with pollution exceeding standards and samples with pollution not exceeding standards are clear identifiers of the pollution status of historical soil samples.

[0025] Soil organic matter content refers to the proportion of organic matter in the soil; soil pH value refers to the acidity or alkalinity of the soil; soil moisture content refers to the proportion of water in the soil; and soil electrical conductivity refers to the soil's ability to conduct electric current. These four items are the core parameters of the primary physicochemical characteristics that reflect the basic properties of soil.

[0026] For example, in this embodiment, the target soil sample can be detected by a UV-Vis-NIR full-band spectrometer to collect raw soil spectral data in the wavelength range of 300-1200nm. At the same time, the target soil sample can be detected by soil physicochemical analysis equipment to obtain soil attribute data including indicators such as soil organic matter content, soil pH value, soil moisture content and soil electrical conductivity.

[0027] This embodiment can use moving average filtering technology to process the raw spectral data. For example, the filter window size is set to 5 points, and the spectral curve is smoothed by averaging adjacent data points to reduce random noise interference. This embodiment can also use a third-order polynomial fitting baseline correction method to analyze the baseline drift trend in the spectral data, construct a baseline model and remove the drift effect, and finally obtain standardized spectral data with noise and baseline interference eliminated.

[0028] In this embodiment, the first wavelength range corresponding to the characteristic absorption peak of heavy metal elements (such as lead, cadmium, and chromium) can be determined as 400-600 nm according to the spectral characteristics manual. In this embodiment, the second wavelength range corresponding to the characteristic absorption peak of polycyclic aromatic hydrocarbons can be determined as 700-900 nm according to the spectral characteristics manual. In this embodiment, the two ranges can be combined to obtain the target wavelength range of 400-900 nm, while 300-400 nm and 900-1200 nm are set as non-target wavelength ranges.

[0029] In the standardized spectral data corresponding to the target wavelength range of 400-900nm, this embodiment can identify effective characteristic peaks with signal intensity higher than the threshold using a peak detection algorithm. Assuming a total of 8 effective characteristic peaks are identified, this embodiment can calculate the intensity values ​​of these 8 effective characteristic peaks, obtaining a mean characteristic peak intensity of 0.8au, a standard deviation of 0.15au, and an effective characteristic peak density of 0.016 peaks / nm. Based on the standardized spectral data corresponding to the non-target wavelength ranges of 300-400nm and 900-1200nm, this embodiment can calculate a background noise intensity of 0.1au. Combining the mean characteristic peak intensity of 0.8au, this embodiment can calculate an effective characteristic peak signal-to-noise ratio of 8. In this embodiment, the coefficient of variation of characteristic peak intensity can be calculated to be 0.1875 using the mean and standard deviation of characteristic peak intensity. This embodiment can obtain a standard wavelength library of common pollutants, calculate the degree of fit between the wavelength and the standard wavelength for each effective characteristic peak, and take the maximum fit value of each peak as the characteristic peak wavelength matching degree of that peak. Finally, the signal-to-noise ratio of the effective characteristic peak, the density of the effective characteristic peak, the coefficient of variation of characteristic peak intensity, and the wavelength matching degree of the eight characteristic peaks are used together as the first spectral feature.

[0030] This embodiment can directly filter out four parameters from the acquired soil property data: soil organic matter content, soil pH value, soil moisture content, and soil electrical conductivity, as the first physicochemical characteristics. For example, the filtered data are: organic matter content 22%, pH value 6.5, moisture content 18%, and electrical conductivity 2.5 mS / cm.

[0031] This embodiment can collect 500 sets of historical soil sample data. Each set of data includes the first spectral feature and the first physicochemical feature extracted through the above steps. At the same time, based on the laboratory quantitative test results, each set of data is labeled with either a pollution exceeding the standard or a pollution not exceeding the standard. Among them, 250 sets are labeled as pollution exceeding the standard and 250 sets are labeled as pollution not exceeding the standard. In this embodiment, these historical sample data can be divided into training set and test set in a 7:3 ratio. The training set data is used to train a random forest model, with the number of decision trees set to 100 and the maximum tree depth set to 10. The model performance is verified through the test set data. When the model accuracy reaches more than 96%, the training of the target random forest model is completed.

[0032] In this embodiment, the first spectral features and first physicochemical features of the target soil sample can be input into the trained target random forest model. The model outputs the sample type of the target soil sample through a voting mechanism of multiple decision trees, namely, a sample with excessive pollution or a sample with no excessive pollution, thus completing the preliminary determination of the sample type.

[0033] This embodiment effectively reduces noise and baseline drift interference by applying moving average filtering and polynomial fitting baseline correction to the spectral data, ensuring the reliability of the standardized spectral data and laying a high-quality foundation for subsequent feature extraction. The first spectral feature encompasses multi-dimensional information such as the signal reliability, distribution density, intensity stability, and wavelength specificity of the effective characteristic peaks. Combined with core first physicochemical characteristics such as soil organic matter content, it achieves comprehensive capture of pollution-related information.

[0034] The target random forest model, trained on a large number of labeled historical samples, possesses strong feature fusion and classification capabilities. It can accurately uncover the synergistic correlation between spectral and physicochemical features, thereby efficiently distinguishing between samples exceeding pollution standards and those not exceeding standards. This embodiment improves the accuracy and efficiency of sample type determination, providing a scientific basis for subsequent targeted pollution type identification and precise detection, and effectively supporting the standardized advancement of soil pollution detection.

[0035] S102: If the sample type is a polluted sample, then extract the second spectral feature from the soil spectral data and extract the second physicochemical feature from the soil property data; determine the target pollution type of the target soil sample based on the second spectral feature and the second physicochemical feature; the feature dimensions of the first spectral feature and the second spectral feature are different, and the feature dimensions of the first physicochemical feature and the second physicochemical feature are different; the target pollution type includes heavy metal pollution, organic pollutant pollution or mixed pollution.

[0036] In this embodiment, after determining the sample type of the target soil sample based on the first spectral characteristics and the first physicochemical characteristics, the method further includes: if the sample type is a sample with pollution not exceeding the standard, then obtaining the pollution detection result based on the first spectral characteristics and the first physicochemical characteristics.

[0037] In this embodiment, a second spectral feature is extracted from soil spectral data, and a second physicochemical feature is extracted from soil property data. Specifically, this includes: extracting the signal-to-noise ratio of heavy metals, the signal-to-noise ratio of organic pollutants, the overlap of characteristic peaks, the wavelength matching rate of heavy metals, and the wavelength matching rate of organic pollutants from soil spectral data as the second spectral feature; and extracting soil cation exchange capacity and soil redox potential from soil property data as the second physicochemical feature.

[0038] In this embodiment, the target pollution type of the target soil sample is determined based on the second spectral characteristics and the second physicochemical characteristics, specifically including: The heavy metal pollution rate was calculated based on the heavy metal signal-to-noise ratio, heavy metal wavelength matching rate, and soil cation exchange capacity. The organic pollutant pollution rate was calculated based on the signal-to-noise ratio of organic pollutants, the wavelength matching rate of organic pollutants, and the soil redox potential. The mixed pollution rate is calculated based on the heavy metal pollution rate, the organic pollutant pollution rate, and the overlap of characteristic peaks. If the heavy metal pollution rate is not less than the first probability threshold and the organic pollutant pollution rate is not greater than the second probability threshold, then the target pollution type of the target soil sample is determined to be heavy metal pollution. If the heavy metal pollution rate is not greater than the second probability threshold and the organic pollutant pollution rate is not less than the first probability threshold, then the target pollution type of the target soil sample is determined to be organic pollutant pollution. If the heavy metal pollution rate and the organic pollutant pollution rate are both less than the first probability threshold and greater than the second probability threshold, and / or the mixed pollution rate is not less than the first probability threshold, then the target pollution type of the target soil sample is determined to be mixed pollution.

[0039] In this embodiment, the signal-to-noise ratio (SNR) of heavy metals is a parameter reflecting the ratio of the correlated spectral signal of heavy metals to the background noise, and the SNR of organic pollutants is a parameter reflecting the ratio of the correlated spectral signal of organic pollutants to the background noise. Characteristic peak overlap is a parameter representing the degree of overlap of the effective characteristic peaks corresponding to different pollutants within a wavelength range. The wavelength matching rate of heavy metals is the proportion of fit between the effective characteristic peak wavelength and the standard wavelength of heavy metals, and the wavelength matching rate of organic pollutants is the proportion of fit between the effective characteristic peak wavelength and the standard wavelength of organic pollutants. Soil cation exchange capacity is the total amount of exchangeable cations that can be adsorbed per unit mass of soil, and soil redox potential is the potential difference between oxidized and reduced substances in the soil.

[0040] The heavy metal pollution rate is an indicator of the likelihood of heavy metal pollution, calculated by comprehensively considering the relevant characteristics of heavy metals. The organic pollutant pollution rate is an indicator of the likelihood of organic pollutant pollution, calculated by comprehensively considering the relevant characteristics of organic pollutants. The mixed pollution rate is an indicator of the likelihood of mixed pollution, calculated by comprehensively considering the overlap of the two individual pollution rates and characteristic peaks. The first probability threshold and the second probability threshold are preset critical values ​​for determining the pollution type. The first probability threshold is higher than the second probability threshold, used to divide the determination intervals for different pollution types.

[0041] For example, after determining the sample type of the target soil sample through the target random forest model, it can be clearly identified whether the target soil sample belongs to the polluted sample with excessive pollution or the polluted sample without excessive pollution.

[0042] If the received sample type is a sample where the pollution level is within acceptable limits, there is no need to extract additional features. The pollution detection result containing the conclusion of "pollution level within acceptable limits" can be generated directly based on the previously obtained first spectral features and first physicochemical features. This result can be directly used for soil pollution status assessment without the need for subsequent complex analysis procedures.

[0043] If the sample type is a pollutant exceeding the standard, the second spectral feature extraction process is initiated. This embodiment can, based on pre-processed standardized spectral data, select characteristic wavelength intervals corresponding to heavy metals for heavy metal-related characteristic signals, calculate the ratio of the effective characteristic peak signal intensity to the background noise intensity within this interval, and obtain the heavy metal signal-to-noise ratio (SNR). Similarly, this embodiment can select characteristic wavelength intervals corresponding to organic pollutants, calculate the ratio of the effective characteristic peak signal intensity to the background noise intensity within this interval, and obtain the organic pollutant SNR. This embodiment can analyze the overlap of characteristic peaks corresponding to heavy metals and organic pollutants in wavelength distribution using a spectral peak identification algorithm, quantifying the characteristic peak overlap. This embodiment can compare the effective characteristic peak wavelengths with the heavy metal standard wavelength library and the organic pollutant standard wavelength library respectively, calculate the matching ratio, obtain the heavy metal wavelength matching rate and the organic pollutant wavelength matching rate, and finally integrate the above five parameters into the second spectral feature.

[0044] This embodiment can simultaneously retrieve soil property data of the target soil sample and obtain specific values ​​of soil cation exchange capacity and soil redox potential through professional soil physicochemical analysis equipment. These two parameters are used as secondary physicochemical characteristics to ensure the accuracy and relevance of the parameter data.

[0045] This embodiment can calculate the heavy metal pollution rate based on the extracted second spectral features and second physicochemical features using a weighted summation method. The heavy metal signal-to-noise ratio, heavy metal wavelength matching rate, and soil cation exchange capacity are used as core input parameters. Weights are assigned according to the contribution of each parameter to the characterization of heavy metal pollution, and then a comprehensive calculation is performed. This embodiment can also use the same weighted summation logic, using the organic pollutant signal-to-noise ratio, organic pollutant wavelength matching rate, and soil redox potential as input parameters to calculate the organic pollutant pollution rate. Furthermore, this embodiment can combine the obtained heavy metal pollution rate, organic pollutant pollution rate, and characteristic peak overlap using a multi-parameter collaborative calculation method to integrate the characterization effects of the three and obtain the mixed pollution rate.

[0046] This embodiment can be based on the statistical analysis results of a large amount of historical pollution sample data, combined with relevant national standards for soil pollution, to preset a first probability threshold and a second probability threshold, clarify the numerical relationship between the two types of thresholds, and ensure that the threshold setting meets the actual pollution judgment requirements.

[0047] This embodiment compares the calculated three pollution rates with preset thresholds. If the heavy metal pollution rate reaches or exceeds the first probability threshold, and the organic pollutant pollution rate is lower than or equal to the second probability threshold, the target pollution type is determined to be heavy metal pollution. If the organic pollutant pollution rate reaches or exceeds the first probability threshold, and the heavy metal pollution rate is lower than or equal to the second probability threshold, the target pollution type is determined to be organic pollutant pollution. If both the heavy metal pollution rate and the organic pollutant pollution rate are lower than the first probability threshold and higher than the second probability threshold, the target pollution type is determined to be mixed pollution. If the mixed pollution rate is higher than the first probability threshold, the target pollution type is determined to be mixed pollution, thus completing the accurate identification of pollution types.

[0048] This embodiment employs differentiated processing logic for different sample types. Samples with pollution levels not exceeding standards directly output results based on existing features, improving detection efficiency and avoiding unnecessary process redundancy. The second spectral feature and the second physicochemical feature focus on the core parameters for distinguishing pollution types, offering strong targeting and fully extracting key information related to pollution type. This embodiment achieves accurate differentiation between heavy metal pollution, organic pollutant pollution, and mixed pollution through the collaborative calculation and threshold determination mechanism of three types of pollution rates, effectively solving the problem of difficult mixed pollution identification. This embodiment improves the accuracy and reliability of soil pollution type identification, providing precise basis for subsequent pollution remediation and adapting to the practical application needs of soil pollution detection.

[0049] S103: The first spectral feature and the second spectral feature are weighted and fused based on the target pollution type to obtain the third spectral feature; the first physicochemical feature and the second physicochemical feature are weighted and fused based on the target pollution type to obtain the third physicochemical feature.

[0050] In this embodiment, a third spectral feature is obtained by weighted fusion of the first and second spectral features based on the target pollution type, including: Determine the weighting coefficients corresponding to the effective characteristic peak signal-to-noise ratio, effective characteristic peak density, characteristic peak intensity variation coefficient, wavelength matching degree of all characteristic peaks, signal-to-noise ratio of heavy metals, signal-to-noise ratio of organic pollutants, characteristic peak overlap, wavelength matching rate of heavy metals, and wavelength matching rate of organic pollutants. If the target pollution type is heavy metal pollution, the weight coefficients corresponding to the heavy metal signal-to-noise ratio and the heavy metal wavelength matching rate are updated based on the first proportional coefficient, and the weight coefficients corresponding to the organic pollutant signal-to-noise ratio and the organic pollutant wavelength matching rate are updated based on the second proportional coefficient; the first proportional coefficient is greater than 1, and the second proportional coefficient is less than 1. If the target pollution type is organic pollutant pollution, the weight coefficients corresponding to the heavy metal signal-to-noise ratio and the heavy metal wavelength matching rate are updated based on the second proportional coefficient, and the weight coefficients corresponding to the organic pollutant signal-to-noise ratio and the organic pollutant wavelength matching rate are updated based on the first proportional coefficient. If the target pollution type is mixed pollution, the weight coefficients corresponding to the heavy metal signal-to-noise ratio, heavy metal wavelength matching rate, organic pollutant signal-to-noise ratio, organic pollutant wavelength matching rate, and characteristic peak overlap are updated based on the third proportional coefficient; the third proportional coefficient is greater than the first proportional coefficient. The third spectral feature is obtained by weighting and fusing the first and second spectral features based on the weight coefficients corresponding to each feature in the first and second spectral features.

[0051] In this embodiment, the weighting coefficients are numerical values ​​representing the importance of each feature during the fusion process. The first proportional coefficient is used to strengthen the weight of features related to the target contamination, the second proportional coefficient is used to weaken the weight of features related to non-target contamination, and the third proportional coefficient is used to strengthen the weight of core features in mixed contamination scenarios. The core objective of this embodiment is to ensure that feature representations accurately match the target contamination type, solving the problems of one-sided information from single features and interference from non-target signals. Considering the strong correlation between feature importance and contamination type, and the different core representation features of different contamination types, it is necessary to achieve on-demand strengthening and suppression through weight adjustment. The first and second features have different functional positioning, and fusion can achieve information complementarity, avoiding the limitations of a single dimension. This embodiment adjusts the proportional coefficients according to the contamination type, which can amplify the contribution of the core features of the target contamination and weaken the interference of irrelevant features. In mixed contamination scenarios, a higher proportional coefficient is used to strengthen key features, ensuring that the two types of contamination signals are presented synergistically, so that the third feature focuses on the essence of the target contamination, providing high-quality input for subsequent accurate detection.

[0052] For example, this embodiment can combine the research results on the importance of features in the field of soil pollution detection, and set initial weight coefficients for all features participating in the fusion, such as the effective feature peak signal-to-noise ratio and the effective feature peak density, based on the general contribution of each feature to the pollution characterization, to ensure that the sum of each coefficient is 100%.

[0053] This embodiment can update the weighting coefficients according to the target pollution type. If the target pollution type is heavy metal pollution, the initial weighting coefficients of the heavy metal signal-to-noise ratio and heavy metal wavelength matching rate are amplified and updated using a first proportional coefficient, while the initial weighting coefficients of the organic pollutant signal-to-noise ratio and organic pollutant wavelength matching rate are reduced and updated using a second proportional coefficient. If it is organic pollutant pollution, the weighting coefficients of the corresponding features are updated in reverse using the above proportional coefficients. If it is mixed pollution, the initial weighting coefficients of heavy metal-related features, organic pollutant-related features, and feature peak overlap are further amplified and updated using a third proportional coefficient.

[0054] In this embodiment, the updated feature weight coefficients can be associated with the parameter values ​​of the corresponding first and second spectral features, and all features can be integrated and calculated by weighted summation to finally obtain a third spectral feature that integrates the core information of the two types of spectral features.

[0055] The process for obtaining the third physicochemical feature is consistent with the above logic. After updating the weight coefficients of each parameter in the first and second physicochemical features based on the target pollution type, a weighted fusion is performed to obtain the feature.

[0056] This embodiment updates feature weight coefficients specifically for different target pollution types, strengthening the role of core features related to the target pollution and suppressing interference from non-target pollution features. In mixed pollution scenarios, a higher third proportional coefficient strengthens key features, ensuring coordinated characterization of the two types of pollution signals. Weighted fusion achieves information complementarity between the first and second features, enhancing the targeted characterization ability of the third spectral and third physicochemical features for the target pollution type, laying a solid foundation for obtaining accurate pollution detection results.

[0057] S104: Based on the third spectral characteristics and the third physicochemical characteristics, pollution detection is performed on the target soil sample to obtain the pollution detection results.

[0058] In this embodiment, pollution detection is performed on the target soil sample based on the third spectral features and the third physicochemical features to obtain pollution detection results. Specifically, the pollution detection results are obtained by using a target pollution detection model based on the third spectral features and the third physicochemical features. The target pollution detection model is trained based on multiple historical soil sample data. Each historical soil sample data includes historically acquired third spectral features and third physicochemical features, and each historical soil sample data is labeled with a pollution type label.

[0059] In this embodiment, the pollution detection result refers to the final detection conclusion output by the target pollution detection model based on the third spectral characteristics and the third physicochemical characteristics, including pollution type confirmation and related quantitative or qualitative characterization. The target pollution detection model is a model used to process comprehensive features and output detection results, possessing feature mapping and classification capabilities. The pollution type label is a clear pollution category identifier for historical soil sample data, corresponding to heavy metal pollution, organic pollutant pollution, or mixed pollution, used for model training.

[0060] For example, this embodiment can select the Gradient Boosting Tree (XGBoost) model as the target contamination detection model. This model has strong feature fitting ability and anti-overfitting characteristics, and is suitable for classification tasks with multi-dimensional comprehensive features. The specific technical implementation steps are as follows: (1) Constructing a complete historical sample dataset. This embodiment can collect soil samples from various scenarios such as farmland, industrial areas, and mining areas, accumulating 1000 sets of valid historical soil samples, covering three types of pollution: heavy metal pollution, organic pollutant pollution, and mixed pollution, as well as different pollution degree gradients. For each set of samples, the feature extraction and fusion process described above is strictly followed, and the soil spectral data preprocessing, first and second spectral feature extraction, and first and second physicochemical feature extraction are completed in sequence. Then, based on the actual pollution type of the sample, weighted fusion is performed to obtain the third spectral feature and third physicochemical feature corresponding to each set of samples, forming a 15-dimensional comprehensive feature vector. This embodiment can, based on the "Soil Environmental Quality Agricultural Land Soil Pollution Risk Control Standard" and the "Soil Environmental Quality Construction Land Soil Pollution Risk Control Standard", combined with the quantitative detection results of laboratory atomic absorption spectrometry and gas chromatography, label each set of comprehensive feature vectors with clear pollution type labels (heavy metal pollution / organic pollutant pollution / mixed pollution), ensuring that the labels are completely consistent with the actual pollution status of the samples, and constructing a labeled historical sample dataset.

[0061] (2) Data Preprocessing and Dataset Partitioning. This embodiment can adopt the same logic as the feature standardization described above to standardize the comprehensive feature vectors in the historical sample dataset within the 0-1 range, eliminating the dimensional differences between different features and ensuring the fairness of model training. In this embodiment, the preprocessed dataset can be randomly divided into a training set and a validation set in a 7:3 ratio, with 700 sets used for model training and 300 sets used for model performance validation. During the partitioning process, the proportion of samples of the three types of contamination is kept consistent to avoid data bias affecting the model's generalization ability.

[0062] (3) XGBoost Model Training and Optimization. In this embodiment, the XGBoost model parameters can be initialized, for example, the initial number of decision trees can be set to 100, the maximum tree depth to 6, and the learning rate to 0.1. The objective function is the multi-class log loss function. The model is iteratively trained using the training set data. After each round of training, the classification accuracy, precision, and recall of the model are calculated using the validation set data. In this embodiment, the grid search method can be used to optimize the model hyperparameters. The parameter combinations of 50-200 decision trees, 3-10 maximum tree depth, and 0.01-0.2 learning rate are traversed, and the optimal parameter combination is selected by combining the 5-fold cross-validation method. Finally, the optimal parameters are determined to be 150 decision trees, 8 maximum tree depth, and 0.08 learning rate. At this time, the classification accuracy of the model on the validation set reaches more than 96%, and the recall of the three types of contamination is not less than 94%, which meets the detection accuracy requirements. The model training is completed and the optimal parameters are fixed.

[0063] (4) Target Soil Sample Detection and Result Output. For the target soil sample to be detected, this embodiment can complete the extraction and standardization of the third spectral feature and the third physicochemical feature according to the same process, forming a 15-dimensional comprehensive feature vector, which is then organized according to the input format required by the model. This embodiment can input the organized comprehensive feature vector into the trained and solidified XGBoost model. The model uses multiple built-in decision trees to perform layer-by-layer splitting and weight allocation of the features, performs probability prediction of the pollution type of the target sample, and outputs predicted probability values ​​for three pollution types. This embodiment can determine the final pollution type of the target sample based on the maximum predicted probability, and, combined with the probability value output by the model and relevant standards, simultaneously output the corresponding pollution risk level (low risk / medium risk / high risk), forming a complete pollution detection result, providing a direct reference for soil pollution control and remediation.

[0064] (5) Model adaptation and maintenance. In view of the differences in soil matrix in different regions, this embodiment can collect new soil sample data regularly, perform incremental training on the solidified XGBoost model, and update the model parameters to adapt to new detection scenarios; if the detection needs focus on a single high-pollution area, a special XGBoost sub-model can be trained based on the historical sample data of that area to further improve the detection accuracy in specific scenarios.

[0065] As can be seen from the above, this embodiment extracts spectral and physicochemical features from different dimensions in stages to first preliminarily determine the sample type, and then accurately identify specific types such as heavy metal pollution, organic pollutant pollution, and mixed pollution for samples with excessive pollution. The differentiated extraction of features from different dimensions can fully explore key information related to pollution type, avoid the information limitations of single-dimensional features, and thus accurately distinguish between mixed pollution and single pollution, improving the accuracy of pollution type identification.

[0066] This embodiment combines spectral and physicochemical characteristics based on specific pollution types, integrating the synergistic characterization effects of both types of features and fully utilizing feature correlations to avoid insufficient detection specificity. This embodiment balances detection accuracy with scenario adaptability, providing reliable data support for soil pollution control and remediation, and meeting the actual needs of various soil pollution detection methods.

[0067] Corresponding to the soil pollution detection method in the above embodiments, Figure 2 This is a structural block diagram of a soil pollution detection device provided according to an embodiment of this application. For ease of explanation, only the parts relevant to the embodiment of this application are shown. References Figure 2 The soil pollution detection device 20 includes: a sample type identification module 21, a pollution type identification module 22, a feature fusion module 23, and a pollution detection and analysis module 24.

[0068] The sample type identification module 21 is used to extract a first spectral feature from the soil spectral data of the target soil sample and extract a first physicochemical feature from the soil property data of the target soil sample; and determine the sample type of the target soil sample based on the first spectral feature and the first physicochemical feature. The pollution type identification module 22 is used to extract a second spectral feature from soil spectral data and a second physicochemical feature from soil property data if the sample type is a sample with excessive pollution. Based on the second spectral feature and the second physicochemical feature, the target pollution type of the target soil sample is determined. The feature dimensions of the first spectral feature and the second spectral feature are different, and the feature dimensions of the first physicochemical feature and the second physicochemical feature are different. The target pollution type includes heavy metal pollution, organic pollutant pollution, or mixed pollution. The feature fusion module 23 is used to perform weighted fusion of the first spectral feature and the second spectral feature based on the target pollution type to obtain the third spectral feature; and to perform weighted fusion of the first physicochemical feature and the second physicochemical feature based on the target pollution type to obtain the third physicochemical feature. The pollution detection and analysis module 24 is used to detect pollution in the target soil sample based on the third spectral characteristics and the third physicochemical characteristics, and obtain the pollution detection results.

[0069] In one embodiment of this application, when the sample type identification module 21 extracts the first spectral feature from the soil spectral data of the target soil sample, it is specifically used for: The soil spectral data of the target soil sample were subjected to moving average filtering and polynomial fitting baseline correction to obtain standardized spectral data; The first wavelength range is determined based on the characteristic absorption peak data of heavy metal elements, and the second wavelength range is determined based on the characteristic absorption peak data of organic pollutants. The target wavelength range is obtained by merging the first wavelength range and the second wavelength range. Effective characteristic peaks are identified from the standardized spectral data corresponding to the target wavelength range, and the mean intensity, standard deviation, and density of all effective characteristic peaks are calculated. Calculate the background noise intensity based on the standardized spectral data corresponding to the non-target wavelength range; The effective signal-to-noise ratio of the characteristic peaks is calculated based on the background noise intensity and the mean intensity of the characteristic peaks. The coefficient of variation of characteristic peak intensity is calculated based on the mean and standard deviation of characteristic peak intensity. For each effective characteristic peak, calculate the matching degree between the wavelength corresponding to the effective characteristic peak and the standard wavelengths of multiple pollutants, and take the maximum matching degree corresponding to the effective characteristic peak as the characteristic peak wavelength matching degree of the effective characteristic peak. The effective characteristic peak signal-to-noise ratio, effective characteristic peak density, characteristic peak intensity variation coefficient, and wavelength matching degree of all characteristic peaks are used as the first spectral features.

[0070] In one embodiment of this application, when determining the sample type of a target soil sample based on the first spectral feature and the first physicochemical feature, the sample type identification module 21 is specifically used to: determine the sample type of the target soil sample based on the first spectral feature and the first physicochemical feature by using a target random forest model; the target random forest model is trained based on multiple historical soil sample data; each historical soil sample data includes the first spectral feature and the first physicochemical feature extracted in history, and each historical soil sample data is labeled with a pollution exceeding the standard sample label or a pollution not exceeding the standard sample label.

[0071] In one embodiment of this application, when the pollution type identification module 22 extracts the second spectral features from the soil spectral data and the second physicochemical features from the soil property data, it is specifically used to: extract the signal-to-noise ratio of heavy metals, the signal-to-noise ratio of organic pollutants, the overlap of characteristic peaks, the wavelength matching rate of heavy metals, and the wavelength matching rate of organic pollutants from the soil spectral data as the second spectral features; and extract the soil cation exchange capacity and the soil redox potential from the soil property data as the second physicochemical features.

[0072] In one embodiment of this application, when determining the target pollution type of a target soil sample based on second spectral characteristics and second physicochemical characteristics, the pollution type identification module 22 is specifically used for: The heavy metal pollution rate was calculated based on the heavy metal signal-to-noise ratio, heavy metal wavelength matching rate, and soil cation exchange capacity. The organic pollutant pollution rate was calculated based on the signal-to-noise ratio of organic pollutants, the wavelength matching rate of organic pollutants, and the soil redox potential. The mixed pollution rate is calculated based on the heavy metal pollution rate, the organic pollutant pollution rate, and the overlap of characteristic peaks. If the heavy metal pollution rate is not less than the first probability threshold and the organic pollutant pollution rate is not greater than the second probability threshold, then the target pollution type of the target soil sample is determined to be heavy metal pollution. If the heavy metal pollution rate is not greater than the second probability threshold and the organic pollutant pollution rate is not less than the first probability threshold, then the target pollution type of the target soil sample is determined to be organic pollutant pollution. If the heavy metal pollution rate and the organic pollutant pollution rate are both less than the first probability threshold and greater than the second probability threshold, and / or the mixed pollution rate is not less than the first probability threshold, then the target pollution type of the target soil sample is determined to be mixed pollution.

[0073] In one embodiment of this application, when the feature fusion module 23 performs weighted fusion of the first spectral feature and the second spectral feature based on the target pollution type to obtain the third spectral feature, it is specifically used for: Determine the weighting coefficients corresponding to the effective characteristic peak signal-to-noise ratio, effective characteristic peak density, characteristic peak intensity variation coefficient, wavelength matching degree of all characteristic peaks, signal-to-noise ratio of heavy metals, signal-to-noise ratio of organic pollutants, characteristic peak overlap, wavelength matching rate of heavy metals, and wavelength matching rate of organic pollutants. If the target pollution type is heavy metal pollution, the weight coefficients corresponding to the heavy metal signal-to-noise ratio and the heavy metal wavelength matching rate are updated based on the first proportional coefficient, and the weight coefficients corresponding to the organic pollutant signal-to-noise ratio and the organic pollutant wavelength matching rate are updated based on the second proportional coefficient; the first proportional coefficient is greater than 1, and the second proportional coefficient is less than 1. If the target pollution type is organic pollutant pollution, the weight coefficients corresponding to the heavy metal signal-to-noise ratio and the heavy metal wavelength matching rate are updated based on the second proportional coefficient, and the weight coefficients corresponding to the organic pollutant signal-to-noise ratio and the organic pollutant wavelength matching rate are updated based on the first proportional coefficient. If the target pollution type is mixed pollution, the weight coefficients corresponding to the heavy metal signal-to-noise ratio, heavy metal wavelength matching rate, organic pollutant signal-to-noise ratio, organic pollutant wavelength matching rate, and characteristic peak overlap are updated based on the third proportional coefficient; the third proportional coefficient is greater than the first proportional coefficient. The third spectral feature is obtained by weighting and fusing the first and second spectral features based on the weight coefficients corresponding to each feature in the first and second spectral features.

[0074] In one embodiment of this application, when the pollution detection and analysis module 24 performs pollution detection on a target soil sample based on the third spectral features and the third physicochemical features to obtain pollution detection results, it is specifically used to: obtain pollution detection results based on the third spectral features and the third physicochemical features through a target pollution detection model; the target pollution detection model is trained based on multiple historical soil sample data, each historical soil sample data includes historically acquired third spectral features and third physicochemical features, and each historical soil sample data is labeled with a pollution type label.

[0075] See Figure 3 , Figure 3 This is a schematic block diagram of an electronic device provided according to an embodiment of this application. Figure 3 The electronic device 300 in this embodiment may include one or more processors 301, one or more input devices 302, one or more output devices 303, and one or more memories 304. The processors 301, input devices 302, output devices 303, and memories 304 communicate with each other via a communication bus 305. The memories 304 store computer programs, including program instructions. The processors 301 execute the program instructions stored in the memories 304. Specifically, the processors 301 are configured to invoke the program instructions to perform the functions of the modules in the aforementioned device embodiments, for example... Figure 2 The functions of the sample type identification module 21, pollution type identification module 22, feature fusion module 23, and pollution detection and analysis module 24 are shown.

[0076] It should be understood that, in the embodiments of this application, the processor 301 may be a central processing unit (CPU), but it may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0077] Input device 302 may include a touchpad, a fingerprint sensor (for collecting the user's fingerprint information and fingerprint orientation information), a microphone, etc., and output device 303 may include a display (LCD, etc.), a speaker, etc.

[0078] The memory 304 may include read-only memory and random access memory, and provides instructions and data to the processor 301. A portion of the memory 304 may also include non-volatile random access memory. For example, the memory 304 may also store soil testing information.

[0079] In specific implementations, the processor 301, input device 302, and output device 303 described in the embodiments of this application can execute the implementation methods described in the embodiments of the soil pollution detection method provided in this application, or they can execute the implementation methods of the electronic device 300 described in the embodiments of this application, which will not be repeated here.

[0080] In another embodiment of this application, a computer-readable storage medium is provided. This computer-readable storage medium stores a computer program, which includes program instructions. When executed by a processor, the program instructions implement all or part of the processes in the methods described above. Alternatively, the computer program can instruct related hardware to complete the process. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include any entity or device capable of carrying computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0081] The computer-readable storage medium can be an internal storage unit of the electronic device in any of the foregoing embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD) card, flash card, etc., equipped on the electronic device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the electronic device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0082] Those skilled in the art will recognize that the modules / units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0083] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the electronic devices and units described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0084] In the several embodiments provided in this application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules / units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules, units, or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces or modules / units, or it may be an electrical, mechanical, or other form of connection.

[0085] The modules / units described as separate components may or may not be physically separate. Similarly, the components shown as modules / units may or may not be physical modules / units; they may be located in one place or distributed across multiple network modules / units. Some or all of the modules / units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.

[0086] Furthermore, the functional modules / units in the various embodiments of this application can be integrated into one processing module / unit, or each module / unit can exist physically separately, or two or more modules / units can be integrated into one module / unit. The integrated modules / units described above can be implemented in hardware or in the form of software functional modules / units.

[0087] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for detecting soil pollution, characterized in that, include: Extract the first spectral features from the soil spectral data of the target soil sample, and extract the first physicochemical features from the soil property data of the target soil sample; The sample type of the target soil sample is determined based on the first spectral characteristics and the first physicochemical characteristics; If the sample type is a polluted sample, then a second spectral feature is extracted from the soil spectral data, and a second physicochemical feature is extracted from the soil property data; The target pollution type of the target soil sample is determined based on the second spectral characteristics and the second physicochemical characteristics; the first spectral characteristics and the second spectral characteristics have different feature dimensions, and the first physicochemical characteristics and the second physicochemical characteristics have different feature dimensions; the target pollution type includes heavy metal pollution, organic pollutant pollution, or mixed pollution; The first spectral feature and the second spectral feature are weighted and fused based on the target pollution type to obtain a third spectral feature; the first physicochemical feature and the second physicochemical feature are weighted and fused based on the target pollution type to obtain a third physicochemical feature; Based on the third spectral characteristics and the third physicochemical characteristics, the target soil sample is subjected to pollution detection to obtain pollution detection results.

2. The soil pollution detection method as described in claim 1, characterized in that, The extraction of the first spectral feature from the soil spectral data of the target soil sample includes: The soil spectral data of the target soil sample were subjected to moving average filtering and polynomial fitting baseline correction to obtain standardized spectral data; The first wavelength range is determined based on the characteristic absorption peak data of heavy metal elements, and the second wavelength range is determined based on the characteristic absorption peak data of organic pollutants. The first wavelength range and the second wavelength range are combined to obtain the target wavelength range; Effective characteristic peaks are identified from the standardized spectral data corresponding to the target wavelength range, and the mean intensity, standard deviation, and density of all effective characteristic peaks are calculated. Calculate the background noise intensity based on the standardized spectral data corresponding to the non-target wavelength range; The effective signal-to-noise ratio of the characteristic peaks is calculated based on the background noise intensity and the average intensity of the characteristic peaks. The coefficient of variation of the characteristic peak intensity is calculated based on the mean intensity of the characteristic peak and the standard deviation of the characteristic peak intensity. For each effective characteristic peak, calculate the matching degree between the wavelength corresponding to the effective characteristic peak and the standard wavelengths of multiple pollutants, and take the maximum matching degree corresponding to the effective characteristic peak as the characteristic peak wavelength matching degree of the effective characteristic peak. The effective characteristic peak signal-to-noise ratio, the effective characteristic peak density, the characteristic peak intensity variation coefficient, and the wavelength matching degree of all the characteristic peaks are used as the first spectral features.

3. The soil pollution detection method as described in claim 1, characterized in that, Determining the sample type of the target soil sample based on the first spectral characteristics and the first physicochemical characteristics includes: Based on the first spectral feature and the first physicochemical feature, the sample type of the target soil sample is determined by the target random forest model; the target random forest model is trained based on multiple historical soil sample data; each historical soil sample data includes the first spectral feature and the first physicochemical feature extracted in history, and each historical soil sample data is labeled with a pollution exceeding the standard sample label or a pollution not exceeding the standard sample label.

4. The soil pollution detection method as described in claim 2, characterized in that, The extraction of a second spectral feature from the soil spectral data and the extraction of a second physicochemical feature from the soil property data include: The signal-to-noise ratio of heavy metals, the signal-to-noise ratio of organic pollutants, the overlap of characteristic peaks, the wavelength matching rate of heavy metals, and the wavelength matching rate of organic pollutants were extracted from the soil spectral data as second spectral features. Soil cation exchange capacity and soil redox potential are extracted from the soil property data as second physicochemical characteristics.

5. The soil pollution detection method as described in claim 4, characterized in that, The determination of the target pollution type of the target soil sample based on the second spectral characteristics and the second physicochemical characteristics includes: The heavy metal pollution rate is calculated based on the heavy metal signal-to-noise ratio, the heavy metal wavelength matching rate, and the soil cation exchange capacity. The organic pollutant pollution rate is calculated based on the signal-to-noise ratio of the organic pollutants, the wavelength matching rate of the organic pollutants, and the soil redox potential. The mixed pollution rate is calculated based on the heavy metal pollution rate, the organic pollutant pollution rate, and the characteristic peak overlap. If the heavy metal pollution rate is not less than a first probability threshold and the organic pollutant pollution rate is not greater than a second probability threshold, then the target pollution type of the target soil sample is determined to be heavy metal pollution. If the heavy metal pollution rate is not greater than the second probability threshold and the organic pollutant pollution rate is not less than the first probability threshold, then the target pollution type of the target soil sample is determined to be organic pollutant pollution. If the heavy metal pollution rate and the organic pollutant pollution rate are both less than a first probability threshold and greater than a second probability threshold, and / or the mixed pollution rate is not less than the first probability threshold, then the target pollution type of the target soil sample is determined to be mixed pollution.

6. The soil pollution detection method as described in claim 5, characterized in that, The weighted fusion of the first spectral feature and the second spectral feature based on the target pollution type to obtain the third spectral feature includes: Determine the weighting coefficients corresponding to the effective characteristic peak signal-to-noise ratio, the effective characteristic peak density, the characteristic peak intensity variation coefficient, the wavelength matching degree of all characteristic peaks, the heavy metal signal-to-noise ratio, the organic pollutant signal-to-noise ratio, the characteristic peak overlap, the heavy metal wavelength matching rate, and the organic pollutant wavelength matching rate; If the target pollution type is heavy metal pollution, the weight coefficients corresponding to the heavy metal signal-to-noise ratio and the heavy metal wavelength matching rate are updated based on the first proportional coefficient, and the weight coefficients corresponding to the organic pollutant signal-to-noise ratio and the organic pollutant wavelength matching rate are updated based on the second proportional coefficient; the first proportional coefficient is greater than 1, and the second proportional coefficient is less than 1. If the target pollution type is organic pollutant pollution, the weight coefficients corresponding to the heavy metal signal-to-noise ratio and the heavy metal wavelength matching rate are updated based on the second proportional coefficient, and the weight coefficients corresponding to the organic pollutant signal-to-noise ratio and the organic pollutant wavelength matching rate are updated based on the first proportional coefficient. If the target pollution type is mixed pollution, the weight coefficients corresponding to the heavy metal signal-to-noise ratio, the heavy metal wavelength matching rate, the organic pollutant signal-to-noise ratio, the organic pollutant wavelength matching rate, and the characteristic peak overlap are updated based on the third proportional coefficient; the third proportional coefficient is greater than the first proportional coefficient. The first spectral feature and the second spectral feature are weighted and fused based on the weight coefficients corresponding to all features in the first spectral feature and the second spectral feature to obtain the third spectral feature.

7. The soil pollution detection method as described in claim 1, characterized in that, The pollution detection of the target soil sample based on the third spectral characteristics and the third physicochemical characteristics, to obtain pollution detection results, includes: Based on the third spectral characteristics and the third physicochemical characteristics, pollution detection results are obtained through the target pollution detection model; The target pollution detection model is trained based on multiple historical soil sample data. Each historical soil sample data includes historically acquired third spectral features and third physicochemical features, and each historical soil sample data is labeled with a pollution type label.

8. A soil pollution detection device, characterized in that, include: The sample type identification module is used to extract the first spectral feature from the soil spectral data of the target soil sample and the first physicochemical feature from the soil property data of the target soil sample. The sample type of the target soil sample is determined based on the first spectral characteristics and the first physicochemical characteristics; The pollution type identification module is used to extract a second spectral feature from the soil spectral data and a second physicochemical feature from the soil property data if the sample type is a sample with excessive pollution. The target pollution type of the target soil sample is determined based on the second spectral characteristics and the second physicochemical characteristics; the first spectral characteristics and the second spectral characteristics have different feature dimensions, and the first physicochemical characteristics and the second physicochemical characteristics have different feature dimensions; the target pollution type includes heavy metal pollution, organic pollutant pollution, or mixed pollution; The feature fusion module is used to perform weighted fusion of the first spectral feature and the second spectral feature based on the target pollution type to obtain a third spectral feature; and to perform weighted fusion of the first physicochemical feature and the second physicochemical feature based on the target pollution type to obtain a third physicochemical feature. The pollution detection and analysis module is used to detect pollution in the target soil sample based on the third spectral characteristics and the third physicochemical characteristics, and to obtain pollution detection results.

9. 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, it implements the steps of the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.