Hybrid network method for hyperspectral image water quality inversion

By adopting a hybrid network method in the hyperspectral water quality inversion task, combining first-order differential, 1D convolutional network, Transformer and LSTM and other technologies, the spectral, spatial and time series characteristics are extracted and integrated, and the high-spectral data processing problems in the existing technology are solved, achieving high-precision water quality inversion effect.

CN120164131APending Publication Date: 2025-06-17JIANGSU OCEAN UNIV
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510235015.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The prior art is difficult to effectively process high-dimensional and multi-band hyperspectral data in the hyperspectral water quality inversion task, resulting in limited performance of traditional linear methods and difficult to meet the needs of high-precision water quality inversion.

Method used

A hybrid network method for water quality inversion of hyperspectral images is adopted, and spectral pretreatment is performed through a first-order differential method, combining 1D convolutional network, improved Transformer encoder and LSTM network, spectral, spatial and time series features are extracted, and the cross-time attention mechanism and adaptive feature fusion module are optimized and fusion is performed to finally predict water quality parameters.

Benefits of technology

It significantly improves the adaptability to complex water environments and the accuracy of water quality inversion, overcomes the shortcomings of traditional methods in processing hyperspectral data, and achieves higher prediction accuracy and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120164131A_ABST
    Figure CN120164131A_ABST
Patent Text Reader

Abstract

The invention discloses a hybrid network method for hyperspectral image water quality inversion, and relates to the technical field of hyperspectral image analysis. The model comprises a spectral feature extraction module, an improved Transform encoder, an LSTM (Long Short Term Memory) module, a cross-time attention module and an adaptive feature fusion module. The model extracts spatial and spectral features through a deep convolutional network, enhances feature expression by using multi-scale embedding and an attention mechanism, and optimizes prediction precision in combination with a dynamic weight fusion strategy. Through end-to-end training of the model, water quality parameters (total nitrogen, dissolved oxygen and the like) in a hyperspectral image can be effectively estimated, and a spatial map of water quality distribution is generated. Compared with a traditional method (such as support vector regression, partial least square regression and the like), the hybrid network provided by the invention has the advantage that the accuracy and robustness of water quality parameter inversion are remarkably improved. Experimental results show that the method has excellent performance in a complex water body environment, and an efficient and reliable technical means is provided for accurately monitoring and evaluating water quality pollution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of hyperspectral remote sensing data analysis and water environment monitoring, and particularly relates to a hybrid network method for water quality inversion of hyperspectral images. Background Art

[0002] With the continuous development of spectral imaging acquisition technology and the wide application of unmanned aerial vehicles and aerial platforms, hyperspectral remote sensing technology has become an important tool in the field of environmental monitoring. Hyperspectral data has the characteristics of high spectral resolution and high spatial resolution. Each pixel contains rich continuous spectral band information and can provide fine spectral characteristics of substances. It has been widely used in fields such as agriculture, environmental monitoring, mineral exploration, urban planning, and disaster monitoring. In the field of environmental monitoring, hyperspectral remote sensing is used in scenarios such as water quality monitoring, pollution identification, land cover change analysis, and vegetation ecological research. Especially in the monitoring of water quality parameters such as total nitrogen (TN) and dissolved oxygen (DO) in water bodies, it shows great application potential.

[0003] The core of the water quality inversion task is to accurately predict the key parameters of water bodies based on hyperspectral data. Due to its high-dimensional and multi-band characteristics, hyperspectral data contains rich spectral and spatial information. However, this also leads to problems such as high data dimension, a large amount of redundant information, and susceptibility to noise interference. Therefore, traditional linear methods such as partial least squares regression (PLSR) and support vector regression (SVR) are limited in performance when dealing with complex non-linear relationships and are difficult to meet the requirements of high-precision water quality inversion.

