Water quality monitoring method and system based on hyperspectral image intelligent analysis
Through intelligent analysis methods based on hyperspectral images and combined with deep learning technology, traditional water quality monitoring methods are solved, the problems of time-consuming and labor-intensive, single monitoring indicators and large interference from environmental factors are achieved, and efficient and accurate water quality monitoring and multi-parameter comprehensive analysis are achieved.
Patent Information
- Application Number
- CN202510443167.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-04-10
AI Technical Summary
The existing water quality monitoring methods rely on manual sampling and laboratory analysis, which is time-consuming and labor-intensive and difficult to achieve large-scale and real-time water quality monitoring. Moreover, the methods based on visual images cannot obtain deep spectral information of the water body, and the monitoring indicators are single, environmental factors are disturbed by a large amount, and the comprehensive analysis capabilities of multiple parameters are insufficient.
An intelligent analysis method based on hyperspectral images is adopted to optimize the preprocessing, feature extraction, wavelength selection and other links of hyperspectral image data, and combined with deep learning analysis, automatic monitoring and grading evaluation of water quality parameters are achieved. Specific steps include obtaining the original hyperspectral image data for preprocessing, performing spectral feature extraction and wavelength optimization, building an input feature tensor of the deep learning network, and building a water quality parameter level classifier.
It realizes efficient and accurate feedback on water quality monitoring results, eliminates interference factors such as atmospheric scattering and equipment noise, extracts pure spectral characteristics, improves the multi-parameter comprehensive analysis capabilities, and enhances the reliability and real-timeness of monitoring results.
Smart Images

