Method and device for constructing polycyclic aromatic hydrocarbon recognition model in water, electronic equipment and storage medium
Patent Information
- Application Number
- CN202611247612.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-10-30
AI Technical Summary
然而,由于PAHs在200-400nm波段内具有高度相似且相互重叠的紫外吸收特征,同时水体中溶解性有机物(DOM)等背景组分广泛存在并产生干扰信号,传统基于统计学的光谱分析方法难以从复杂背景中准确识别PAHs污染
[0016]在本公开实施例中,对多种水样数据进行紫外可见全光谱扫描,得到每种水样数据的紫外可见吸光度光谱数据;所述多种水样数据包括含有多环芳烃的样本和含有干扰物的样本,所述干扰物为在水体中对多环芳烃的紫外可见吸收光谱产生背景干扰的物质;构建样本数据集,所述样本数据集的每个样本数据包括所述光谱数据以及对应的二分类标签,所述二分类标签用于指示所述样本数据中是否含有多环芳烃;以所述光谱数据为输入特征、以对应的二分类标签为期望输出,对初始分类模型进行训练,得到训练后的多环芳烃识别模型;其中,所述初始分类模型为集成学习模型,用于通过构建多个弱学习器并对各弱学习器的输出进行集成,对所述光谱数据中的非线性特征进行挖掘,以区分含多环芳烃样本与不含多环芳烃样本的光谱差异;所述多环芳烃识别模型用于对待检测水样数据进行识别,得到识别结果。通过使用本公开实施例的方法构建的模型,能够快速准确地识别水中是否多环芳烃。
Smart Images