[0004] In recent years, the development of deep learning technology has provided powerful tools for hyperspectral data analysis. Convolutional neural networks (CNNs) are good at extracting spatial and spectral features from high-dimensional data and have been widely used in hyperspectral image classification tasks; recurrent neural networks (RNNs) and their improved models (such as LSTMs) can capture the temporal features in spectral data. In addition, the Transformer model, due to its attention mechanism-based characteristics, can capture the global correlation of multi-scale features in spectral data. The introduction of these deep learning models provides the possibility to solve the non-linear modeling problem in the hyperspectral water quality inversion task.

[0005] Although the application of deep learning models in hyperspectral data processing has achieved remarkable results, there are still certain deficiencies in a single model architecture. When traditional CNNs process hyperspectral data, their pooling operations are prone to losing detailed information and it is difficult to understand the spatial relationships between features; although RNNs or LSTMs are good at modeling sequential data, it is difficult to simultaneously process the global features of the spectral and spatial dimensions; Transformer models have a high dependence on the training of large-scale data and are relatively sensitive to noise. Therefore, in the hyperspectral water quality inversion task, how to fully explore the correlations between spectral features, spatial features, and temporal features and effectively integrate the advantages of multiple models is a current research hotspot and difficulty. Summary of the Invention

[0006] In order to make up for the deficiencies of the prior art, how to extract effective information from the complex features of hyperspectral data and design a suitable deep learning model to process high-dimensional, high hyperspectral resolution hyperspectral image data, and at the same time, issues such as the complexity of the model, computing resources, and feature fusion need to be comprehensively considered. The present invention provides a hybrid network method for hyperspectral image water quality inversion.

[0007] To achieve the above object, the present invention provides the following technical solutions:

[0008] A hybrid network method for hyperspectral image water quality inversion specifically includes the following steps:

[0009] Step 1: Preprocess the hyperspectral image data, including radiometric correction, normalization processing, and characteristic band selection;

[0010] Step 2: Use the first-order differential method to perform spectral preprocessing on the hyperspectral image to remove background interference and enhance spectral variation features;

[0011] Step 3: Divide the preprocessed spectral data to construct a training set, a validation set, and a test set;

[0012] Step 4: Input the spectral data into the spectral feature extraction module, extract spectral features through a 1D convolutional network, and introduce non-linear features by applying the ReLU activation function;

[0013] Step 5: Adjust the spectral features to a fixed length through an adaptive pooling operation to provide a standardized input for subsequent processing;

[0014] Step 6: Input the low-level features after spectral feature extraction into the improved Transformer encoder for multi-scale embedding and deep feature extraction;

[0015] Step 7: In the improved Transformer encoder, apply the multi-head attention mechanism to strengthen the model's extraction of key spectral information;

[0016] Step 8: Feed the features extracted by the Transformer into the LSTM network to further extract the temporal features of the hyperspectral data;

[0017] Step 9: Perform dynamic feature fusion on the outputs of the Transformer and the LSTM through a cross-temporal attention mechanism to optimize feature matching;

[0018] Step 10: Adopt an adaptive feature fusion module to fuse features from different sources according to weights to form a comprehensive feature representation;

[0019] Step 11: Input the comprehensive features into the regression output module to predict water quality parameters, including key indicators such as total nitrogen and total phosphorus;

[0020] Step 13: Calculate the loss of the output results of the model, and use the mean square error (MSE) and mean absolute percentage error (MAPE) for optimization;

[0021] Step 13: Use the test set to verify the performance of the trained model and evaluate the prediction accuracy and robustness of the model.

[0022] Preferably, in step 2, the first-order differential method is used to perform spectral preprocessing on the hyperspectral data to remove background interference and enhance spectral change features. At the same time, the scale difference between different spectral bands is eliminated through normalization operations to provide more stable input data for the subsequent feature extraction module.

[0023] Preferably, in step 4, the spectral feature extraction module adopts a 1D convolutional network to capture the local correlation between different bands in the hyperspectral data through convolutional operations, and introduces non-linear expression ability through the activation function ReLU. Further, the spectral features are adjusted to a fixed length through adaptive pooling operations to provide a unified feature representation for the subsequent modules.

