A method for rapidly identifying components of water pollutants based on three-dimensional fluorescence spectrum
By combining image feature extraction and machine learning in a three-dimensional fluorescence spectroscopy method, the problem of slow three-dimensional fluorescence spectroscopy data analysis is solved, enabling rapid and accurate identification of water pollutants, which is suitable for online analysis.
Patent Information
- Application Number
- CN202311400735.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-26
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-10-26
AI Technical Summary
Existing three-dimensional fluorescence spectroscopy data analysis methods have high requirements for initial data and slow analysis speed, which limits their application in rapid, online analysis and makes it difficult to accurately identify the types and components of water pollutants.
A rapid water pollutant component identification method based on three-dimensional fluorescence spectroscopy is adopted. This method combines image feature extraction and machine learning, and utilizes a support vector machine multi-identification model. It extracts features using global and local details, and combines a weighted multi-peak attention mechanism, two-dimensional modal empirical decomposition, and wavelet decomposition to optimize the support vector machine parameters, thereby achieving rapid and accurate water quality detection.
It enables rapid and accurate identification of the types and components of water pollutants with very little sample data, reduces the requirements for datasets, improves the accuracy and robustness of the model, and is suitable for online analysis.
Smart Images

Figure CN117422918B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of water quality testing technology, specifically relating to a rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy. Background Technology
[0002] Water pollution and algal blooms have become pressing environmental problems that urgently need to be addressed, directly threatening the health of aquatic ecosystems and human well-being. Therefore, it is necessary to test water quality and identify the types and components of pollutants to provide a practical basis for real-time monitoring and source tracing.
[0003] Traditional water quality testing methods mainly include biological detection, chemical analysis, microbiological analysis, and sensor technology. However, these methods have some obvious drawbacks. They usually require complex and time-consuming sample preparation and analysis processes; the use of chemical reagents may cause secondary pollution; and the acquisition of water quality parameters is difficult due to the need for expensive equipment and highly specialized knowledge. Therefore, water quality testing based on three-dimensional fluorescence spectroscopy is becoming increasingly widespread.
[0004] Currently, the main method for analyzing three-dimensional fluorescence spectroscopy data is PARAFAC (parallel factor analysis). However, this method has certain limitations. For example, the PARAFAC model has strict requirements on the dataset, and the accuracy of the model depends on the quality and completeness of the initial data. During detection, it is generally required that each input data has more than 20 samples and requires a long computation time, which to some extent limits its application in rapid, online analysis.
[0005] Therefore, it is necessary to study a method that can replace parallel factor analysis, overcome the limitations of PARAFAC, and achieve rapid and accurate water quality testing with less sample data. Summary of the Invention
[0006] To address the aforementioned shortcomings of existing technologies, the technical problem this invention aims to solve is to provide a rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy. This method avoids the problems of existing three-dimensional fluorescence spectroscopy data analysis methods, which have high requirements for initial data and slow analysis speed, thus affecting the identification results of water pollutants. The invention achieves the effect of quickly and accurately obtaining pollutant categories and components with very few samples during detection.
[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0008] A rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy includes the following steps:
[0009] S1: Obtain training samples of different types of water bodies. Each type of water body contains water pollutants. Use a fluorescence spectrometer to measure the three-dimensional fluorescence spectrum data corresponding to each training sample.
[0010] S2: Preprocess the three-dimensional fluorescence spectral data obtained in step S1 to obtain the original three-dimensional fluorescence spectra of each training sample;
[0011] S3: Extract features from the original three-dimensional fluorescence spectrum after step S2 to obtain global and local information, and integrate them to form a new feature matrix as the final feature of the three-dimensional fluorescence spectrum data of the sample.
[0012] S4: Input the final features of the three-dimensional fluorescence spectral data obtained in step S3 and its corresponding identification labels and component information into the support vector machine multi-identification model, train the model to obtain the multi-classifier and the recognizer, and complete the construction of the water pollutant identification model;
[0013] S5: Collect test samples of the water body to be tested, obtain the three-dimensional fluorescence spectrum data of the test sample, and after the preprocessing described in step S2, input it into the water pollutant identification model constructed in step S4 to obtain the component spectrum of the test sample, and complete the identification of water pollutant categories and components.
[0014] To further improve the above technical solution, step S3 includes the following sub-steps:
[0015] S3.1: Extract global information of fluorescence peaks from the original three-dimensional fluorescence spectrum;
[0016] S3.2: Extract local texture information from the original three-dimensional fluorescence spectrum and perform dimensionality reduction processing;
[0017] S3.3: Combine the global information of the three-dimensional fluorescence peak with the local texture information after dimensionality reduction, and perform normalization processing. Combine the normalized feature vectors of each training sample to obtain the final feature.
[0018] Further, step S3.1 specifically includes:
[0019] Set a set of possible peak locations Based on the intensity properties of each fluorescence peak in the original three-dimensional fluorescence spectrum, each position is assigned... Assign a weight accordingly Finally, the set of peaks with the highest weights is selected as the focus set:
[0020]
[0021] in, The brightness threshold; This refers to the global information of the three-dimensional fluorescence peaks.
[0022] Further, step S3.2 specifically includes:
[0023] First, two-dimensional empirical mode decomposition is performed on the original three-dimensional fluorescence spectra of each training sample to obtain a series of intrinsic mode functions (EMFs). Each EMF includes texture feature information at different scales in the image, and the formula is described as follows:
[0024]
[0025] in, This is the original three-dimensional fluorescence spectrum. It is the first One eigenmode function It is a residual. It is the number of intrinsic mode functions;
[0026] Then, a dual-tree complex wavelet transform is applied to each intrinsic mode function to obtain complex wavelet coefficients at different scales and directions;
[0027] Next, each complex wavelet coefficient is transformed into a one-dimensional vector, and all vectors are combined to form a wavelet coefficient feature matrix. In the wavelet coefficient feature matrix, each row represents all complex wavelet coefficients of an eigenmode function.
[0028] The wavelet coefficient feature matrix is normalized, and UMAP is used for dimensionality reduction to select representative features.
[0029] Furthermore, for low-concentration training samples, morphological top-hat operations and feature enhancement processing are performed before extracting local texture information from their original three-dimensional fluorescence spectra.
[0030] The morphological capping operation is used to highlight the peaks in the original three-dimensional fluorescence spectrum and locate the characteristic regions of the three-dimensional fluorescence peaks.
[0031] The feature enhancement process includes: performing weighted enhancement processing on the feature regions of the three-dimensional fluorescence peak to obtain a new three-dimensional fluorescence spectrum image, and then performing step S3.2.
[0032] Furthermore, in step S4, when training the multi-recognition model using a support vector machine,
[0033] A hybrid of radial basis functions and polynomial kernels is used as the kernel function of the support vector machine, and the whale optimization algorithm is used to optimize the support vector machine parameters. Finally, the solution with the highest fitness is selected as the support vector machine parameters for training the model.
[0034] Specifically, the following steps are included:
[0035] 1) Initialize the support vector machine parameters and the control parameters of the whale optimization algorithm.
[0036] The control parameters of the whale optimization algorithm include the number of search agents, the maximum number of iterations, the randomness parameter, and the termination condition. A performance benchmark and fitness function are also set for subsequent dynamic adjustments.
[0037] The support vector machine parameters include: the penalty coefficient for incorrect terms. The width parameter of the radial basis function kernel degree of polynomial kernel Independent terms of the polynomial kernel The mixing ratio of radial basis function kernels and polynomial kernels ;
[0038] 2) Calculation of the hybrid kernel function
[0039] Define hybrid kernel function Combining radial basis function kernels and polynomial kernels:
[0040]
[0041] in, ,and
[0042] 3) Iterative process of whale optimization algorithm
[0043] Exploration Phase: Explore solutions using the standard formula of the whale optimization algorithm; calculate the fitness of each search agent and select the solution with the highest fitness as the current optimal solution;
[0044] Performance evaluation: Compare the maximum fitness improvement of each search agent over several consecutive generations; if the improvement is less than a preset threshold, the algorithm is considered to have begun to converge.
[0045] Dynamic parameter tuning: If performance improvement is slow or stagnant, increase the stochasticity parameter to promote a wider exploration of the solution space; if fitness increases rapidly, decrease the stochasticity parameter to make more use of the current best solution for fine-tuning the parameters.
[0046] Termination condition: Stop iteration if the maximum number of iterations is reached or the fitness has reached the desired highest level;
[0047] 4) Solution evaluation and selection
[0048] After the whale optimization algorithm has completed its iterations, the solution with the highest fitness is selected as the final SVM parameters. These parameters are then used to train the support vector machine multi-recognition model, and its performance is verified on test data.
[0049] Further, step S2 specifically includes:
[0050] For the three-dimensional fluorescence spectral data of the training samples, Rayleigh scattering and Raman scattering are eliminated by blank subtraction and Delaunay triangle interpolation. Extended SG filtering is applied to the three-dimensional fluorescence spectral data, and then Raman normalization is performed on the three-dimensional fluorescence spectral data to complete the preprocessing of the three-dimensional fluorescence spectral data.
[0051] Compared with the prior art, the present invention has the following beneficial effects:
[0052] 1. The present invention provides a rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy. This method combines image feature extraction and machine learning to extract global and local detail features from three-dimensional fluorescence spectral data, ultimately forming a new feature matrix. This feature matrix extracts richer feature information, making subsequent modeling of the types and components of water pollutants more accurate. The entire data analysis process replaces the traditional parallel factor analysis method, the model construction has lower data requirements, and online analysis can be achieved more quickly, accurately obtaining the categories and components of water pollutants.
[0053] 2. The present invention provides a rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy. It introduces a weighted multi-peak attention mechanism, analogous to the positional attention mechanism in deep learning. This mechanism focuses on the peak positions in the input fluorescence spectrum. Among a series of possible peaks, it identifies and weights multiple significant peak positions to more accurately obtain the global information of the three-dimensional fluorescence peaks in these regions. In this way, it can automatically learn the importance weight of each position in the fluorescence spectrum, thereby helping to strengthen the response of the subsequent water pollutant identification model to peak positions and the suppression of non-peak regions, while ignoring unimportant and irrelevant background noise and disturbances.
[0054] 3. The present invention provides a method for rapid identification of water pollutant components based on three-dimensional fluorescence spectroscopy. When extracting local texture information from the constructed feature matrix, it combines two-dimensional modal empirical decomposition and two-dimensional wavelet decomposition, making full use of the adaptability of two-dimensional modal empirical decomposition and the multi-scale characteristics of two-dimensional wavelet decomposition. Among them, two-dimensional modal empirical decomposition can compensate for the energy leakage defect of wavelets due to high frequency and enhance the performance of wavelets to a certain extent, while two-dimensional wavelet decomposition can process images at a fine scale and has a certain degree of directional selectivity.
[0055] 4. This invention provides a rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy, which combines the kernel function of SVM with the dynamic parameter adjustment of WOA. The dynamic parameter adjustment of WOA can adaptively adjust its exploration and utilization strategy according to the current performance and convergence status, thereby more effectively responding to complex optimization problems. When the algorithm exhibits a slow learning speed at a certain stage, nonlinear adjustment can change the parameters more quickly, prompting the algorithm to escape local optima and increasing global search capability. By adjusting the search strategy in a timely manner, dynamic parameter adjustment can not only increase the probability of the algorithm finding high-quality solutions but also accelerate the convergence speed and save computational resources. Furthermore, by combining two or more kernel functions, a more flexible decision boundary is provided, enabling it to adapt to more complex data distributions. A balance is established between different kernels to avoid over-reliance on the characteristics of a particular kernel function, potentially improving the model's generalization ability. This results in a more accurate and robust model being constructed subsequently. Attached Figure Description
[0056] Figure 1 This is a flowchart illustrating the identification of water pollutant categories and components in the embodiments;
[0057] Figure 2 This is a flowchart of step S3.2 in the embodiment;
[0058] Figure 3 This is a flowchart illustrating the morphological top-cap operation and feature enhancement processing in the embodiment.
[0059] Figure 4 This is a result diagram of the global information of the training samples in the embodiment;
[0060] Figure 5 This is a comparison diagram of the effects before and after morphological top-hat operation and feature enhancement processing in the embodiment;
[0061] Figure 6 This is a result image of the local texture information of the training samples in the embodiment;
[0062] Figure 7 This is a diagram showing the effect of step S2 in the embodiment;
[0063] Figure 8 This is a result diagram of the test sample component spectrum obtained in step S5 of the embodiment. Detailed Implementation
[0064] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0065] It should be noted that similar reference numerals and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the figures, or the orientation or positional relationship commonly used when the product is in use. They are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance. In addition, the terms "horizontal," "vertical," etc., do not indicate that the component is required to be absolutely horizontal or suspended, but can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal than "vertical," and does not mean that the structure must be completely horizontal, but can be slightly tilted. In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0066] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0067] Please see Figure 1 A specific embodiment of a rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy includes the following steps:
[0068] S1: Obtain training samples of different types of water bodies, each containing water pollutants, and measure the three-dimensional fluorescence spectral data corresponding to each training sample;
[0069] S2: Preprocess the three-dimensional fluorescence spectral data obtained in step S1 to obtain the original three-dimensional fluorescence spectra of each training sample;
[0070] S3: Extract features from the original three-dimensional fluorescence spectrum after step S2 to obtain global and local information, and integrate them to form a new feature matrix as the final feature of the three-dimensional fluorescence spectrum data of the sample.
[0071] S4: Input the final features of the three-dimensional fluorescence spectral data obtained in step S3 and their corresponding identification labels into the support vector machine multi-identification model, train the model to obtain the multi-classifier (Multi_SVC) and the identifier (CF_SVR), and complete the construction of the water pollutant identification model;
[0072] S5: Collect test samples of the water body to be tested, obtain the three-dimensional fluorescence spectrum data of the test sample, and after the preprocessing described in step S2, input it into the water pollutant identification model constructed in step S4 to obtain the component spectrum of the test sample, and complete the identification of water pollutant categories and components.
[0073] This embodiment presents a rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy. It combines image feature extraction and machine learning to extract global and local detail features from three-dimensional fluorescence spectral data, ultimately forming a new feature matrix. This feature matrix extracts richer feature information, making subsequent modeling of water pollutant types and components more accurate. The entire data analysis process replaces the traditional parallel factor analysis method, the model construction has lower data requirements, and online analysis can be achieved more quickly, accurately obtaining the categories and components of water pollutants.
[0074] Please continue reading Figure 1 Step S3 includes the following sub-steps:
[0075] S3.1: Extract global information of fluorescence peaks from the original three-dimensional fluorescence spectrum;
[0076] S3.2: Extract local texture information from the original three-dimensional fluorescence spectrum and perform dimensionality reduction processing;
[0077] S3.3: Combine the global information of the three-dimensional fluorescence peak with the local texture information after dimensionality reduction, and perform normalization processing. Combine the normalized feature vectors of each training sample to obtain the final feature.
[0078] Specifically, step S3.1 includes:
[0079] Set a set of possible peak locations Based on the intensity properties of each fluorescence peak in the original three-dimensional fluorescence spectrum, each position is assigned... Assign a weight accordingly Finally, the set of peaks with the highest weights is selected as the focus set:
[0080]
[0081] The set of points of interest is the global information of the three-dimensional fluorescence peak; here... The threshold value is used to determine the location of the strongest peak based on the brightness.
[0082] In this embodiment, a weighted multi-peak attention mechanism is introduced, analogous to the positional attention mechanism in deep learning. It focuses on the peak positions in the input fluorescence spectrum and identifies and weights multiple significant peak positions among a series of possible peaks to more accurately obtain the global information of the three-dimensional fluorescence peaks in these regions. In this way, the importance weight of each position in the fluorescence spectrum can be automatically learned, which helps to strengthen the response of the subsequent water pollutant identification model to peak positions and the suppression of non-peak regions, while ignoring unimportant and irrelevant background noise and disturbances.
[0083] Please see Figure 2 Specifically, step S3.2 includes:
[0084] First, the original three-dimensional fluorescence spectra of each training sample are decomposed into 2D-EEMD (two-dimensional empirical mode decomposition) to obtain a series of intrinsic mode function sets (IMFs). Each IMF (intrinsic mode function) includes texture feature information at different scales in the image, and the formula can be described as:
[0085]
[0086] in, This is the original three-dimensional fluorescence spectrum. It is the first One eigenmode function It is a residual. It refers to the number of IMFs;
[0087] Then, a dual-tree complex wavelet transform is applied to each IMF to obtain complex wavelet coefficients of different scales and orientations;
[0088] Next, each complex wavelet coefficient is transformed into a one-dimensional vector, and all vectors are combined to form a wavelet coefficient feature matrix. In the wavelet coefficient feature matrix, each row represents all complex wavelet coefficients of an IMF.
[0089] The wavelet coefficient feature matrix is normalized, and UMAP is used for dimensionality reduction to select representative features.
[0090] In implementation, the dual-tree complex wavelet transform uses two parallel discrete wavelet transforms (DWTs), each with slightly different wavelet filters. One tree structure generates the real part, and the other generates the imaginary part. This method can better preserve and provide direction selectivity and phase information when processing three-dimensional fluorescence matrices. However, since the feature extraction using the dual-tree complex wavelet transform generates a large amount of data, direct training would slow down the process and potentially lead to overfitting. Therefore, dimensionality reduction is used to select a few data points that contribute the most to the feature set as representative features, which are then input into the subsequent training model.
[0091] Assuming the three-dimensional fluorescence data in this embodiment is The dual-tree complex wavelet transform is described as follows:
[0092] 1) Decomposition stage
[0093] For each tree, we use four filters: two for the real part. Two for imaginary solutions , It is a low-pass filter. It is a high-pass filter;
[0094] For the real part (Tree R):
[0095]
[0096]
[0097] For the imaginary part (Tree I):
[0098]
[0099]
[0100] in, and These represent low-frequency and high-frequency components, respectively, and * indicates the convolution operation.
[0101] 2) Complex number representation
[0102] The responses from the two trees are combined into a single complex wavelet coefficient:
[0103]
[0104]
[0105] in, It is the imaginary unit. and These are complex wavelet coefficients.
[0106] Because dual-tree complex wavelet transform provides complex coefficients (combining real and imaginary parts), it can more accurately represent the phase information in image data, which is something that traditional real wavelet transform cannot do. Phase information is particularly important for details such as texture and edges, because these features are often related to phase changes in local areas of the image; the resulting decomposed map does indeed represent the texture and structural information of the image at different directions and scales.
[0107] Meanwhile, since the feature vectors obtained after decomposition have a high dimension, this leads to a large amount of computation, which is not conducive to the rapid online identification of water quality. Therefore, UMAP (Uniform Manifold Approximation and Projection) was used for further dimensionality reduction.
[0108] Please see Figure 3 For training samples with low concentrations, morphological top-hat operations and feature enhancement processing are performed before extracting local texture information from their original three-dimensional fluorescence spectra.
[0109] The morphological top-hat operation includes: performing a morphological opening operation to eliminate small, unimportant structures or noise, and then performing a difference operation between the original image and the opening operation result to highlight the peaks in the original three-dimensional fluorescence spectrum and locate the characteristic regions of the three-dimensional fluorescence peaks.
[0110] The feature enhancement process includes: performing weighted enhancement processing on the feature regions of the three-dimensional fluorescence peak to obtain a new three-dimensional fluorescence spectrum image, and then performing step S3.2.
[0111] In practical implementation, considering trace components in surface water, the concentration of fluorescent substances in these water bodies is usually low, and they are accompanied by complex background noise, making subsequent feature extraction and recognition particularly difficult. Therefore, by comprehensively applying the above-mentioned morphological top-hat operation and feature enhancement techniques to achieve accurate feature localization and enhancement, the spectral signal-to-noise ratio of training samples and test samples can be effectively improved.
[0112] Understandably, for high-concentration three-dimensional fluorescence spectral features, such as training samples collected at the source of pollution, morphological capping and feature enhancement are unnecessary; local texture information can be extracted directly. However, subsequent extraction of global information relies on a weighted multi-peak attention mechanism, where the weights are calculated based on fluorescence peak intensities. If capping and feature enhancement are performed before global information extraction, it becomes difficult to identify important peak positions. Therefore, morphological capping and feature enhancement are only performed on low-concentration training samples before extracting local texture information.
[0113] In this embodiment, the algorithm for rapid identification of water pollutant components based on SVM mainly trains the training samples by combining the final features of the training samples with their corresponding identification labels (i.e., the category and component information corresponding to each sample). Figure 1 As shown, the final features (i.e., the feature matrix) need to be trained twice. The first training is for the classification model, with input including the category label of the water sample and the feature matrix, aiming to obtain a multi-classifier (the category information of the water sample), such as whether it is industrial wastewater or surface water. The second training, based on the category information, is for the component identification model, with input including the component labels and the feature matrix, aiming to obtain an identifier (the component information of a certain type of water sample), such as the specific component information in industrial wastewater, whether it is a component in wastewater from the dyeing and printing industry or other industries, facilitating source tracing. After the water pollutant identification model is completed, the feature information of the test sample is input into the water pollutant identification model for testing, obtaining the pollutant label of the sample, and then performing component identification analysis on the test sample. In practice, the component label is obtained by decomposing the component map of each training sample using PARAFAC.
[0114] The identifier (CF_SVR) comprises several sub-models, each corresponding to a specific pollutant component. For each water sample in the training set, each sub-model responds to the corresponding component category and outputs the result, ultimately yielding a component profile for that sample. As those skilled in the art will know, the pollutant components in water quality testing mainly include aromatic proteins, humic substances, soluble microbial byproducts, and fulvic acid. Humic substances include anthropogenic humic substances and terrestrial-derived humic substances, while aromatic proteins include aromatic protein I and aromatic protein II. Therefore, the number of sub-models corresponds to the number of components to be identified. It is understandable that the pollutant component information should focus on the most relevant components; these components are sufficient for component identification in water bodies, eliminating the need to test every single component.
[0115] This invention employs a Support Vector Machine (SVM) multi-recognition model to construct a water pollutant identification model, specifically achieving the following effects:
[0116] 1) The data requirements for the test samples are simple; you can get the category and component results by inputting only the data of one sample.
[0117] 2) Feature extraction integrates global peak information and local texture information, improving the accuracy of the analysis;
[0118] 3) Ultimately, both category and component information can be obtained simultaneously for subsequent source tracing analysis;
[0119] 4) It is applicable to modeling with small datasets, is not constrained by the dataset, and facilitates the collection of water samples.
[0120] In step S4, when training the multi-recognition model using a support vector machine,
[0121] A mixture of radial basis function (RBF) and polynomial kernel is used as the kernel function of support vector machine (SVM), and the SVM parameters are optimized using WOA algorithm (whale optimization algorithm). Finally, the solution with the highest fitness is selected as the SVM parameters for training the model.
[0122] The SVM parameters include: the penalty coefficient for erroneous terms. RBF core width parameter degree of polynomial kernel Independent terms of the polynomial kernel The mixing ratio of RBF kernels and polynomial kernels .
[0123] The specific steps involved in implementation are as follows:
[0124] 1) Initialize SVM parameters and WOA algorithm control parameters
[0125] The control parameters of the WOA algorithm include the number of search agents, the maximum number of iterations, the randomness parameter, and the termination condition. A performance benchmark and fitness function are also set for subsequent dynamic adjustments.
[0126] 2) Calculation of the hybrid kernel function
[0127] Define hybrid kernel function Combining RBF kernels and polynomial kernels:
[0128]
[0129] in, ,and
[0130] 3) WOA Iteration Process
[0131] Exploration Phase: Exploring solutions using WOA's standard formulas; calculating the fitness of each search agent and selecting the solution with the highest fitness as the current optimal solution;
[0132] Performance evaluation: Compare the maximum fitness improvement of each search agent over several generations; if the improvement is less than a preset threshold, the algorithm is considered to have begun to converge.
[0133] Dynamic parameter tuning: If performance improvement is slow or stagnant, increase the stochasticity parameter to promote a wider exploration of the solution space; if fitness increases rapidly, decrease the stochasticity parameter to make more use of the current best solution for fine-tuning the parameters.
[0134] Termination condition: Stop iterating if the maximum number of iterations is reached or the fitness has reached the desired highest level.
[0135] 4) Solution evaluation and selection
[0136] After the WOA iteration is completed, the solution with the highest fitness is selected as the final SVM parameters. These parameters are used to train the SVM multi-recognition model, and its performance is verified on the test data.
[0137] In this invention, when using the WOA algorithm for SVM parameter optimization, the performance benchmark refers to the benchmark used to evaluate the algorithm's effectiveness. In the algorithm model used in this invention, for the classifier, a classification accuracy is set as the benchmark; for the discriminator (component fitting), both the fitting error and quality can be used as benchmarks. When the maximum fitness improvement based on each search agent for several consecutive generations falls below this benchmark, dynamic parameter adjustment may be triggered. Dynamic parameter adjustment is a strategy or mechanism that dynamically adjusts other parameters, such as stochastic parameters, based on the algorithm's current performance. It also involves the output of the fitness function, for example, using the average fitness over several generations as a benchmark to determine whether the algorithm's parameters need adjustment. The fitness function is a function that evaluates the quality of understanding for each search agent, and the fitness function is related to certain evaluation criteria of SVM (such as classification accuracy).
[0138] Of course, termination conditions can also be, for example, if the fitness does not show significant improvement for several generations or reaches a certain preset fitness level.
[0139] In this way, WOA's dynamic parameter tuning can adaptively adjust its exploration and utilization strategies based on current performance and convergence status, thus responding more effectively to complex optimization problems. When the algorithm exhibits a slow learning speed at a certain stage, nonlinear tuning can change parameters more quickly, prompting the algorithm to escape local optima and increasing global search capabilities. By adjusting the search strategy in a timely manner, dynamic parameter tuning can not only increase the probability of finding high-quality solutions but also accelerate convergence and save computational resources. Furthermore, by combining two or more kernel functions, it provides a more flexible decision boundary, capable of adapting to more complex data distributions; and by establishing a balance among different kernels, it avoids over-reliance on the characteristics of a particular kernel function, potentially improving the model's generalization ability; resulting in subsequent model construction with higher accuracy and better robustness.
[0140] This invention combines the kernel function of SVM with the dynamic parameter adjustment of WOA, aiming to improve the accuracy of water pollutant identification models through adaptive search strategies and more flexible decision boundaries.
[0141] Specifically, step S1 includes:
[0142] Samples were taken using an automated sampling device, filtered through a 0.45 μm microporous filter membrane, and then stored in brown bottles at 4°C. The three-dimensional fluorescence spectra of the training samples were measured using a fluorescence spectrometer, and the measurements were completed within 12 hours while maintaining the low temperature.
[0143] In this embodiment, a fluorescence spectrometer is used to measure three-dimensional fluorescence spectral data to obtain the excitation wavelength. The wavelength range is 200-600 nm, the excitation wavelength interval is 5 nm, and the emission wavelength is... The wavelength range is 200-650nm, with a wavelength interval of 1nm, resulting in a total of 81*451 dimensional matrix data.
[0144] Specifically, step S2 includes:
[0145] For the three-dimensional fluorescence spectral data of the training samples, the blank subtraction method was used to subtract background noise and Raman scattering by subtracting the reference solution;
[0146] Rayleigh and Raman scattering were eliminated using the Delaunay triangle interpolation method, and the extended SG filter was applied to the three-dimensional fluorescence spectral data to eliminate spectral jitter.
[0147] Raman normalization was used to normalize the three-dimensional fluorescence spectral data.
[0148] In this embodiment, the comparison diagram of the effects after preprocessing is as follows: Figure 7As shown, Figure a is the original three-dimensional fluorescence spectrum, Figure b is the spectrum after eliminating Rayleigh and Raman scattering, and Figure c is the spectrum after applying SG filtering to eliminate jitter.
[0149] In a specific embodiment:
[0150] During sampling training, four types of water samples were selected for the experiment: domestic sewage, rainwater, lake water, and pure fluorescent groups. Then, based on the aforementioned multi-peak focus mechanism, the peak positions with significant characteristics were highlighted. Please refer to [link to relevant documentation]. Figure 4 From left to right, the samples are domestic sewage, rainwater, lake water, and pure fluorescent groups. The brightest area represents the fluorescence peak area. It can be clearly seen that the training samples themselves are different, and the multi-peak attention positions based on weights are different.
[0151] For training samples with low concentrations, feature enhancement processing was performed. During implementation, the weight of the original three-dimensional fluorescence spectrum was set to 0.8, while the weight of the fluorescence peak region was set to 0.2. The final experimental results are as follows: Figure 5 As shown in the comparison between the original spectrum and the spectrum after morphological enhancement, it can be seen that the enhancement makes the regional features of the fluorescence peak more prominent, while the surrounding background information is relatively reduced. This makes it easier to focus on the significant regions of key features of the fluorescence peak when extracting local texture information.
[0152] When performing step S3.2 to extract local texture information, please refer to... Figure 6 This represents the local texture information of a single sample across four scales and five directions.
[0153] In step S5, the identifier obtains not only pollutant tags but also component spectra, such as... Figure 8 The image shows the component spectrum information of a test sample, which shows that the sample contains two pollutant components.
[0154] Based on the rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy provided by this invention, a pollutant fluorescence fingerprint spectrum library can be constructed. Representative sampling points are set at locations where water quality monitoring is required. After data analysis of the sampled samples in step S5 of this embodiment, the component spectrum of the sample is obtained. Then, the component spectrum is compared and similarity is calculated with the pollutant fluorescence fingerprint spectrum library. When the similarity is higher than the threshold, further precise location is performed to find the pollution source, ultimately realizing online water quality monitoring and pollution source tracing, which is of great significance for achieving sustainable ecological environmental protection.
[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy, characterized in that: Includes the following steps: S1: Obtain training samples of different types of water bodies. Each type of water body contains water pollutants. Use a fluorescence spectrometer to measure the three-dimensional fluorescence spectrum data corresponding to each training sample. S2: Preprocess the three-dimensional fluorescence spectral data obtained in step S1 to obtain the original three-dimensional fluorescence spectra of each training sample; S3: Extract features from the original three-dimensional fluorescence spectrum after step S2 to obtain global and local information. Integrate the global and local information to form a new feature matrix as the final feature of the three-dimensional fluorescence spectrum data of the sample. S4: Input the final features of the three-dimensional fluorescence spectral data obtained in step S3 and their corresponding identification labels into the support vector machine multi-identification model, train the model to obtain a multi-classifier and a recognizer, and complete the construction of the water pollutant identification model; S5: Collect test samples of the water body to be tested, obtain the three-dimensional fluorescence spectrum data of the test sample, and after the preprocessing described in step S2, input it into the water pollutant identification model constructed in step S4 to obtain the component spectrum of the test sample and complete the identification of water pollutant categories and components. Step S3 includes the following sub-steps: S3.1: Extract global information of fluorescence peaks from the original three-dimensional fluorescence spectrum; S3.2: Extract local texture information from the original three-dimensional fluorescence spectrum and perform dimensionality reduction processing; S3.3: Combine the global information of the three-dimensional fluorescence peak with the local texture information after dimensionality reduction, and perform normalization processing. Combine the normalized feature vectors of each training sample to obtain the final feature. Step S3.1 specifically includes: Set a set of possible peak locations Based on the intensity properties of each fluorescence peak in the original three-dimensional fluorescence spectrum, each position is assigned... Assign a weight accordingly Finally, the set of peak values with the highest weights is selected as the focus set: in, This is the brightness threshold. This refers to the global information of the three-dimensional fluorescence peaks; Step S3.2 specifically includes: First, two-dimensional empirical mode decomposition is performed on the original three-dimensional fluorescence spectra of each training sample to obtain a series of intrinsic mode functions (EMFs). Each EMF includes texture feature information at different scales in the image, and the formula is described as follows: in, This is the original three-dimensional fluorescence spectrum. It is the first One eigenmode function It is a residual. It is the number of intrinsic mode functions; Then, a dual-tree complex wavelet transform is applied to each intrinsic mode function to obtain complex wavelet coefficients at different scales and directions; Next, each complex wavelet coefficient is transformed into a one-dimensional vector, and all vectors are combined to form a wavelet coefficient feature matrix. In the wavelet coefficient feature matrix, each row represents all complex wavelet coefficients of an eigenmode function. The wavelet coefficient feature matrix is normalized and dimensionality reduced to select representative features.
2. The rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy according to claim 1, characterized in that: For training samples with low concentrations, morphological top-hat operations and feature enhancement processing are performed before extracting local texture information from their original three-dimensional fluorescence spectra. The morphological capping operation is used to highlight the peaks in the original three-dimensional fluorescence spectrum and locate the characteristic regions of the three-dimensional fluorescence peaks. The feature enhancement process includes: performing weighted enhancement processing on the feature regions of the three-dimensional fluorescence peak to obtain a new three-dimensional fluorescence spectrum image, and then performing step S3.
2.
3. The rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy according to claim 1, characterized in that: In step S4, when training the multi-recognition model using a support vector machine, A hybrid of radial basis functions and polynomial kernels is used as the kernel function of the support vector machine, and the whale optimization algorithm is used to optimize the support vector machine parameters. Finally, the solution with the highest fitness is selected as the support vector machine parameters for training the model. Specifically, the following steps are included: ① Initialize the support vector machine parameters and the control parameters of the whale optimization algorithm The control parameters of the whale optimization algorithm include the number of search agents, the maximum number of iterations, the randomness parameter, and the termination condition. A performance benchmark and fitness function are also set for subsequent dynamic adjustments. The support vector machine parameters include: the penalty coefficient for incorrect terms. The width parameter of the radial basis function kernel degree of polynomial kernel Independent terms of the polynomial kernel The mixing ratio of radial basis function kernels and polynomial kernels ; ② Calculation of the mixed kernel function Define hybrid kernel function Combining radial basis function kernels and polynomial kernels: in, ,and ③ Iterative process of whale optimization algorithm Exploration Phase: Explore solutions using the standard formula of the whale optimization algorithm; calculate the fitness of each search agent and select the solution with the highest fitness as the current optimal solution; Performance evaluation: Compare the maximum fitness improvement of each search agent over several consecutive generations; if the improvement is less than a preset threshold, the algorithm is considered to have begun to converge. Dynamic parameter tuning: If performance improvement is slow or stagnant, increase the stochasticity parameter to promote a wider exploration of the solution space; if fitness increases rapidly, decrease the stochasticity parameter to make more use of the current best solution for fine-tuning the parameters. Termination condition: Stop iteration if the maximum number of iterations is reached or the fitness has reached the desired highest level; ④ Solution evaluation and selection After the whale optimization algorithm has completed its iterations, the solution with the highest fitness is selected as the final SVM parameters. These parameters are then used to train the support vector machine multi-recognition model, and its performance is verified on test data.
4. The rapid identification method for water pollutant components based on three-dimensional fluorescence spectroscopy according to claim 1, characterized in that: Step S2 specifically includes: For the three-dimensional fluorescence spectral data of the training samples, Rayleigh scattering and Raman scattering are eliminated by blank subtraction and Delaunay triangle interpolation. Extended SG filtering is applied to the three-dimensional fluorescence spectral data to eliminate jitter. Then, Raman normalization is performed on the three-dimensional fluorescence spectral data to complete the preprocessing of the three-dimensional fluorescence spectral data.