Figure CN123017241A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of water environment monitoring technology, and in particular to a method and apparatus for constructing a polycyclic aromatic hydrocarbon (PAH) identification model in water, as well as electronic equipment and storage medium. Background Technology
[0002] Polycyclic aromatic hydrocarbons (PAHs) are organic compounds consisting of two or more benzene rings linked together in a fused manner. Their typical characteristics include significant carcinogenic, teratogenic, and mutagenic effects. Once surface water bodies or groundwater aquifers are contaminated with PAHs, the safety of drinking water sources and the stability of watershed ecosystems will face direct and severe challenges.
[0003] Currently, conventional PAH detection methods mainly rely on high-performance liquid chromatography-fluorescence detection (HPLC-FLD) and gas chromatography-mass spectrometry (GC-MS). However, these two methods have problems such as complex sample pretreatment, decreased detection sensitivity due to environmental interference, expensive detection instruments, and long analysis cycles for single samples.
[0004] The qualitative identification of substances using ultraviolet-visible spectroscopy relies on the selective absorption characteristics of substances to electromagnetic radiation in the ultraviolet region (10-400 nm). This method is particularly suitable for aromatic compounds containing conjugated double bonds, such as polycyclic aromatic hydrocarbons, because the conjugated systems within the molecule... The bond structure produces characteristic absorption peaks in the ultraviolet region. However, since PAHs have highly similar and overlapping ultraviolet absorption characteristics in the 200-400 nm wavelength range, and background components such as dissolved organic matter (DOM) are widely present in water bodies and generate interference signals, traditional statistical spectral analysis methods are difficult to accurately identify PAH pollution from complex backgrounds. Summary of the Invention
[0005] In view of this, this disclosure proposes a construction scheme for a polycyclic aromatic hydrocarbon (PAH) identification model in water.
[0006] According to one aspect of this disclosure, a method for constructing a polycyclic aromatic hydrocarbon (PAH) identification model in water is provided, comprising: performing ultraviolet-visible full-spectrum scanning on multiple water sample data to obtain ultraviolet-visible absorbance spectral data for each type of water sample data; the multiple water sample data includes samples containing PAHs and samples containing interfering substances, wherein the interfering substances are substances that generate background interference to the ultraviolet-visible absorption spectrum of PAHs in water; constructing a sample dataset, wherein each sample data in the sample dataset includes the spectral data and a corresponding binary classification label, the binary classification label being used to indicate whether the sample data contains PAHs; training an initial classification model using the spectral data as input features and the corresponding binary classification label as the desired output to obtain a trained PAH identification model; wherein the initial classification model is an ensemble learning model, used to construct multiple weak learners and integrate the outputs of each weak learner to mine nonlinear features in the spectral data to distinguish the spectral differences between samples containing PAHs and samples not containing PAHs; the PAH identification model is used to identify the water sample data to be detected to obtain an identification result.
[0007] In one possible implementation, the interfering substance includes monocyclic aromatic hydrocarbons (PAHs); the step of performing a full UV-Vis spectral scan on multiple water sample data to obtain UV-Vis absorbance spectral data for each water sample data includes: acquiring first spectral data of multi-concentration gradient samples of a standard solution of various polycyclic aromatic hydrocarbons in equal proportions; acquiring second spectral data of a mixed solution sample of polycyclic aromatic hydrocarbons and monocyclic aromatic hydrocarbons; and acquiring third spectral data of actual surface water and groundwater samples and spiked samples under different hydrological conditions.
[0008] In one possible implementation, the wavelength range of the ultraviolet-visible full-spectrum scan is 189~815nm, the spectral resolution is 0.6nm, and absorbance data at 1024 wavelength points are obtained for each sample.
[0009] In one possible implementation, the ultraviolet-visible absorbance spectral data includes absorbance values at wavelength points. The step of training an initial classification model using the spectral data as input features and the corresponding binary classification labels as the expected output includes: dividing the sample dataset into a training set and a test set; and training the initial classification model using the absorbance values at wavelength points as the model input and the binary classification labels as the expected output of the initial classification model.
[0010] In one possible implementation, the method further includes: evaluating the model using the test set based on preset evaluation metrics, the evaluation metrics including accuracy, recall, and F1 score.
[0011] In one possible implementation, the method further includes: using cross-validation combined with grid search to fine-tune the hyperparameters of the initial classification model; using the average classification accuracy of cross-validation as the basis for model selection; selecting a combination of hyperparameters whose average classification accuracy meets preset conditions as target hyperparameters; and using the target hyperparameters to retrain the initial classification model using the training set to obtain a trained polycyclic aromatic hydrocarbon (PAH) recognition model.
[0012] According to another aspect of this disclosure, a method for identifying polycyclic aromatic hydrocarbons (PAHs) based on ultraviolet-visible spectroscopy is provided, comprising: acquiring ultraviolet-visible absorption spectral data of a water sample to be tested; inputting the spectral data into a pre-trained PAH identification model to obtain a classification result of whether the water sample to be tested contains PAHs; wherein the PAH identification model is constructed based on the construction method of the PAH identification model in water.
[0013] According to another aspect of this disclosure, an apparatus for constructing a polycyclic aromatic hydrocarbon (PAH) identification model in water is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above method.
[0014] According to another aspect of this disclosure, a non-volatile computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described method.
[0015] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0016] In this embodiment, multiple water sample data are subjected to UV-Vis full-spectrum scanning to obtain UV-Vis absorbance spectral data for each type of water sample. The multiple water sample data include samples containing polycyclic aromatic hydrocarbons (PAHs) and samples containing interfering substances, which are substances that cause background interference to the UV-Vis absorption spectrum of PAHs in water. A sample dataset is constructed, where each sample data includes the spectral data and a corresponding binary classification label. The binary classification label indicates whether the sample data contains PAHs. An initial classification model is trained using the spectral data as input features and the corresponding binary classification label as the desired output to obtain a trained PAH identification model. The initial classification model is an ensemble learning model, used to construct multiple weak learners and integrate their outputs to mine nonlinear features in the spectral data, thereby distinguishing the spectral differences between samples containing PAHs and those without. The PAH identification model is used to identify the water sample data to be tested, obtaining the identification result. The model constructed using the method of this embodiment can quickly and accurately identify whether PAHs are present in water.
[0017] In this embodiment of the disclosure, ultraviolet-visible absorption spectra of different water samples containing and without PAHs are collected, and a training dataset is constructed by combining PAHs detection information. This dataset is used to train an ensemble learning model and establish a qualitative PAHs identification model. By learning the nonlinear mapping relationship between spectral signals and PAH classification labels through the model, it is possible to directly predict the spectral data of new samples without complex pretreatment and chromatographic separation, thereby quickly and accurately identifying whether there are PAHs in the water.
[0018] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0019] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.
[0020] Figure 1 A flowchart illustrating a method for constructing a water polycyclic aromatic hydrocarbon (PAH) identification model according to an embodiment of the present disclosure is shown.
[0021] Figure 2 A schematic diagram showing the ultraviolet-visible absorption spectrum of a mixed standard solution of polycyclic aromatic hydrocarbons according to an embodiment of the present disclosure.
[0022] Figure 3 A schematic diagram of the XGBoost model architecture according to an embodiment of the present disclosure is shown.
[0023] Figure 4 A schematic diagram illustrating the accuracy training of an XGBoost model according to an embodiment of the present disclosure is shown.
[0024] Figure 5 A schematic diagram showing the confusion matrix of an XGBoost model on the training and test sets according to an embodiment of the present disclosure.
[0025] Figure 6 A schematic diagram illustrating the model building process of a rapid identification method for polycyclic aromatic hydrocarbons according to an embodiment of the present disclosure is shown.
[0026] Figure 7 This diagram illustrates a comparison of the results of a rapid identification method for polycyclic aromatic hydrocarbons (PAHs) in actual water samples and a GC-MS detection method according to embodiments of the present disclosure.
[0027] Figure 8 A block diagram of an apparatus for constructing a polycyclic aromatic hydrocarbon (PAH) identification model in water according to an embodiment of the present disclosure is shown.
[0028] Figure 9 A block diagram of an apparatus according to an embodiment of the present disclosure is shown. Detailed Implementation
[0029] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0030] As used herein, the terms “comprising,” “including,” “having,” or variations thereof are open-ended and include one or more of the stated features, integrals, elements, steps, components, or functions, but do not exclude the presence or addition of one or more other features, integrals, elements, steps, components, functions, or groups thereof.
[0031] When an element is referred to as “connected,” “coupled,” “responding,” or a variation thereof relative to another element, it may be directly connected, coupled, or responding to another element, or there may be an intermediate element present.
[0032] Although the terms first, second, third, etc., may be used herein to describe various elements / operations, these elements / operations should not be limited by these terms. These terms are only used to distinguish one element / operation from another. Therefore, without departing from the teachings of the inventive concept, a first element / operation in some embodiments may be referred to as a second element / operation in other embodiments.
[0033] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0034] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0035] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant regions.
[0036] Figure 1 A flowchart illustrating a method for constructing a water-based polycyclic aromatic hydrocarbon (PAH) identification model according to an embodiment of this disclosure is shown. Figure 1 As shown, the method includes:
[0037] S11. Perform UV-Vis full-spectrum scanning on multiple water sample data to obtain UV-Vis absorbance spectral data for each water sample data; the multiple water sample data include samples containing polycyclic aromatic hydrocarbons and samples containing interfering substances, wherein the interfering substances are substances that cause background interference to the UV-Vis absorption spectrum of polycyclic aromatic hydrocarbons in the water body.
[0038] In this embodiment of the disclosure, ultraviolet-visible full-spectrum scanning can be performed on various water sample data. The ultraviolet-visible full-spectrum scanning can be performed by placing the water sample in an instrument, changing the irradiation wavelength sequentially within a set ultraviolet and visible light wavelength range, and measuring the absorbance data of the water sample at each wavelength point. The obtained data can be plotted as a curve with wavelength as the abscissa and absorbance data as the ordinate to obtain the full-spectrum scanning spectrum of the water sample, which is the ultraviolet-visible absorbance spectrum data.
[0039] In one possible implementation, the wavelength range of the ultraviolet-visible full-spectrum scan is 189~815nm, the spectral resolution is 0.6nm, and absorbance data at 1024 wavelength points are obtained for each sample.
[0040] In this embodiment, the wavelength range of the ultraviolet-visible full-spectrum scan can be 189-815 nm, and the spectral resolution can be 0.6 nm, obtaining absorbance data for 1024 wavelength points for each sample. In this embodiment, after baseline correction using deionized water as a blank, each water sample can be scanned three times consecutively, and the average value can be taken as the spectral data of that sample, in order to reduce the influence of random errors on the measurement results.
[0041] In this embodiment, by performing ultraviolet-visible full-spectrum scanning on various water sample data, spectral data of the water sample at each wavelength point is continuously acquired, generating a complete full-spectrum scan map. Compared with the discrete detection method in related technologies that only acquires a limited number of wavelengths, this embodiment provides a significantly increased amount of information, and can more comprehensively reflect the comprehensive spectral characteristics of various substances in the water sample.
[0042] In this embodiment of the disclosure, various water sample data may include samples containing polycyclic aromatic hydrocarbons and samples containing interfering substances, which may be substances that cause background interference to the ultraviolet-visible absorption spectrum of polycyclic aromatic hydrocarbons in the water.
[0043] In one possible implementation, the interfering substance includes monocyclic aromatic hydrocarbons (PAHs); the step of performing a full UV-Vis spectral scan on multiple water sample data to obtain UV-Vis absorbance spectral data for each water sample data includes: acquiring first spectral data of multi-concentration gradient samples of a standard solution of various polycyclic aromatic hydrocarbons in equal proportions; acquiring second spectral data of a mixed solution sample of polycyclic aromatic hydrocarbons and monocyclic aromatic hydrocarbons; and acquiring third spectral data of actual surface water and groundwater samples and spiked samples under different hydrological conditions.
[0044] In this embodiment, the data sample system can adopt a three-layer progressive design, introducing complex interference factors and matrix conditions layer by layer: Specifically, the first layer can be a multi-concentration gradient sample of a standard solution of 16 polycyclic aromatic hydrocarbons in equal proportions, used to capture the intrinsic spectral fingerprint characteristics of the target pollutant; the second layer can be a mixed solution sample of polycyclic aromatic hydrocarbons and monocyclic aromatic hydrocarbons (e.g., benzene and benzene homologues) prepared according to an orthogonal experimental design, used to systematically quantify the coupling interference law of coexisting interference substances on the target spectrum; the third layer can be actual surface water and groundwater samples and their spiked samples covering different hydrological conditions, used to introduce the matrix effect of real water bodies and test the predictive reliability of the model under complex working conditions.
[0045] In one possible implementation, the 16 polycyclic aromatic hydrocarbons may include one or more of naphthalene, acenaphthene, acenaphthene, fluorene, phenanthrene, anthracene, fluoranthene, pyrene, benzo[a]anthracene, α, benzo[b]fluoranthene, benzo[k]fluoranthene, benzo[a]pyrene, indo[1,2,3-cd]pyrene, dibenzo[a,h]anthracene, and benzo[ghi]perylene.
[0046] In this embodiment of the disclosure, instead of distinguishing different PAHs monomers, the mixed pollution characteristics composed of more than ten PAHs are identified as a whole target category and distinguished from similar spectral signals produced by natural organic matter and other non-target substances.
[0047] Figure 2 A schematic diagram showing the UV-Vis absorption spectrum of a mixed standard solution of polycyclic aromatic hydrocarbons according to an embodiment of the present disclosure. Figure 2 As shown, the horizontal axis represents wavelength, the vertical axis represents absorbance, and the curve represents a mixed standard solution of PAHs with different concentrations. This spectrum can screen for the characteristic wavelengths of polycyclic aromatic hydrocarbons in ultraviolet light.
[0048] In this embodiment of the disclosure, the data sample system adopts a three-layer progressive design, which can capture the intrinsic spectral fingerprint characteristics of the target pollutant, quantify the coupling interference law of coexisting interfering substances on the target spectrum, and introduce the real water matrix effect to test the predictive reliability of the model under complex working conditions.
[0049] S12. Construct a sample dataset, wherein each sample data in the sample dataset includes the spectral data and a corresponding binary classification label, wherein the binary classification label is used to indicate whether the sample data contains polycyclic aromatic hydrocarbons;
[0050] In this embodiment of the disclosure, a dataset including spectral data and corresponding binary labels can be constructed. That is, the spectral data and the corresponding binary labels indicating whether PAHs are detected are used as sample data to construct the dataset. The binary labels can be 0 to indicate that they are not detected and 1 to indicate that they are detected.
[0051] S13. Using the spectral data as input features and the corresponding binary classification label as the desired output, the initial classification model is trained to obtain the trained polycyclic aromatic hydrocarbon (PAH) identification model. The initial classification model is an ensemble learning model, used to construct multiple weak learners and integrate their outputs to mine the nonlinear features in the spectral data, thereby distinguishing the spectral differences between samples containing PAHs and those without. The PAH identification model is used to identify the water sample data to be tested, obtaining the identification result.
[0052] The ensemble learning model can be a final prediction system formed by aggregating the prediction results of multiple base learners through a specific combination strategy. In this embodiment, an extreme gradient boosting (XGBoost) machine learning model can be used. Multiple weak learners can be constructed and their outputs integrated to mine the nonlinear features in the spectral data, thereby distinguishing the spectral differences between samples containing polycyclic aromatic hydrocarbons (PAHs) and those without.
[0053] In one possible implementation, the ultraviolet-visible absorbance spectral data includes absorbance values at wavelength points. The step of training an initial classification model using the spectral data as input features and the corresponding binary classification labels as the expected output includes: dividing the sample dataset into a training set and a test set; and training the initial classification model using the absorbance values at wavelength points as the model input and the binary classification labels as the expected output of the initial classification model.
[0054] In this embodiment of the disclosure, the sample dataset can be divided into a training set and a test set. Specifically, the dataset can be randomly divided into a training set and a test set in an 8:2 ratio, or other ratios can be used; this embodiment of the disclosure does not impose any limitations. After dividing the dataset, the absorbance value at a wavelength point can be used as the model input, and the binary classification label can be used as the expected output of the initial classification model to train the initial classification model.
[0055] In this embodiment of the disclosure, the absorbance value at wavelength points across the entire spectrum is used as the model input feature, and the binary classification label of PAHs pollution category is used as the model output target. By training the ensemble learning model, the model can autonomously explore the nonlinear mapping relationship between spectral signals and pollution categories, thereby enabling the model to quickly identify whether a water sample contains polycyclic aromatic hydrocarbons.
[0056] In one possible implementation, the method further includes: evaluating the model using the test set based on preset evaluation metrics, the evaluation metrics including accuracy, recall, and F1 score.
[0057] In this embodiment of the disclosure, the trained model can be evaluated using a test set based on preset evaluation metrics. These evaluation metrics may include precision, recall, and F1 score. In this embodiment, precision can be the proportion of water samples predicted by the model to contain PAHs pollution that actually do. Recall can be the proportion of all samples that actually contain PAHs pollution that were correctly predicted by the model to contain PAHs pollution. The F1 score can be the harmonic mean of precision and recall.
[0058] In one possible implementation, the method further includes: using cross-validation combined with grid search to fine-tune the hyperparameters of the initial classification model; using the average classification accuracy of cross-validation as the basis for model selection; selecting a combination of hyperparameters whose average classification accuracy meets preset conditions as target hyperparameters; and using the target hyperparameters to retrain the initial classification model using the training set to obtain a trained polycyclic aromatic hydrocarbon (PAH) recognition model.
[0059] In this embodiment, cross-validation is combined with grid search. Grid search ensures the systematic and comprehensive nature of parameter optimization, while cross-validation ensures the objectivity and stability of performance evaluation. Together, they constitute a standardized model tuning process, which can effectively improve the generalization ability of the trained model on new samples.
[0060] For example, Figure 3 A schematic diagram of the XGBoost model architecture according to an embodiment of the present disclosure is shown. Figure 4 A schematic diagram illustrating the accuracy training of an XGBoost model according to an embodiment of the present disclosure is shown. Figure 5 A schematic diagram showing the confusion matrix of an XGBoost model on the training and test sets according to an embodiment of the present disclosure is provided. Figure 3 , Figure 4 and Figure 5 As shown, the process of model building and verification in this embodiment is fully demonstrated, from architecture design to parameter tuning and performance evaluation.
[0061] In this embodiment of the disclosure, a method for identifying polycyclic aromatic hydrocarbons (PAHs) based on ultraviolet-visible spectroscopy is also provided, comprising: acquiring ultraviolet-visible absorption spectral data of a water sample to be tested; inputting the spectral data into a pre-trained PAH identification model to obtain a classification result of whether the water sample to be tested contains PAHs; wherein, the PAH identification model is constructed based on the PAH identification model in water.
[0062] Specifically, the ultraviolet-visible absorption spectrum data of the water sample to be tested can be obtained first. The ultraviolet-visible absorption spectrum data of the water sample to be tested can be obtained in the manner described above. Then, the spectral data can be input into the trained recognition model to obtain the classification result of whether the water sample to be tested contains polycyclic aromatic hydrocarbons.
[0063] In this embodiment, multiple water sample data are subjected to UV-Vis full-spectrum scanning to obtain UV-Vis absorbance spectral data for each type of water sample. The multiple water sample data include samples containing polycyclic aromatic hydrocarbons (PAHs) and samples containing interfering substances, which are substances that cause background interference to the UV-Vis absorption spectrum of PAHs in water. A sample dataset is constructed, where each sample data includes the spectral data and a corresponding binary classification label. The binary classification label indicates whether the sample data contains PAHs. An initial classification model is trained using the spectral data as input features and the corresponding binary classification label as the desired output to obtain a trained PAH identification model. The initial classification model is an ensemble learning model, used to construct multiple weak learners and integrate their outputs to mine nonlinear features in the spectral data, thereby distinguishing the spectral differences between samples containing PAHs and those without. The PAH identification model is used to identify the water sample data to be tested, obtaining the identification result. The model constructed using the method of this embodiment can quickly and accurately identify whether PAHs are present in water.
[0064] Application scenario examples
[0065] In this embodiment, 16 priority PAH mixed pollution systems are used as target categories to mine feature information from complex spectral data, enabling rapid differentiation and early warning of water bodies containing PAHs from non-target interference water bodies. This addresses the technical problems of complex sample pretreatment, long detection cycles, and difficulty in meeting the needs of rapid on-site screening of PAHs in chromatographic detection methods. To achieve the above objective, this embodiment collects UV-Vis absorption spectral data of 16 priority PAH mixed standard solutions, environmental interference substance standard solutions, and actual water samples (including spiked water samples). A spectral dataset containing multiple concentration levels and multiple interference scenarios is constructed. The XGBoost algorithm is used to perform qualitative identification and modeling of the spectral data to achieve rapid identification of PAHs in water bodies.
[0066] Figure 6 This diagram illustrates a model construction process for a rapid identification method for polycyclic aromatic hydrocarbons according to an embodiment of the present disclosure. Figure 6 As shown, the method for constructing a polycyclic aromatic hydrocarbon (PAH) identification model in water according to embodiments of this disclosure may include the following steps:
[0067] (1) Spectral data acquisition
[0068] A full-spectrum scan was performed using a UV-Vis spectrometer, with a wavelength range of 189–815 nm and a spectral resolution of 0.6 nm. Absorbance data were obtained for 1024 wavelength points for each sample. Baseline correction was performed using deionized water as a blank control, and each sample was scanned three times consecutively.
[0069] The data sample system constructed in this invention adopts a three-layer progressive design, introducing complex interference factors and matrix conditions layer by layer: The first layer consists of multi-concentration gradient samples of 16 polycyclic aromatic hydrocarbons mixed in equal proportions, used to capture the intrinsic spectral fingerprint characteristics of the target pollutant; the second layer consists of mixed solution samples of polycyclic aromatic hydrocarbons and monocyclic aromatic hydrocarbons (such as benzene and benzene homologues) prepared according to orthogonal experimental design, used to systematically quantify the coupling interference law of coexisting interference substances on the target spectrum; the third layer consists of actual surface water and groundwater samples and their spiked samples covering different hydrological conditions, used to introduce the matrix effect of real water bodies and test the predictive reliability of the model under complex working conditions. A total of 1377 spectral data points were collected from the three layers of samples, forming a complete spectral architecture from ideal conditions to interference coexistence, and then to real water body conditions.
[0070] The UV-Vis absorption spectra of water samples with different matrices were collected to obtain the corresponding spectral data. The collected samples included 16 PAHs mixed standard solutions, orthogonal mixed solutions with interfering substances such as benzene series compounds, and actual and spiked water samples of surface water and groundwater, in order to cover the spectral characteristics under different concentration levels and interference coexistence conditions.
[0071] (2) Construction and partitioning of datasets
[0072] The collected spectral data is combined with the corresponding binary classification labels (0 for non-detection and 1 for detection) to construct a dataset. Each data point uses the absorbance value at wavelength as the input feature vector and the binary classification label as the output target. The dataset is randomly divided into a training set and a test set in an 8:2 ratio for subsequent model training and evaluation.
[0073] (3) Training and evaluation of PAHs classification models
[0074] A PAHs classification model was constructed using the XGBoost machine learning algorithm. The absorbance vector of the water sample was used as the model input, and the output was a binary classification result of whether PAHs were detected. The model was trained using the training set, and the hyperparameters were adjusted through cross-validation and grid search to prevent overfitting and improve prediction accuracy, thus obtaining the PAHs classification model. The classification performance of the model was evaluated using the test set, and the evaluation metrics included accuracy, recall, and F1 score.
[0075] (4) Model validation
[0076] Select actual water samples (such as groundwater samples) that were not used in the model training, and obtain ultraviolet-visible absorption spectra under the same spectral acquisition conditions as the training data. Input the spectral data into the trained XGBoost model, output the determination results of whether PAHs are detected, and compare them with the gas chromatography-mass spectrometry (GC-MS, referring to the fourth edition of "Methods for Monitoring and Analysis of Water and Wastewater") method to verify the model's recognition stability and accuracy.
[0077] The above method combines ultraviolet-visible absorption spectroscopy with the XGBoost model, eliminating the need for complex sample pretreatment steps and enabling rapid and accurate identification of 16 priority control PAHs. It is suitable for online monitoring and real-time early warning scenarios.
[0078] Specifically, the spectral data acquisition and dataset construction steps in the method of this disclosure embodiment may include:
[0079] (1) Sample preparation
[0080] In this embodiment, the 16 preferentially controlled PAHs in equal proportions (naphthalene, acenaphthene, acenaphthene, fluorene, phenanthrene, anthracene, fluoranthene, pyrene, benzo[a]anthracene, α, benzo[b]fluoranthene, benzo[k]fluoranthene, benzo[a]pyrene, indo[1,2,3-cd]pyrene, dibenzo[a,h]anthracene, benzo[ghi]perylene, purity ≥98%) were purchased from certified commercially available standards. The sample composition included a series of PAHs mixed standard concentration gradients from 0.001 to 1 µg / mL; an orthogonal mixed concentration gradient of PAHs mixed standards and equal proportions of benzene series mixed standards (benzene, toluene, ethylbenzene, o-xylene, m-xylene, p-xylene, styrene, cumene); and actual water samples and spiked water samples taken from different surface water and groundwater sources.
[0081] (2) Data collection
[0082] In this embodiment, a 3 cm optical path quartz cuvette was used. In other embodiments, other optical paths can be selected according to the sample concentration. A full scan was performed using a UV-Vis spectrometer, and absorbance data at 1024 wavelengths were obtained for each sample. Each sample was scanned three times. To increase the accuracy of model training, each spectral data point was used as an independent sample in model training.
[0083] (3) Dataset partitioning
[0084] 80% of the samples were randomly selected as the training set, and the remaining 20% as the test set. This ensured that both the training and test sets contained actual water samples with different concentrations, different types of interference, and no sample overlap. In this embodiment, the total number of valid samples was 1377; in other embodiments, an appropriate number of samples can be collected based on the actual situation.
[0085] Specifically, model training and model evaluation in this embodiment of the disclosure may include:
[0086] (1) Model training and optimization
[0087] In this embodiment, a binary classifier can be constructed using computer software based on relevant technologies. The XGBoost model employs a binary classification objective function, with accuracy as the evaluation metric. The optimal ranges for the model hyperparameters are as follows: maximum tree depth (max_depth) of 3–9, learning rate (eta) of 0.01–0.1, number of weak learners (n_estimators) of 50–150, subsample ratio of 0.0–1.0, and column sample ratio (colsample_bytree) of 0.0–1.0. Hyperparameter tuning is performed using 5-fold cross-validation combined with grid search, with average accuracy used as the basis for model selection.
[0088] The results of the 5-fold cross-validation are shown in Table 1.
[0089] Table 1. Accuracy of 5-fold cross-validation of the trained model
[0090]
[0091] As shown in Table 1, the average accuracy of the 5-fold cross-validation was 0.9968 and the standard deviation was 0.0016, indicating that the model has good stability and generalization ability, and no obvious overfitting was observed.
[0092] (2) Model evaluation
[0093] The model was retrained on the entire training set using optimized hyperparameters, and evaluated on an independent test set (20% of the total samples, 138 samples). The test set was designed to accommodate different concentration gradients (0.001–1 µg / mL), different interference conditions (mixing with polycyclic aromatic hydrocarbons), and various real-world water samples (surface water, groundwater, and their spiked samples) to ensure the comprehensiveness of the evaluation.
[0094] The model evaluation results on the test set are shown in Table 2.
[0095] Table 2 Evaluation results of the classification model
[0096]
[0097] The evaluation results show that the model achieved 100% classification accuracy on the test set of this embodiment.
[0098] Model validation may include the following steps:
[0099] Four groundwater samples not used in model training were selected (GC-MS confirmed: 2 PAHs detected, 2 not detected). Data were acquired under the same spectral acquisition conditions as the training data samples and input into the trained XGBoost model. The model quickly output classification prediction results, which were verified one by one with the GC-MS results, achieving a classification accuracy of 100%. Figure 7 This diagram illustrates a comparison of the results of a rapid identification method for polycyclic aromatic hydrocarbons (PAHs) in actual water samples and a GC-MS detection method according to embodiments of the present disclosure.
[0100] The specific results are shown in Table 3 and Figure 7 .
[0101] Table 3. Model classification results
[0102]
[0103] Figure 8 A block diagram of an apparatus for constructing a polycyclic aromatic hydrocarbon (PAH) identification model in water according to an embodiment of the present disclosure is shown. Figure 8 As shown, the device includes:
[0104] Acquisition module 21: used to perform ultraviolet-visible full-spectrum scanning on multiple water sample data to obtain ultraviolet-visible absorbance spectral data for each type of water sample data; the multiple water sample data include samples containing polycyclic aromatic hydrocarbons and samples containing interfering substances, wherein the interfering substances are substances that cause background interference to the ultraviolet-visible absorption spectrum of polycyclic aromatic hydrocarbons in water.
[0105] Construction module 22: used to construct a sample dataset, wherein each sample data in the sample dataset includes the spectral data and a corresponding binary classification label, wherein the binary classification label is used to indicate whether the sample data contains polycyclic aromatic hydrocarbons;
[0106] Identification module 23: used to train an initial classification model with the spectral data as input features and the corresponding binary classification label as the expected output, to obtain a trained polycyclic aromatic hydrocarbon (PAH) identification model; wherein, the initial classification model is an ensemble learning model, used to construct multiple weak learners and integrate the outputs of each weak learner to mine the nonlinear features in the spectral data, so as to distinguish the spectral differences between samples containing PAHs and samples without PAHs; the PAH identification model is used to identify the water sample data to be tested and obtain the identification result.
[0107] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0108] This disclosure also provides a non-volatile computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the above-described method.
[0109] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0110] Figure 9 A block diagram of an apparatus according to an embodiment of the present disclosure is shown. For example, apparatus 1900 may be provided as a server or terminal device. (Refer to...) Figure 9 The apparatus 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.
[0111] Device 1900 may also include a power supply component 1926 configured to perform power management of device 1900, a wired or wireless network interface 1950 configured to connect device 1900 to a network, and an input / output interface 1958 (I / O interface). Device 1900 can operate on an operating system, such as Windows Server, stored in memory 1932. TM macOS X TM Unix TM Linux TM FreeBSD TM Or similar.
[0112] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by a processing component 1922 of the device 1900 to perform the above-described method.
[0113] Computer-readable storage media can be tangible devices capable of holding and storing programs / instructions used by instruction execution devices. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0114] The computer program (or computer-readable program instructions) described herein can be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage medium in the respective computing / processing device.
[0115] The computer program (or computer program instructions) used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions to implement various aspects of this disclosure.
[0116] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0117] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0118] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0119] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0120] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for constructing a polycyclic aromatic hydrocarbon (PAH) identification model in water, characterized in that, include: A full-spectrum UV-Vis scan was performed on various water sample data to obtain the UV-Vis absorbance spectral data for each water sample. The various water sample data include samples containing polycyclic aromatic hydrocarbons (PAHs) and samples containing interfering substances, which are substances that cause background interference to the ultraviolet-visible absorption spectrum of PAHs in water. Construct a sample dataset, wherein each sample data in the sample dataset includes the spectral data and a corresponding binary classification label, wherein the binary classification label is used to indicate whether the sample data contains polycyclic aromatic hydrocarbons; Using the spectral data as input features and the corresponding binary classification labels as the desired output, an initial classification model is trained to obtain a trained polycyclic aromatic hydrocarbon (PAH) identification model. The initial classification model is an ensemble learning model, used to construct multiple weak learners and integrate their outputs to mine nonlinear features in the spectral data, thereby distinguishing the spectral differences between samples containing PAHs and those without. The PAH identification model is used to identify the water sample data to be tested, obtaining the identification result.
2. The method according to claim 1, characterized in that, The interfering substances include monocyclic aromatic hydrocarbons; the ultraviolet-visible full-spectrum scanning of multiple water sample data to obtain ultraviolet-visible absorbance spectral data for each water sample data includes: Obtain first spectral data of multi-concentration gradient samples of a standard solution containing a variety of polycyclic aromatic hydrocarbons in equal proportions; Obtain the second spectral data of a mixed solution sample of polycyclic aromatic hydrocarbons and monocyclic aromatic hydrocarbons; Obtain third-spectral data of actual surface water and groundwater samples and spiked samples under different hydrological conditions.
3. The method according to claim 1, characterized in that, The wavelength range of the ultraviolet-visible full-spectrum scan is 189~815nm, the spectral resolution is 0.6nm, and absorbance data of 1024 wavelength points are obtained for each sample.
4. The method according to claim 1, characterized in that, The ultraviolet-visible absorbance spectral data includes absorbance values at wavelength points. The training of the initial classification model using the spectral data as input features and the corresponding binary classification labels as the desired output includes: The sample dataset is divided into a training set and a test set; The absorbance value at a wavelength point is used as the model input, and the binary classification label is used as the expected output of the initial classification model to train the initial classification model.
5. The method according to claim 4, characterized in that, The method further includes: The model is evaluated using the test set based on preset evaluation metrics, including accuracy, recall, and F1 score.
6. The method according to claim 4, characterized in that, The method further includes: The hyperparameters of the initial classification model are tuned by using cross-validation combined with grid search. The average classification accuracy of cross-validation is used as the basis for model selection, and the hyperparameter combination that satisfies the preset condition is selected as the target hyperparameter. Using the target hyperparameters, the initial classification model is retrained using the training set to obtain the trained polycyclic aromatic hydrocarbon (PAH) identification model.
7. A method for identifying polycyclic aromatic hydrocarbons based on ultraviolet-visible spectroscopy, comprising: Obtain the ultraviolet-visible absorption spectrum data of the water sample to be tested; The spectral data is input into a pre-trained polycyclic aromatic hydrocarbon (PAH) identification model to obtain a classification result of whether the water sample to be tested contains PAHs. The polycyclic aromatic hydrocarbon identification model is constructed based on the method described in any one of claims 1 to 6.
8. A polycyclic aromatic hydrocarbon identification device based on ultraviolet-visible spectroscopy, characterized in that, include: Acquisition module: used to perform ultraviolet-visible full-spectrum scanning on various water sample data to obtain the ultraviolet-visible absorbance spectral data of each water sample data; The various water sample data include samples containing polycyclic aromatic hydrocarbons (PAHs) and samples containing interfering substances, which are substances that cause background interference to the ultraviolet-visible absorption spectrum of PAHs in water. Construction module: used to construct sample dataset, each sample data in the sample dataset includes the spectral data and the corresponding binary classification label, the binary classification label is used to indicate whether the sample data contains polycyclic aromatic hydrocarbons; The identification module is used to train an initial classification model using the spectral data as input features and the corresponding binary classification label as the desired output, to obtain a trained polycyclic aromatic hydrocarbon (PAH) identification model. The initial classification model is an ensemble learning model, used to construct multiple weak learners and integrate their outputs to mine nonlinear features in the spectral data, thereby distinguishing the spectral differences between samples containing PAHs and those without. The PAH identification model is used to identify the water sample data to be tested, obtaining the identification result.
9. A non-volatile computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.