[0024] Preferably, in step 6, the improved Transformer encoder extracts deep features in the spectral data through multi-scale embedding and multi-head attention mechanisms, and enhances the stability and expression ability of the network through residual connections and layer normalization operations.

[0025] Preferably, in step 8, the LSTM network is used to extract the time series features of the hyperspectral data, model the spectral change trend through memory units, and further strengthen the temporal feature representation of the data.

[0026] Preferably, in step 9, the cross-temporal attention mechanism realizes the optimized matching of different features by calculating the dynamic attention weights between the output features of the LSTM and the Transformer. The attention calculation formula is:

[0027]

[0028] Z = AV

[0029] Among them, Q, K, and V respectively represent the query matrix, key matrix, and value matrix, and d k is the dimension of the feature, A is the attention weight matrix, and Z is the weighted attention output

[0030] Preferably, in step 10, the adaptive feature fusion module fuses features from different sources by a dynamic weighting method, and the weight calculation formula is:

[0031] f fused = α·f transformer + (1 - α)·f lstm

[0032] Among them, α is the weight parameter of adaptive learning, and f transformer and f lstm respectively represent the features extracted by the Transformer and LSTM modules, and f fused is the fused comprehensive feature.

[0033] Compared with the prior art, the technical effects and advantages of the present invention are:

[0034] The present invention takes the improved Transformer encoder and LSTM as the core, and realizes the comprehensive modeling and dynamic fusion of spectral features, spatial features, and time series features of hyperspectral data. The Transformer captures global correlations and multi-scale features, making up for the deficiencies of traditional CNN and LSTM in processing hyperspectral data, while the LSTM's modeling of time series features enhances the ability to capture spectral change trends. By introducing a cross-temporal attention mechanism and an adaptive feature fusion module, the present invention optimizes the feature matching and fusion strategy, significantly improving the adaptability to complex water environments and the water quality inversion accuracy.

[0035] The hybrid network architecture proposed by the present invention effectively overcomes the limitations of existing methods in hyperspectral data processing, can fully explore the global and local correlations between spectral and spatial features, and maximally improve the accuracy and stability of water quality inversion of hyperspectral images. This method shows excellent performance in the field of water quality monitoring and can be widely applied to scenarios such as lake monitoring, river water quality analysis, and environmental assessment, providing important technical support for water ecological environment protection. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is the hybrid network architecture diagram of the present invention;

[0037] Figure 2 is the specific flowchart of the embodiment of the present invention;

[0038] Figure 3 This is the comparison chart before and after the first-order differentiation of the present invention;

[0039] Figure 4 This is the spectral feature map extracted by the 1D convolutional network of the present invention;

[0040] Figure 5 This is the scatter plot of the comparison of the experimental prediction performance of the PLSR model of the present invention;

[0041] Figure 6 This is the scatter plot of the comparison of the experimental prediction performance of the SVR model of the present invention;

[0042] Figure 7 This is the scatter plot of the comparison of the experimental prediction performance of the XGBOOST model of the present invention;

[0043] Figure 8 This is the scatter plot of the comparison of the experimental prediction performance of the CATBOOST model of the present invention;

[0044] Figure 9 This is the scatter plot of the comparison of the experimental prediction performance of the CNN model of the present invention;

[0045] Figure 10 This is the scatter plot of the comparison of the experimental prediction performance of the LSTM model of the present invention;

[0046] Figure 11 This is the scatter plot of the comparison of the experimental prediction performance of the Transformer model of the present invention;

[0047] Figure 12 This is the scatter plot of the comparison of the experimental prediction performance of the TL-Net model of the present invention;

[0048] Figure 13 This is the comparison chart of the experimental accuracy of the performance of different network models in the embodiments of the present invention. Detailed implementation manners