Figure CN119942356A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water quality monitoring, and in particular to a water quality monitoring method and system based on hyperspectral image intelligent analysis. Background Art
[0002] Water quality monitoring is an important part of environmental protection and water resources management, and it is of great significance to ensure water ecological safety and human health. Traditional water quality monitoring methods mainly rely on manual sampling and laboratory analysis, which is not only time-consuming and labor-intensive, but also difficult to achieve large-scale, real-time water quality monitoring. With the rapid development of remote sensing technology, water quality monitoring methods based on visual images have gradually become a research hotspot. By quickly acquiring spectral information related to water bodies and conducting targeted analysis, non-contact monitoring is achieved, with fast response speed and wide monitoring range.
[0003] Patent CN202510104487.6 discloses a water quality monitoring system based on multi-source data perception, which evaluates water quality by analyzing the impact of water quality changes on aquatic organisms. Although this method has certain advantages in early warning of the risk of rapid deterioration of water quality, it still has the following shortcomings: First, this method mainly relies on the visual characteristics of the water surface image and cannot obtain the deep spectral information of the water body, resulting in a single monitoring indicator; second, this method does not fully consider the interference of environmental factors on the monitoring results, and its reliability needs to be improved; finally, this method lacks the ability to comprehensively analyze multiple water quality parameters and is difficult to meet the needs of comprehensive water quality assessment.
[0004] In addition, existing water quality monitoring methods based on visual images also have some common problems: first, the data preprocessing method is not perfect, and it is difficult to effectively eliminate interference factors such as atmospheric scattering and equipment noise; second, wavelength selection often relies on experience or simple statistical methods, and fails to make full use of spectral information; third, the feature extraction method is relatively simple and fails to effectively deal with mixed pixel problems and the complex relationship between wavelengths; fourth, classification models generally use traditional machine learning methods, which are not adaptable enough to nonlinear and multi-parameter water quality assessment problems. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a water quality monitoring technology based on hyperspectral images, which realizes automatic monitoring and grade evaluation of water quality parameters by optimizing the preprocessing, feature extraction, wavelength selection and other links of hyperspectral image data and combining with deep learning analysis, so as to ensure efficient and accurate feedback of water quality monitoring results.
[0006] In order to achieve the above object, the present invention provides a water quality monitoring method based on hyperspectral image intelligent analysis, comprising the following steps: S1: Acquire the original hyperspectral image data of the water surface and perform preprocessing to obtain standardized hyperspectral image data; S2: Extract spectral features and optimize wavelengths of standardized hyperspectral data to obtain key wavelength combinations; including: First, spectral decomposition is performed, and the spectral response value of the endmember at each wavelength is obtained by using the vertex component analysis method. The endmember abundance value at each spatial position is obtained by using the least squares method. The spectral decomposition is optimized by minimizing the Frobenius norm. Then, the discrimination score of each wavelength is calculated based on the spectral decomposition result. Then, the fitness value of different wavelength combinations is obtained based on the discrimination scores of all wavelengths and the Pearson correlation coefficient between the wavelengths. The optimal wavelength combination is obtained by iterative optimization using a genetic algorithm. Finally, a feature vector is constructed based on the standardized hyperspectral image data corresponding to each wavelength in the optimal wavelength combination. S3: Calculate the adaptive weight coefficients and normalized wavelength combination indexes between different wavelengths in the optimal wavelength combination, and construct a wavelength combination index matrix; S4: Construct the input feature tensor of the deep learning network based on the wavelength combination index matrix and self-attention enhancement mechanism; S5: Construct a water quality parameter grade classifier based on the deep learning network and evaluate the grade of each water quality parameter.
[0007] Preferably, the step S1 comprises the following steps: S11: Use hyperspectral imaging equipment to obtain raw hyperspectral image data of the water surface , including the spatial coordinates of the image and wavelength ; S12: Raw hyperspectral image data Perform spectral smoothing and denoising to obtain smoothed reflectance data , specifically: ; in, is the smoothed reflectivity data In space coordinates The wavelength is The value of is the original hyperspectral image data In space coordinates The wavelength is The value of is the interval between adjacent wavelength sampling points, is the weight coefficient of the Savitzky-Golay filter kernel function Position index within the filter window The weight of The value range is , is the filter window radius; S13: Smoothed reflectivity data Perform spatial registration and geometric correction to obtain corrected reflectivity data , specifically: ; in, is the corrected reflectance data In space coordinates The wavelength is The value of is the smoothed reflectivity data In space coordinates The wavelength is The value of is the affine transformation matrix In Location The weight coefficient at and are the horizontal and vertical indices of the affine transformation matrix, respectively, and their value ranges are Integer in ; S14: Constructing standardized hyperspectral image data , specifically: ; in, Standardized hyperspectral image data In space coordinates The wavelength is The value of The wavelength The mean reflectance value of all pixels at The wavelength The standard deviation of the reflectance values of all pixels at is the standardization adjustment parameter used to control the degree of standardization. is a natural constant.
[0008] Preferably, step S2 comprises the following steps: S21: Perform spectral decomposition on the standardized hyperspectral image data to obtain endmember spectra and abundance maps, specifically: ; in, For the The end members have spatial coordinates The abundance value at For the The end member is at the wavelength The spectral response value at is the number of end members, is the Frobenius norm; S22: Construct a wavelength importance evaluation index and calculate the discrimination score of each wavelength, specifically: ; in, The wavelength The discrimination score at For the The end member is at the wavelength The average spectral response value at For the The end member is at the wavelength The average spectral response value at For the The end member is at the wavelength Spectral variance at ; S23: Optimize wavelength combination based on genetic algorithm and construct fitness function : ; in, Candidate wavelength combinations The fitness value of and are weight coefficients, The wavelength Pearson correlation coefficient of the spectral response at ; Iterative optimization to obtain the optimal wavelength combination , specifically: ;; in, For the The optimal wavelength is selected. is the optimal number of wavelengths selected; S24: Extracting the optimal wavelength combination The corresponding eigenvector , specifically: ; in, is the spatial coordinate The eigenvector at Standardized hyperspectral image data In space coordinates The wavelength is The value of For the The weight coefficient of the optimal wavelength satisfies .
[0009] Preferably, step S3 comprises the following steps: S31: Calculate the adaptive weight coefficients used to adjust the contribution of different wavelength combinations , specifically: ; in, The wavelength and The weight coefficient of the combination and , and All belong to the optimal wavelength combination ; The wavelength and Spectral correlation of S32: Construct a normalized wavelength combination index set, specifically: ; in, In space coordinates Use wavelength and The normalized wavelength combination index constructed, and The standardized hyperspectral image data are In space coordinates The wavelength is and The value at time; S33: Constructing a complete wavelength combination index matrix , specifically: ; in, is the spatial coordinate The matrix containing all possible wavelength combination indices at is of dimension .
[0010] Preferably, step S4 comprises the following steps: S41: Build a self-attention mechanism to obtain spatial coordinates Self-attention features at ; S42: Construct the input feature tensor of the deep learning network, specifically: ; in, is the spatial coordinate The features enhanced by the self-attention mechanism at is an S-shaped growth curve function, is the spatial coordinate The input feature tensor at .
[0011] Further preferably, the step S41 includes the following steps: S411: construct a feature transformation matrix based on feature statistical characteristics, specifically: ; in, for dimensional identity matrix, , and They are the wavelength combination index matrices The standard deviation matrix, mean matrix and Pearson correlation coefficient matrix of is the feature dimension, ; S412: Calculate self-attention features: ; in, , and The spatial coordinates are The query features, key features and value features at is the spatial coordinate The self-attention feature at is the normalized exponential function.
[0012] Preferably, step S5 comprises the following steps: S51: Build a deep learning network, specifically: ; in, is the convolutional layer, is the global average pooling operation, is the batch normalization operation, and They are the first fully connected layer and the second fully connected layer, is a linear rectification function, , and are the feature vectors of the 1st, 2nd, and 3rd layers respectively; S52: Construct a water quality parameter level classifier, specifically: ; in, For the The probability distribution vector of the levels of water quality parameters, For the Classification head network of water quality parameters, For the The number of levels of water quality parameters, For the The water quality parameters belong to The true label of level, For the The water quality parameters belong to The predicted probability of level For the The cross entropy loss value of the water quality parameters, is the total loss value, is the natural logarithm, is the number of water quality parameter types; S53: Obtain water quality parameter level monitoring results, specifically: ; in, For the The final grade evaluation results of the water quality parameters range from .
[0013] The present invention also discloses a water quality monitoring system based on hyperspectral image intelligent analysis, comprising: Preprocessing module: obtain the original hyperspectral image data of the water surface and perform preprocessing to obtain standardized hyperspectral image data; Wavelength optimization module: extracts spectral features and optimizes wavelengths of standardized hyperspectral data to obtain key wavelength combinations; Wavelength combination index matrix construction module: calculates the adaptive weight coefficients and normalized wavelength combination indexes between different wavelengths in the optimal wavelength combination, and constructs the wavelength combination index matrix; Input feature tensor construction module: constructs the input feature tensor of the deep learning network based on the wavelength combination index matrix and self-attention enhancement mechanism; Water quality parameter grade assessment module: Build a water quality parameter grade classifier based on the deep learning network to assess the grade of each water quality parameter.
[0014] Compared with the prior art, the present invention has at least the following beneficial effects: 1. The present invention designs a multi-level data preprocessing process, including spectral smoothing and denoising, spatial registration correction and data standardization, which effectively eliminates the influence of factors such as atmospheric scattering, equipment noise and geographical location; at the same time, algorithms such as Savitzky-Golay filtering and affine transformation are adopted to ensure the continuity and spatial consistency of spectral data; the introduction of adaptive standardization method not only maintains the discrimination of data, but also improves the comparability between different regions, providing a high-quality data foundation for subsequent analysis.
[0015] 2. The present invention extracts pure spectral features through endmember decomposition technology, effectively solving the problem of mixed pixels; constructs a wavelength importance evaluation index that comprehensively considers inter-class differences and intra-class variances, and objectively evaluates the discrimination ability of each wavelength; uses genetic algorithms to optimize wavelengths, while ensuring feature discriminability and reducing data redundancy; designs a feature enhancement strategy based on the self-attention mechanism, fully exploits the correlation between wavelengths, and constructs a feature tensor with powerful expression capabilities.
[0016] 3. The present invention designs a multi-task learning framework that can classify multiple water quality parameters at the same time; the training efficiency and generalization ability of the model are improved through technologies such as residual connection and batch normalization; the use of probabilistic output not only gives clear classification results, but also provides a reliability assessment of the prediction, providing strong technical support for water quality monitoring and management decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a flow chart of a water quality monitoring method based on intelligent analysis of hyperspectral images according to Embodiment 1 of the present invention; Figure 2 The red, green and blue three-channel image of the monitoring target water body in Example 1 of the present invention; Figure 3 The original hyperspectral image of the monitoring target water body in Example 1 of the present invention; Figure 4 for Figure 3 The smoothed image; Figure 5 for Figure 4 Image after registration correction; Figure 6 This is a standardized hyperspectral image of the monitoring target water body in Example 1 of the present invention. DETAILED DESCRIPTION
[0018] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.
[0019] Embodiment 1: like Figure 1 As shown, a water quality monitoring method based on intelligent analysis of hyperspectral images includes the following steps: S1: Obtain the original hyperspectral image data of the water surface and preprocess it to obtain standardized hyperspectral image data: S11: Use hyperspectral imaging equipment to obtain raw hyperspectral image data of the water surface , including the spatial coordinates of the image and wavelength ; In this embodiment, the red, green and blue three-channel image and the original hyperspectral image of the monitored target water body are respectively as follows: Figure 2 and Figure 3 As shown; S12: Raw hyperspectral image data Perform spectral smoothing and denoising to obtain smoothed reflectance data ,like Figure 4 As shown, specifically: ; in, is the smoothed reflectivity data In space coordinates The wavelength is The value of is the original hyperspectral image data In space coordinates The wavelength is The value of is the interval between adjacent wavelength sampling points, is the weight coefficient of the Savitzky-Golay filter kernel function Position index within the filter window The weight of The value range is , is the filter window radius, which is 3 in this embodiment; Specifically: ; in, is the position vector, is a geometric series matrix; S13: Smoothed reflectivity data Perform spatial registration and geometric correction to obtain corrected reflectivity data ,like Figure 5 As shown, specifically: ; in, is the corrected reflectance data In space coordinates The wavelength is The value of is the smoothed reflectivity data In space coordinates The wavelength is The value of is the affine transformation matrix In Location The weight coefficient at and are the horizontal and vertical indices of the affine transformation matrix, respectively, and their value ranges are Integer in ; The affine transformation matrix in this embodiment is specifically: The central wavelength of the spectral range is selected as the reference wavelength; the spatial offset between wavelengths is determined by calculating the Pearson correlation coefficient between other wavelengths and the reference wavelength; a 5×5 correction matrix is constructed based on the spatial offset to correct the spatial position deviation between wavelengths, and the weight coefficient of each position of the correction matrix is calculated using a Gaussian function, and the smoothing parameter of the Gaussian function is 1; the correction matrix is normalized so that the sum of all weight coefficients is 1; S14: Constructing standardized hyperspectral image data ,like Figure 6 As shown, specifically: ; in, Standardized hyperspectral image data In space coordinates The wavelength is The value of The wavelength The mean reflectance value of all pixels at The wavelength The standard deviation of the reflectance values of all pixels at is a standardization adjustment parameter used to control the degree of standardization. In this embodiment, it is 0.3. is a natural constant.
[0020] This step adopts a multi-source data fusion approach, fully utilizing the complementarity of hyperspectral and lidar data to improve data integrity and reliability; data standardization is used to unify data of different scales, laying the foundation for subsequent feature extraction.
[0021] S2: Extract spectral features and optimize wavelengths of standardized hyperspectral data to obtain key wavelength combinations: S21: Perform spectral decomposition on the standardized hyperspectral image data to obtain endmember spectra and abundance maps, specifically: ; in, For the The end members have spatial coordinates The abundance value at is obtained by using the least squares method. For the The end member is at the wavelength The spectral response value at is obtained by using the vertex component analysis method. is the number of end members, which is 3 in this embodiment, is the Frobenius norm; In this embodiment, the end member spectrum is obtained by using the vertex component analysis method The process is: Standardized hyperspectral image data Expanded into a two-dimensional matrix in the spatial dimension ,in is the pixel index; calculate the matrix The covariance matrix of , for the covariance matrix Perform eigenvalue decomposition to obtain the eigenvector matrix and the eigenvalue diagonal matrix ; Select the largest The eigenvectors corresponding to the eigenvalues constitute the projection matrix , projecting the original data into the feature vector space to obtain ; Search in the projection space vertices, and project these vertices back to the original space to obtain the endmember spectrum ; S22: Construct a wavelength importance evaluation index and calculate the discrimination score of each wavelength, specifically: ; in, The wavelength The discrimination score at For the The end member is at the wavelength The average spectral response value at For the The end member is at the wavelength The average spectral response value at For the The end member is at the wavelength Spectral variance at ; S23: Optimize wavelength combination based on genetic algorithm and construct fitness function : ; in, Candidate wavelength combinations The fitness value of and are weight coefficients, which are 0.7 and 0.3 respectively in this embodiment. The wavelength Pearson correlation coefficient of the spectral response at ; The optimization process of the genetic algorithm in this embodiment is: Initialize the population, encode the candidate wavelength combination into a binary chromosome, the chromosome length is the number of spectral wavelengths, 1 means the wavelength is selected, 0 means it is not selected; set the population size to 100, the maximum number of iterations to 200; use roulette wheel to select, the selection probability is proportional to the individual fitness value; crossover operation uses single point crossover, the crossover probability is set to 0.8; mutation operation uses bit reversal, the mutation probability is set to 0.1; each iteration retains the individual with the highest fitness to enter the next generation directly, and the remaining individuals are generated through selection, crossover and mutation operations; when the maximum number of iterations is reached or the optimal fitness value changes by less than 20 consecutive generations, the next generation is generated. Stop iteration when Iterative optimization to obtain the optimal wavelength combination , specifically: ; in, For the The optimal wavelength is selected. is the selected optimal wavelength number, which is 5 in this embodiment; S24: Extracting the optimal wavelength combination The corresponding eigenvector , specifically: ; in, is the spatial coordinate The eigenvector at Standardized hyperspectral image data In space coordinates The wavelength is The value of For the The weight coefficient of the optimal wavelength satisfies In this embodiment .
[0022] In this step, endmember decomposition is used to obtain spectral endmembers and abundance maps, effectively separating the pure spectral information in mixed pixels; a wavelength importance evaluation index is constructed, which comprehensively considers the inter-class differences and intra-class variances to objectively evaluate the discrimination ability of each wavelength; a genetic algorithm is used for wavelength optimization, and the wavelength discrimination ability and redundancy are considered at the same time through the fitness function to ensure that the selected wavelength combination has strong discrimination ability and low information redundancy.
[0023] S3: Calculate the adaptive weight coefficients and normalized wavelength combination indexes between different wavelengths in the optimal wavelength combination, and construct a wavelength combination index matrix: S31: Calculate the adaptive weight coefficients used to adjust the contribution of different wavelength combinations , specifically: ; in, The wavelength and The weight coefficient of the combination and , and All belong to the optimal wavelength combination ; The wavelength and Spectral correlation of The process of obtaining the spectral correlation in this embodiment is: ; S32: Construct a normalized wavelength combination index set, specifically: ; in, In space coordinates Use wavelength and The normalized wavelength combination index constructed, and The standardized hyperspectral image data are In space coordinates The wavelength is and The value at time; S33: Constructing a complete wavelength combination index matrix , specifically: ; in, is the spatial coordinate The matrix containing all possible wavelength combination indices at is of dimension .
[0024] This step realizes the dynamic adjustment of the importance of different wavelength combinations by constructing adaptive weight coefficients. The design of weight coefficients fully considers the spectral correlation between wavelengths, so that wavelength combinations with lower correlation obtain higher weights, effectively improving the utilization efficiency of complementary information. The normalized wavelength combination index is adopted, which not only eliminates the influence of the absolute value of the spectrum, but also highlights the relative difference characteristics between wavelengths, and enhances the ability to distinguish spectral features. All possible wavelength combinations are integrated into a unified index matrix, which not only retains the complete combination information, but also facilitates subsequent feature extraction and classification recognition.
[0025] S4: Based on the wavelength combination index matrix and self-attention enhancement mechanism, the input feature tensor of the deep learning network is constructed: S41: Build a self-attention mechanism to obtain spatial coordinates Self-attention features at : S411: construct a feature transformation matrix based on feature statistical characteristics, specifically: ; in, for dimensional identity matrix, , and They are the wavelength combination index matrices The standard deviation matrix, mean matrix and Pearson correlation coefficient matrix of is the feature dimension, ; S412: Calculate self-attention features: ; in, , and The spatial coordinates are The query features, key features and value features at is the spatial coordinate The self-attention feature at is the normalized exponential function; S42: Construct the input feature tensor of the deep learning network, specifically: ; in, is the spatial coordinate The features enhanced by the self-attention mechanism at is an S-shaped growth curve function, is the spatial coordinate The input feature tensor at .
[0026] In this step, the adaptive enhancement of wavelength combination features is achieved by designing a self-attention mechanism, which fully utilizes the statistical characteristics of the features to construct a feature transformation matrix so that important feature combinations obtain higher attention weights. In the feature transformation process, three statistical indicators, namely standard deviation, mean and correlation, are considered simultaneously to comprehensively characterize the distribution characteristics and intrinsic correlations of the features. The query-key-value attention calculation framework is adopted, which can not only capture the long-range dependencies between features, but also highlight the discriminative feature combinations.
[0027] S5: Construct a water quality parameter grade classifier based on a deep learning network to evaluate the grade of each water quality parameter: S51: Build a deep learning network, specifically: ; in, is the convolution layer. In this embodiment, the convolution kernel size of the convolution layer is , the step size is 1, is the global average pooling operation, is the batch normalization operation, and They are the first fully connected layer and the second fully connected layer, and in this embodiment, the output dimensions are 256 and 128 respectively. is a linear rectification function, , and are the feature vectors of the 1st, 2nd, and 3rd layers respectively; S52: Construct a water quality parameter level classifier, specifically: ; in, For the The probability distribution vector of the levels of water quality parameters, For the Classification head network of water quality parameters, For the The number of levels of water quality parameters, For the The water quality parameters belong to The true label of level, For the The water quality parameters belong to The predicted probability of level For the The cross entropy loss value of the water quality parameters, is the total loss value, is the natural logarithm, is the number of water quality parameter types, which is 3 in this embodiment, including total nitrogen, total phosphorus and chlorophyll; The training process of the deep learning network in this embodiment adopts the following strategy: The initial learning rate is set to 0.001, and the Adam optimizer with momentum 0.9 is used for parameter update. After every 10 training cycles, the learning rate decays to 0.1 times the original value. The training batch size is set to 64. To prevent overfitting, an early stopping strategy is adopted, and training is stopped when the validation set loss does not decrease for 5 consecutive cycles. S53: Obtain water quality parameter level monitoring results, specifically: ; in, For the The final grade evaluation results of the water quality parameters range from , indicating different pollution levels, which are divided into 5 levels in this embodiment. For all possible levels The probability of choosing The maximum grade is taken as the final evaluation result.
[0028] In this step, a multi-level deep learning network structure is designed to achieve accurate classification of the pollution levels corresponding to each water quality parameter. The convolution layer can effectively extract spatial features, the global average pooling operation reduces the feature dimension and retains key information, and the batch normalization operation accelerates network training and improves model stability.
[0029] Embodiment 2: This embodiment provides a water quality monitoring system based on hyperspectral image intelligent analysis, which mainly includes the following five modules: Preprocessing module: obtain the original hyperspectral image data of the water surface and perform preprocessing to obtain standardized hyperspectral image data; Wavelength optimization module: extracts spectral features and optimizes wavelengths of standardized hyperspectral data to obtain key wavelength combinations; Wavelength combination index matrix construction module: calculates the adaptive weight coefficients and normalized wavelength combination indexes between different wavelengths in the optimal wavelength combination, and constructs the wavelength combination index matrix; Input feature tensor construction module: constructs the input feature tensor of the deep learning network based on the wavelength combination index matrix and self-attention enhancement mechanism; Water quality parameter grade assessment module: Build a water quality parameter grade classifier based on the deep learning network to assess the grade of each water quality parameter.
[0030] The water quality monitoring system provided in this embodiment is used to implement the water quality monitoring method in the above-mentioned embodiment 1, wherein the functions implemented by each functional module of the water quality monitoring system correspond one-to-one to each step of the water quality monitoring method; therefore, they will not be repeated here.
[0031] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof in this article are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0032] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0033] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A water quality monitoring method based on intelligent analysis of hyperspectral images, characterized in that: The following steps are involved: S1: Acquire the original hyperspectral image data of the water surface and perform preprocessing to obtain standardized hyperspectral image data; S2: Extract spectral features and optimize wavelengths of standardized hyperspectral data to obtain key wavelength combinations; including: First, spectral decomposition is performed, and the spectral response value of the endmember at each wavelength is obtained by using the vertex component analysis method. The endmember abundance value at each spatial position is obtained by using the least squares method. The spectral decomposition is optimized by minimizing the Frobenius norm. Then, the discrimination score of each wavelength is calculated based on the spectral decomposition result. Then, the fitness value of different wavelength combinations is obtained based on the discrimination scores of all wavelengths and the Pearson correlation coefficient between the wavelengths. The optimal wavelength combination is obtained by iterative optimization using a genetic algorithm. Finally, a feature vector is constructed based on the standardized hyperspectral image data corresponding to each wavelength in the optimal wavelength combination. S3: Calculate the adaptive weight coefficients and normalized wavelength combination indexes between different wavelengths in the optimal wavelength combination, and construct a wavelength combination index matrix; S4: Construct the input feature tensor of the deep learning network based on the wavelength combination index matrix and self-attention enhancement mechanism; S5: Construct a water quality parameter grade classifier based on the deep learning network and evaluate the grade of each water quality parameter.
2. The water quality monitoring method based on hyperspectral image intelligent analysis according to claim 1 is characterized in that: The step S1 comprises the following steps: S11: Use hyperspectral imaging equipment to obtain raw hyperspectral image data of the water surface , including the spatial coordinates of the image and wavelength ; S12: Raw hyperspectral image data Perform spectral smoothing and denoising to obtain smoothed reflectance data , specifically: ; in, is the smoothed reflectivity data In space coordinates The wavelength is The value of is the original hyperspectral image data In space coordinates The wavelength is The value of is the interval between adjacent wavelength sampling points, is the weight coefficient of the Savitzky-Golay filter kernel function Position index within the filter window The weight of The value range is , is the filter window radius; S13: Smoothed reflectivity data Perform spatial registration and geometric correction to obtain corrected reflectivity data , specifically: ; in, is the corrected reflectance data In space coordinates The wavelength is The value of is the smoothed reflectivity data In space coordinates The wavelength is The value of is the affine transformation matrix In Location The weight coefficient at and are the horizontal and vertical indices of the affine transformation matrix, respectively, and their value ranges are Integer in ; S14: Constructing standardized hyperspectral image data , specifically: ; in, Standardized hyperspectral image data In space coordinates The wavelength is The value of The wavelength The mean reflectance value of all pixels at The wavelength The standard deviation of the reflectance values of all pixels at is the standardization adjustment parameter used to control the degree of standardization. is a natural constant.
3. The water quality monitoring method based on hyperspectral image intelligent analysis according to claim 2 is characterized in that: The step S2 comprises the following steps: S21: Perform spectral decomposition on the standardized hyperspectral image data to obtain endmember spectra and abundance maps, specifically: ; in, For the The end members have spatial coordinates The abundance value at For the The end member is at the wavelength The spectral response value at is the number of end members, is the Frobenius norm; S22: Construct a wavelength importance evaluation index and calculate the discrimination score of each wavelength, specifically: ; in, The wavelength The discrimination score at For the The end member is at the wavelength The average spectral response value at For the The end member is at the wavelength The average spectral response value at For the The end member is at the wavelength Spectral variance at ; S23: Optimize wavelength combination based on genetic algorithm and construct fitness function : ; in, Candidate wavelength combinations The fitness value of and are weight coefficients, The wavelength Pearson correlation coefficient of the spectral response at ; Iterative optimization to obtain the optimal wavelength combination , specifically: ; in, For the The optimal wavelength is selected. is the optimal number of wavelengths selected; S24: Extracting the optimal wavelength combination The corresponding eigenvector , specifically: ; in, is the spatial coordinate The eigenvector at Standardized hyperspectral image data In space coordinates The wavelength is The value of For the The weight coefficient of the optimal wavelength satisfies .
4. The water quality monitoring method based on hyperspectral image intelligent analysis according to claim 3 is characterized in that: The step S3 comprises the following steps: S31: Calculate the adaptive weight coefficients used to adjust the contribution of different wavelength combinations , specifically: ; in, The wavelength and The combined weight coefficient and , and All belong to the optimal wavelength combination ; The wavelength and Spectral correlation of S32: Construct a normalized wavelength combination index set, specifically: ; in, In space coordinates Use wavelength and The normalized wavelength combination index constructed, and The standardized hyperspectral image data are In space coordinates The wavelength is and The value at time; S33: Constructing a complete wavelength combination index matrix , specifically: ; in, is the spatial coordinate The matrix containing all possible wavelength combination indices at is of dimension .
5. The water quality monitoring method based on hyperspectral image intelligent analysis according to claim 4 is characterized in that: The step S4 comprises the following steps: S41: Build a self-attention mechanism to obtain spatial coordinates Self-attention features at ; S42: Construct the input feature tensor of the deep learning network, specifically: ; in, is the spatial coordinate The features enhanced by the self-attention mechanism at is an S-shaped growth curve function, is the spatial coordinate The input feature tensor at .
6. The water quality monitoring method based on hyperspectral image intelligent analysis according to claim 5 is characterized in that: The step S41 comprises the following steps: S411: construct a feature transformation matrix based on feature statistical characteristics, specifically: ; in, for dimensional identity matrix, , and They are the wavelength combination index matrices The standard deviation matrix, mean matrix and Pearson correlation coefficient matrix of is the feature dimension, ; S412: Calculate self-attention features: ; in, , and The spatial coordinates are The query features, key features and value features at is the spatial coordinate The self-attention feature at is the normalized exponential function.
7. The water quality monitoring method based on hyperspectral image intelligent analysis according to claim 5 is characterized in that: The step S5 comprises the following steps: S51: Build a deep learning network, specifically: ; in, is the convolutional layer, is the global average pooling operation, is the batch normalization operation, and They are the first fully connected layer and the second fully connected layer, is a linear rectification function, , and are the feature vectors of the 1st, 2nd, and 3rd layers respectively; S52: Construct a water quality parameter level classifier, specifically: ; in, For the The probability distribution vector of the levels of water quality parameters, For the Classification head network of water quality parameters, For the The number of levels of water quality parameters, For the The water quality parameters belong to The true label of level, For the The water quality parameters belong to The predicted probability of level For the The cross entropy loss value of the water quality parameters, is the total loss value, is the natural logarithm, is the number of water quality parameter types; S53: Obtain water quality parameter level monitoring results, specifically: ; in, For the The final grade evaluation results of the water quality parameters range from .
8. A water quality monitoring system based on intelligent analysis of hyperspectral images, characterized in that: include: Preprocessing module: obtain the original hyperspectral image data of the water surface and perform preprocessing to obtain standardized hyperspectral image data; Wavelength optimization module: extracts spectral features and optimizes wavelengths of standardized hyperspectral data to obtain key wavelength combinations; Wavelength combination index matrix construction module: calculates the adaptive weight coefficients and normalized wavelength combination indexes between different wavelengths in the optimal wavelength combination, and constructs the wavelength combination index matrix; Input feature tensor construction module: constructs the input feature tensor of the deep learning network based on the wavelength combination index matrix and self-attention enhancement mechanism; Water quality parameter grade assessment module: construct a water quality parameter grade classifier based on a deep learning network to assess the grade of each water quality parameter; To realize the water quality monitoring method based on hyperspectral image intelligent analysis as described in any one of claims 1 to 7.
Citation Information
Patent Citations
A water quality monitoring system based on multi-source data perception
CN119534788B
Remote sensing hyperspectral reconstruction method and system based on spectrum self-attention mechanism
CN116091640A
Hyperspectral water quality parameter estimation method of LBFGS optimization acceleration multilayer sensing network
CN118552851A
Hyperspectral data and image analysis using machine learning
US20240288308A1
Hyperspectral waveband extraction method based on optimal index factor-correlation coefficient method
WO2016000088A1
Cited By
Seawater quality AI fusion intelligent monitoring system and method based on full spectrum data
CN120992523A
Swimming pool water quality detection method and system based on optical sensing
CN121409896A
Multi-class material sorting method and system based on hyperspectrum, medium and product
CN121534935A