[0049] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0050] The present invention provides a hybrid network method for hyperspectral image water quality inversion. First, the hyperspectral data is preprocessed by radiometric calibration, normalization, and first-order differential to remove background interference and enhance spectral features. The preprocessed data extracts local spectral features through a 1D convolutional network and inputs them into an improved Transformer encoder to capture global correlations and deep features. Subsequently, an LSTM network is used to model time series features to capture dynamic change trends. The output features of the Transformer and LSTM are dynamically matched through a cross-temporal attention mechanism, and an adaptive feature fusion module is used to optimize and fuse spectral, spatial, and time series features according to weights to generate comprehensive features for predicting water quality parameters.

[0051] The model is optimized through a regression module combined with indicators such as the coefficient of determination (R2), mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE), significantly improving the accuracy and robustness of water quality inversion.

[0052] The following further elaborates on this application with reference to the Figures 1-13 drawings:

[0053] The embodiments of this application disclose a hybrid network method for hyperspectral image classification, and the specific steps are as follows:

[0054] Step 1: Preprocess the hyperspectral image data, including radiometric calibration, normalization processing, and characteristic band selection;

[0055] Step 2: Use the first-order differential method to perform spectral preprocessing on the hyperspectral image to remove background interference and enhance spectral change features;

[0056] Step 3: Divide the preprocessed spectral data to construct a training set, a validation set, and a test set;

[0057] Step 4: Input the spectral data into the spectral feature extraction module, extract spectral features through a 1D convolutional network, and introduce non-linear features by applying the ReLU activation function;

[0058] Step 5: Adjust the spectral features to a fixed length through an adaptive pooling operation to provide a standardized input for subsequent processing;

[0059] Step 6: Input the low-level features after spectral feature extraction into an improved Transformer encoder for multi-scale embedding and deep feature extraction;

[0060] Step 7: In the improved Transformer encoder, apply the multi-head attention mechanism to strengthen the model's extraction of key spectral information;

[0061] Step 8: Feed the features extracted by the Transformer into the LSTM network to further extract the temporal features of the hyperspectral data;

[0062] Step 9: Dynamically fuse the outputs of the Transformer and the LSTM through a cross-temporal attention mechanism to optimize feature matching;

[0063] Step 10: Adopt an adaptive feature fusion module to fuse the features from different sources according to weights to form a comprehensive feature representation;

[0064] Step 11: Input the comprehensive features into the regression output module to predict water quality parameters, including key indicators such as total nitrogen and total phosphorus;

[0065] Step 12: Calculate the loss for the output results of the model and optimize it using the mean square error (MSE) and the mean absolute percentage error (MAPE);

[0066] Step 13: Use the test set to verify the performance of the trained model and evaluate the prediction accuracy and robustness of the model.

[0067] Example:

[0068] To verify the effectiveness of the present invention in practical engineering problems, an experiment on inverting river water quality from UAV aerial photography was carried out. First, a hyperspectral image (HSI) dataset of river water quality was collected and processed. The overall framework of the research content is as Figure 2 shown. When processing HSI data for the task of inverting river water quality parameters, a large number of experiments were carried out to evaluate the advantages and performance of the proposed hybrid network (TL-Net) combining the improved Transformer encoder and LSTM. Traditional methods such as using the Transformer or LSTM alone have obvious limitations. For example, the Transformer has low robustness to small-sample data, and it is difficult for the LSTM to efficiently extract spectral and spatial features. In addition, some classic machine learning methods, including support vector regression (SVR), XGBoost, CatBoost, and traditional partial least squares regression (PLSR), were also compared and found that these methods have limited ability to model the complex non-linear features of hyperspectral data, resulting in insufficient prediction accuracy. The present invention overcomes the above deficiencies by assembling the improved Transformer and LSTM layers into a hybrid network architecture, making full use of spectral features, spatial features, and time series features, and significantly improving the accuracy and robustness of inverting river water quality parameters.

[0069] To comprehensively evaluate the performance of the model, the present invention adopts a variety of evaluation metrics, including the coefficient of determination (R2), mean squared error (MSE), root mean squared error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE), to comprehensively measure the prediction quality of the model. In addition, the proposed TL-Net of the present invention is compared with individual Transformer, LSTM, and a series of machine learning methods (such as PLSR, SVR, XGBoost, and CatBoost), and the specific experimental results are shown in Table 2. The experiments show that the TL-Net model proposed by the present invention outperforms single deep learning models and traditional machine learning methods in all metrics, verifying its significant advantages in the hyperspectral water quality inversion task.

[0070] These methods include: PLSR, SVR, XGBoost, CatBoost, CNN, LSTM, Transformer, and the improved (TL-Net); the dataset is randomly divided into a training group and a test group at a ratio of 30% and 70%, and the same input feature dimension is used to ensure fair comparison. The present invention preliminarily extracts spectral features through a 1D convolutional network, then combines the improved Transformer to capture global spectral correlations, and uses LSTM to model time series features, significantly improving the inversion ability of water quality parameters. The cross-temporal attention mechanism and the adaptive feature fusion module further optimize the fusion effect of multimodal features, enabling the model to better capture the correlations between spectral, spatial, and temporal features. Through evaluation using metrics such as the coefficient of determination (R2) and mean squared error (MSE), the experimental results show that the method of the present invention exhibits excellent performance in the hyperspectral water quality inversion task, significantly outperforming other comparison methods.

[0071] The specific operation method is as follows:

[0072] In the experiment, first, a drone is used to take hyperspectral images of the target water body area to obtain hyperspectral data, and at the same time, the corresponding water quality label data is collected, including key parameters such as total nitrogen (TN), dissolved oxygen (DO), total suspended solids (TSS), and chlorophyll (CHLA). Subsequently, the collected hyperspectral data is preprocessed, including radiometric correction, normalization, and first-order derivative operation. Through the first-order derivative operation, background interference can be effectively removed, redundancy between bands can be reduced, and the separability of spectral features can be significantly enhanced, as Figure 3 shown in the Pearson correlation matrix, which reveals the changes between the original spectral data and the data after the first-order derivative. The data after the first-order derivative not only shows higher correlations but also optimizes the relationships between the spectral features of specific bands and water quality parameters.

[0073] As Figure 3As shown in Figs. 3(a) and 3(b), the Pearson correlation matrix of the original data shows complex correlations between bands, while the data after first-order differentiation significantly reduces the correlations between redundant bands and highlights the characteristics of key bands. The spectral change patterns of the original and differentiated data were compared in Fig. 3(c), further verifying the effectiveness of the first-order differentiation operation in enhancing spectral discrimination ability. Figure 3 Figs. 3(d) to 3(g) show the correlation coefficient curves between the hyperspectral bands and specific water quality parameters (such as TN, DO, TSS, and CHLA), indicating that the spectral data after differentiation is more suitable for modeling water quality parameters and has higher prediction potential.

[0074] The preprocessed hyperspectral data is input into the hybrid network model of the present invention. The first-order differentiation operation enhances the local features of the spectral data and reduces band redundancy, providing higher-quality input for feature extraction. Subsequently, the data is input into a 1D convolutional network such as Figure 4 Fig. 3(c) to extract local spectral features and capture the correlations between bands. Adaptive pooling (such as Figure 4 Fig. 3(d)) further compresses and integrates the features, ensuring feature consistency and retaining global information. These optimized features enter the improved Transformer and LSTM modules to model the global spectral relationships and time series characteristics, laying a foundation for the accurate prediction of water quality parameters.

[0075] In the hyperspectral image water quality inversion experiment, as can be seen from the comparison of the performance of various models shown in Figures 5-12 , there are significant differences in the performance of different models in the task of predicting the total nitrogen (TN) concentration. Traditional machine learning models, such as PLSR and SVR, have relatively low accuracy during training, and their prediction performance is limited. For example, the (R2) of the PLSR model is only 0.8067, and the MAPE is as high as 24.9592%, indicating its limited ability to extract and model the complex features of hyperspectral data. In contrast, SVR shows some improvement, with its (R2) reaching 0.9357, but there are still relatively high errors (MAPE is 7.7645%).

[0076] Deep learning models such as CNN and LSTM perform better than traditional models in terms of accuracy and error. The (R2) of CNN (as shown in the figure) is 0.9227, but due to its limited feature extraction ability to spatial information and insufficient modeling of temporal features and spectral dimensions, the error is still relatively high (MAPE is 10.9147%). LSTM shows relatively high prediction accuracy by modeling time series features, with its (R2) reaching 0.9547 and MAPE being 8.8071%, further reducing the error. However, LSTM still has deficiencies in multi-modal feature fusion of hyperspectral images.

[0077] In contrast, the Transformer model performs excellently in modeling the global spectral features, with an (R2) of 0.9689 and a MAPE of 9.9290%, further improving the prediction accuracy, but it has relatively insufficient ability to capture temporal features. The hybrid network model (TL-Net) combines an improved Transformer encoder and an LSTM module, making full use of the complementarity of spectral, spatial, and temporal features, and achieving the optimal prediction performance. Its (R2) is as high as 0.9938, the MSE is only 0.0032, and the MAPE is significantly reduced to 2.6062%. TL-Net realizes the efficient fusion of multi-modal features through a cross-temporal attention mechanism and an adaptive feature fusion module, significantly improving the accuracy and robustness of the model. Generally speaking, from the comparison of accuracy and error, it can be seen that TL-Net's performance in the hyperspectral water quality inversion task is significantly better than other models, fully verifying the superiority of the present invention in modeling the complex features of hyperspectral data and predicting water quality parameters.

[0078] The present invention obtains hyperspectral data of river water quality through UAV aerial photography and conducts experimental verification on the water quality inversion task, demonstrating the superior performance of the hybrid network structure (TL-Net) in the task of predicting water quality parameters in hyperspectral images. The experimental results show that the hybrid network structure can make full use of the ability of the Transformer to extract global spectral features and the ability of the LSTM to model time series features, and at the same time, through a cross-temporal attention mechanism and an adaptive feature fusion module, it realizes the efficient fusion of multi-modal features, significantly improving the prediction accuracy and robustness of the model.

[0079] Specifically, it can be seen from the experimental results in the figure that TL-Net is superior to traditional models (such as PLSR, SVR, XGBoost, etc.) and single deep learning models (such as CNN, LSTM, Transformer) in evaluation indicators such as the coefficient of determination (R2), mean square error (MSE), and root mean square error (RMSE). For example, as shown in the figure, the (R2) of TL-Net reaches 0.9938 and the MAPE is only 2.6062%, significantly better than other comparison models. This indicates that the hybrid network structure can fully combine the complementarity of spectral, spatial, and time series features, effectively capture complex non-linear features, and thus show higher accuracy in water quality parameter prediction.

[0080] The hybrid network structure effectively extracts spectral features and reduces feature redundancy by introducing 1D convolutional layers and adaptive pooling operations, providing high-quality inputs for subsequent deep feature modeling. Additionally, the cross-temporal attention mechanism dynamically matches the output feature weights of Transformer and LSTM, further optimizing the co-expression of features. In the experiment, the loss of TL-Net converged to the smooth stage at earlier training epochs, indicating its higher learning efficiency and stronger generalization ability.

[0081] Through the comparative analysis of the prediction results and the actual measured values of the actual samples, the reliability of the TL-Net model in water quality parameter prediction was verified. The experimental results show that the water quality parameters such as total nitrogen (TN) and dissolved oxygen (DO) predicted by TL-Net are highly consistent with the measured values, fully demonstrating its adaptability and measured reliability in complex water body environments.

[0082] In summary, the hybrid network structure based on the improved combination of Transformer and LSTM has significant advantages in the task of hyperspectral water quality parameter prediction. It not only improves the prediction accuracy and convergence speed of the model but also shows high measured reliability, providing an efficient and reliable solution for the application of hyperspectral remote sensing technology in the field of water quality monitoring.

[0083] Finally, it should be noted that the above are only the preferred embodiments of the present invention and are not used to limit the present invention. Those skilled in the art can modify the technical solutions or make equivalent replacements. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims

1. A hybrid network method for water quality inversion from hyperspectral images, characterized in that: The specific steps include: Step 1: Preprocess the hyperspectral image data, including radiation correction, normalization, and feature band selection; Step 2: Use the first-order differential method to perform spectral preprocessing on the hyperspectral image to remove background interference and enhance the spectral change characteristics; Step 3: Divide the preprocessed spectral data into data and construct training set, validation set and test set; Step 4: Input the spectral data into the spectral feature extraction module, extract the spectral features through the 1D convolutional network, and apply the ReLU activation function to introduce nonlinear features; Step 5: Adjust the spectral features to a fixed length through adaptive pooling operations to provide standardized input for subsequent processing; Step 6: Input the low-level features extracted from spectral features into the improved Transformer encoder for multi-scale embedding and deep feature extraction; Step 7: In the improved Transformer encoder, a multi-head attention mechanism is applied to enhance the model’s extraction of key spectral information; Step 8: Send the features extracted by Transformer into the LSTM network to further extract the temporal features of the hyperspectral data; Step 9: Dynamically fuse the outputs of Transformer and LSTM through the cross-temporal attention mechanism to optimize feature matching; Step 10: Adopt the adaptive feature fusion module to fuse the features from different sources according to the weights to form a comprehensive feature expression; Step 11: Input the comprehensive features into the regression output module to predict water quality parameters, including key indicators such as total nitrogen and total phosphorus; Step 12: Calculate the loss of the model’s output and optimize using mean square error and mean absolute percentage error. Step 13: Use the test set to verify the performance of the trained model and evaluate the prediction accuracy and robustness of the model.

2. A hybrid network method for water quality inversion from hyperspectral images according to claim 1, characterized in that: The adaptive fusion module adopts a dynamic weight allocation mechanism, and the weight calculation formula is: f fused =α·f transformer +(1-a)·f lstm Among them, α is the fusion weight obtained by model adaptive learning, f transformer Output feature of Transformer module, f lstm Output feature of LSTM module, f fused It is the comprehensive feature after fusion.

3. A hybrid network method for water quality inversion from hyperspectral images according to claim 1 or 2, characterized in that: The cross-temporal attention mechanism calculates the attention output through the following formula: Z=AV Among them, Q, K, and V represent the query matrix, key matrix, and value matrix respectively, and d k is the dimension of the feature, A is the attention weight matrix, and Z is the weighted attention output.

4. A hybrid network method for water quality inversion from hyperspectral images according to any one of claims 1 to 3, characterized in that: The loss function takes into account the marginal loss and the overall error and is defined as: Among them, L i is the prediction loss for each sample, L margin is the marginal loss, defined as: L margin =πmax(0,m + -||v i ||)+(1-π)max(0,||v i ||-m - ) m + and m - are the upper and lower limits of the marginal threshold, respectively, v i is the network output feature vector, and π is the marginal loss weight.

5. A hybrid network method for water quality inversion from hyperspectral images according to any one of claims 1 to 4, characterized in that: The feature extraction module is processed by the convolution calculation formula: F conv =σ(W*X+b) Where W is the convolution kernel, X is the input spectral data, b is the bias, σ is the activation function ReLU, * represents the convolution operation, and F conv is the extracted spectral features.

6. A hybrid network method for water quality inversion from hyperspectral images according to any one of claims 1 to 5, characterized in that: The final prediction value of the model is calculated by the following regression formula: y pred =W out F fused +b out Among them, W out is the regression weight matrix, F fused is the comprehensive feature after fusion, b out is the regression bias term, y pred is the predicted water quality parameter value.

Citation Information

Cited By

  • Seawater quality AI fusion intelligent monitoring system and method based on full spectrum data

    CN120992523A

  • Soil heavy metal hyperspectral remote sensing inversion method, device and system and storage medium

    CN121026989A

  • Method for intelligently monitoring coastal water eutrophication

    CN121614966A

  • Method and equipment for screening xanthine oxidase inhibitory peptide

    CN121747710A