Feature selection method of water quality classification machine learning model

The initial feature subset was screened through the Shapley additive interpretation method and combined with the particle swarm algorithm and support vector machine, which solved the problem of slow feature optimization speed, significantly improved the accuracy and efficiency of the remote sensing model for coastal water quality classification, and was suitable for high-dimensional data sets handling.

CN119128469APending Publication Date: 2024-12-13XIAMEN UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411072337.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, feature optimization speed is slow, especially in the remote sensing model for coastal water quality classification. The training speed of particle swarm optimization algorithm for high-dimensional feature sets is slow, which affects the efficiency and accuracy of the model.

Method used

The Shapley additive interpretation method is used to calculate the contribution value of the feature to filter the initial optimization feature subset, and combine the particle swarm algorithm and support vector machine to find the optimal feature subset through the SHAP-PSO optimization algorithm to improve the efficiency of feature selection and model Classification accuracy.

Benefits of technology

It significantly improves the accuracy and training speed of the remote sensing model for coastal water quality classification, reduces the complexity of the model, improves the transparency and interpretability of the feature selection process, and is suitable for processing large-scale high-dimensional data sets, meeting the needs of real-time applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128469A_ABST
    Figure CN119128469A_ABST
Patent Text Reader

Abstract

The invention discloses a feature selection method for a water quality classification machine learning model, and the method comprises the following steps: carrying out the analysis of collected on-site water quality observation parameters and satellite remote sensing data through a correlation analysis method, and obtaining an original feature subset; calculating the contribution value of each feature in the original feature subset to the water quality classification machine learning model by adopting a Shapley additive interpretation method (SHAP), and screening the features ranked in the front as an initial optimization feature subset according to the contribution values; and carrying out calculation optimization on the initial optimization feature subset by adopting a particle swarm optimization (PSO) to obtain an optimal feature subset. According to the method, the SHAP-PSO optimization algorithm is designed to screen the optimal feature subset required by the machine learning algorithm, and the precision of the coastal water quality classification remote sensing model is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of feature optimization technology, and in particular to a feature selection method for a water quality classification machine learning model. Background Art

[0002] Feature selection is an important factor affecting machine learning algorithms. Feature selection is not only an important means to improve the performance of machine learning algorithms, but also a key data preprocessing step in pattern recognition, which can provide good training samples for pattern recognition. In the use of machine learning algorithms to carry out remote sensing inversion of coastal water quality classification, the main factors affecting water pollution are generally found first, and then the sensitive feature bands affecting the main pollution indicators are selected through various remote sensing band combinations and correlation analysis to form the original feature set. Feature selection refers to selecting an effective subset of the original feature set by a certain method, so that the model trained based on this feature subset has the highest accuracy. The purpose of feature selection is to find the optimal feature subset, remove irrelevant or redundant features in the original feature data set, reduce the dimension of the data set, and thus improve the efficiency and accuracy of the model. Using particle swarm optimization (PSO) to screen features is a common method. However, for feature sets with high feature dimensions, the training speed of the particle swarm optimization algorithm will be very slow. Summary of the invention

[0003] The purpose of the present invention is to solve the problem of slow feature optimization speed for the original feature set in the prior art.

[0004] The technical solution adopted by the present invention to solve the technical problem is: to provide a feature selection method for a water quality classification machine learning model, comprising the following steps:

[0005] The collected on-site water quality observation parameters and satellite remote sensing data were analyzed using correlation analysis to obtain the original feature subset;

[0006] The Shapley additive interpretation method is used to calculate the contribution value of each feature in the original feature subset, and the features ranked in the front are selected according to the contribution value as the initial optimized feature subset;

[0007] The particle swarm algorithm is used to calculate and optimize the initial optimized feature subset to obtain the optimal feature subset.

[0008] Preferably, the on-site water quality observation parameters and satellite remote sensing data are analyzed using correlation analysis, specifically: correlation analysis is performed on the remote sensing reflectance of different bands in the satellite remote sensing data and the pollution factors, and sensitive characteristic bands with correlation coefficients higher than a preset threshold are found.

[0009] Preferably, the original feature subset includes:

[0010] Single-band features, including remote sensing reflectance of sensitive feature bands with correlation coefficients with active phosphate, inorganic nitrogen, or dissolved oxygen above a preset threshold;

[0011] Band ratio feature: the band ratio is constructed based on the permutation and combination of single band features using the band ratio method, and several band ratios with correlation coefficients with active phosphate, inorganic nitrogen or dissolved oxygen higher than a preset threshold are selected as band ratio features;

[0012] The three-band combination feature includes all three-band combination features obtained by arranging and combining all single-band features; the three-band combination feature represents a feature composed of three bands.

[0013] Preferably, the three-band combination is represented as (XY) / Z, wherein X, Y and Z represent single-band features used to combine the three-band combination.

[0014] Preferably, the original feature subset further includes a spectral index feature, and the spectral index feature includes:

[0015] Normalized band difference turbidity index NDTI, expressed as:

[0016] NDTI = (B4-B3) / (B4+B3);

[0017] The normalized fluorescence height index NFHI is expressed as:

[0018] NFHI=B4 / B3;

[0019] Band Ratio Index BRI, expressed as:

[0020] BRI=B5 / B4 or BRI=B8A / B4;

[0021] Among them, B3 and B4 refer to the remote sensing reflectivity of the 3rd and 4th bands of the Landsat 8 satellite or the remote sensing reflectivity of the 3rd and 4th bands of the Sentinel-2 satellite after atmospheric correction, respectively; B5 refers to the remote sensing reflectivity of the 5th band of the Landsat 8 satellite after atmospheric correction; B8A refers to the remote sensing reflectivity of the 8A band of the Sentinel-2 satellite after atmospheric correction.

[0022] Preferably, the Shapley additive interpretation method is used to calculate the contribution value of each feature in the original feature subset, including:

[0023] Construct an additive explanatory model by calculating the marginal contribution of each feature in the original feature subset to the model output as the SHAP value;

[0024] Sort the SHAP values ​​of all features to obtain the overall importance ranking;

[0025] The SHAP values ​​of all features for different water qualities were ranked to obtain the classification importance ranking;

[0026] The top several features ranked by overall importance and the top several features ranked by classification importance are selected from the original feature subset as the initial optimized feature subset.

[0027] Preferably, the particle swarm algorithm is used to perform computational optimization on the initial optimized feature subset, and a method combining the particle swarm optimization algorithm and the support vector machine algorithm is used, and the classification accuracy of the SVM algorithm is used as the fitness function of the particle swarm optimization algorithm to find the classification feature set with the highest classification accuracy.

[0028] Preferably, the support vector machine adopts a nonlinear support vector machine, and feature optimization is achieved by tuning the adjustable parameters of the support vector machine, namely, the penalty parameter C, the kernel function kernel and the kernel function coefficient gamma.

[0029] Preferably, the particle swarm algorithm is used to perform computational optimization on the initial optimized feature subset, specifically: the initial optimized feature subset is substituted into the particle swarm algorithm for training, the optimal parameters of the model are determined using a grid search method, and the adjustable parameter penalty parameter C and the kernel function kernel of the support vector machine are set; the particle swarm algorithm randomly initializes the speed and position of the particle, calculates the fitness function value of the particle, and continuously updates the individual extreme value and the global extreme value of the particle according to the update formula of the particle swarm algorithm to find the optimal solution, and the features corresponding to the optimal solution are used as the optimal feature subset.

[0030] The present invention gives full play to the advantages of SHAP algorithm and particle swarm optimization algorithm in the feature selection process, and combines the powerful classification ability of support vector machine to greatly improve the performance and application value of coastal water quality classification remote sensing model, which includes the following

[0031] Beneficial effects:

[0032] (1) The present invention adopts the SHAP-PSO particle swarm optimization algorithm to screen the optimal feature subset required by the machine learning algorithm, which significantly improves the accuracy of the coastal water quality classification remote sensing model; for feature sets with very high feature dimensions, the training speed of the particle swarm optimization algorithm will be very slow, so the Shapley additive interpretation algorithm (SHAP algorithm) is first used to obtain the initial optimized feature subset, and then the particle swarm optimization algorithm is substituted to screen the feature subset, which can improve the training speed; by adopting the SHAP algorithm, the contribution of each feature to the model output can be explained and quantified, making the feature selection process more transparent and explainable, which can not only improve the credibility of the model, but also facilitate the discovery of potential important environmental factors, and promote the in-depth understanding and research of coastal water pollution problems;

[0033] (2) The particle swarm optimization algorithm of the present invention is combined with a support vector machine (SVM). The fitness of each particle is evaluated by the SVM model, making the feature selection process more accurate and efficient. The high-dimensional data processing capability and classification performance of the support vector machine can ensure that the features that contribute to the classification results are accurately identified when screening feature subsets, thereby further improving the prediction performance of the model.

[0034] (3) The feature selection process provided by the present invention optimizes layer by layer from the selection of original features, the screening of the initial optimized feature subset to the determination of the optimal feature subset, ensuring that a high-quality training sample feature set can be provided for the machine learning algorithm, reducing the interference of redundant and irrelevant features, and effectively reducing the complexity of the model; this feature selection method improves the efficiency and speed of model training, is suitable for the processing of large-scale high-dimensional data sets, and helps to accelerate the development and deployment of coastal water quality classification remote sensing inversion models to meet the real-time requirements in practical applications.

[0035] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments, but the present invention is not limited to the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A method step diagram of an embodiment of the present invention;

[0037] Figure 2 This is a heat map of the correlation between pollution factors and single bands in an embodiment of the present invention, wherein the pollution factors of (a) are active phosphate and inorganic nitrogen, and the pollution factor of (b) is dissolved oxygen;

[0038] Figure 3 : This is a heat map of the correlation between the band ratio feature and the pollution factor of the embodiment of the present invention, wherein the pollution factor of (a) is active phosphate, the pollution factor of (b) is inorganic nitrogen, and the pollution factor of (c) is dissolved oxygen;

[0039] Figure 4 The importance score results of each feature calculated by SHAP in the embodiment of the present invention;

[0040] Figure 5 The top 20 characteristic variables contributing to the prediction scores of different categories of water quality according to the embodiment of the present invention are as follows: (a) is category I water, (b) is category II water, (c) is category III water, (d) is category IV water, and (e) is category IV water;

[0041] Figure 6 is the number of features selected in the iteration of the embodiment of the present invention. DETAILED DESCRIPTION

[0042] See also Figure 1FIG. 1 is a diagram showing steps of a method according to an embodiment of the present invention, comprising the following steps:

[0043] S101, using correlation analysis method to analyze the collected on-site water quality observation parameters and satellite remote sensing data to obtain the original feature subset;

[0044] S102, using Shapley additive interpretation method to calculate the contribution value of each feature in the original feature subset, and selecting the features ranked in the front according to the contribution value as the initial optimized feature subset;

[0045] S103, using a particle swarm algorithm to perform computational optimization on the initial optimized feature subset to obtain an optimal feature subset.

[0046] Specifically, the S101 of the embodiment of the present invention collects remote sensing data from Landsat / Sentinel.

[0047] Specifically, in S102 of the embodiment of the present invention, in order to better utilize the machine learning method to carry out water quality classification, it is necessary to first find out various sensitive characteristic bands that may affect pollution factors as the original feature set. The present invention uses the correlation analysis method to correlate the remote sensing reflectance of different bands of Landsat / Sentinel with major pollution factors such as active phosphate, inorganic nitrogen, dissolved oxygen, etc., and find sensitive characteristic bands with higher correlation coefficients as the original feature set. These sensitive characteristic bands include:

[0048] 1. Spectral index characteristics

[0049] Since active phosphate, inorganic nitrogen, dissolved oxygen and other pollution factors are usually related to the changes in optical active parameters such as chlorophyll a and turbidity, it can be seen from the correlation analysis that they are strongly correlated with each other. Therefore, the spectral index commonly used to invert the chlorophyll a and turbidity concentration of water bodies is selected and added to the original feature set. These spectral indices mainly include the normalized band difference turbidity index (NDTI), the normalized fluorescence height index (NFHI) and the band ratio index, as shown in Table 1:

[0050] Table 1 Spectral index information

[0051]

[0052] Among them, B3, B4 and B5 refer to the remote sensing reflectance of the 3rd to 5th bands of Landsat8 after atmospheric correction. For the remote sensing data of Sentinel-2 satellite, the settings of its B3, B4 and B8A bands correspond to B3, B4 and B5 of Landsat 8, respectively. Therefore, B8A in Table 1 refers to the remote sensing reflectance of the 8A band of Sentinel-2.

[0053] 2. Single-band remote sensing reflectivity

[0054] Correlation analysis was performed between remote sensing reflectance of the five bands B1-B5 / 8A and active phosphate, inorganic nitrogen and dissolved oxygen. Figure 2 As can be seen from the figure, active phosphate shows a certain correlation with B2, B3, and B4; while inorganic nitrogen shows a relatively strong positive correlation with the five bands from B1 to B5 / 8A; on the contrary, dissolved oxygen has a strong negative correlation with B2, B3, and B4. Therefore, B1 to B5 are selected as sensitive spectral single bands to be added to the original feature set.

[0055] 3. Band ratio

[0056] The band ratio method is a very common band combination feature in the field of water environment remote sensing monitoring. The present invention selects the band ratio method to construct the band combination and calculates the correlation coefficient between the band ratio and three non-optical parameters, namely inorganic nitrogen, phosphate and dissolved oxygen. Figure 3 As shown, the horizontal axis represents the reflectance of the band as the numerator in the band ratio combination, and the vertical axis represents the reflectance of the band as the denominator in the band ratio combination. According to the correlation heat map, the correlation heat map is diagonally symmetrical, and the areas with high correlation between the three parameters and the band ratio are basically concentrated in the second to fourth rows. Therefore, the band ratio combinations B1 / B2, B1 / B3, B1 / B4, B2 / B3, B2 / B4 and B3 / B4 are selected to be added to the original feature set.

[0057] 4. Choice of three-band combination

[0058] The machine learning model is a "black box". Users cannot know the internal calculation formulas and principles, so there are many factors that affect its performance. Sometimes the most influential input features may not have special physical meanings. In order to include more band combinations, the present invention performs permutation and combination operations on the sensitive bands B1 to B5 / 8A of the inactive optical water quality parameters, and obtains a total of 50 three-band combination formulas to add to the original feature set, as shown in Table 2:

[0059] Table 2 Three-band combination feature set

[0060]

[0061]

[0062] So far, the embodiment of the present invention has obtained a total of 64 elements of the original feature set, including three spectral index features of NDTI, NFHI, and BRI, five single bands from B1 to B5, 6 band ratios and 50 three-band combinations.

[0063] Feature set optimization is a crucial step in building a classification model. A suitable feature subset can achieve higher classification accuracy with fewer feature variables, thereby improving model efficiency. The 64 original feature set elements that have been obtained may contain a lot of redundancy between each other. Using them directly for training will reduce model efficiency, and the classification accuracy may not be optimal. Therefore, feature selection and optimization are very necessary.

[0064] Specifically, S103 first uses the Shapley Additive exPlanation (SHAP) algorithm to rank the importance of the 64 features in the original feature set. SHAP is a method to solve the model interpretability. It is based on the concept of Shapley value proposed in cooperative game theory and constructs an additive interpretation model, that is, all features in the model are regarded as "contributors" and the internal operation of the model is explained by calculating the marginal contribution of each feature to the model output.

[0065] The importance scores of each feature calculated using SHAP are as follows: Figure 4 As shown. Obviously, the single band B3 has the highest feature importance score, followed by B2. From the global "contribution", it can be seen that the single band has the highest contribution score, and the spectral index NDTI and NFHI are ranked later. This may be because although the non-optical activity parameters show a certain correlation with chlorophyll a and turbidity, it is not obvious from the overall performance of the model when extended to qualitative issues such as water quality grade. The contribution values ​​of the band ratio and the three-band combination basically fluctuate at the median level.

[0066] Classification problems not only focus on the overall accuracy of the model, but also need to pay attention to the impact of each feature variable on different types of water quality. The SHAP algorithm can not only rank the contribution of features from a global perspective, but also explain the impact of features locally. Figure 5 As shown in the figure, the top 20 feature variables ranked by importance for the five types of water quality prediction are displayed. Each point on the figure is the SHAP value of a feature for a data. The vertical axis is the feature variable, and the horizontal axis represents the SHAP value of each feature, which can also be considered as the probability of the model judging the water quality as this type. The closer the color of the point is to red, the higher the value of the feature variable is, and the closer it is to blue, the lower the value is. Figure 5It can be seen that the most influential features for Class I water are the three-band combination (B1-B4) / B1 and (B2-B4) / B2. When the values ​​of these two features are larger, the SHAP value is larger, and the probability of being judged as Class I water is higher. Similarly, the most influential features for Class II water are single bands B2, B3, and B4. When their values ​​are larger, the probability of being judged as Class II water is higher; for Class III water, B3 also has the greatest influence, but in contrast to Class II water, when the value of B3 is larger, the probability of being judged as Class III water is lower; and the larger the values ​​of B3, the three-band combination (B1-B4) / B1, (B2-B4) / B2, and the band ratio B2 / B4, the lower the probability of being judged as Class IV water. The feature importance of the three-band ratio is also important for Class IV water. For the spectral index, NFHI and BRI were not among the top 20 in importance of water quality characteristics of each grade, while NDTI had a certain influence on the judgment of Class I and Class II water. The larger the NDTI, the smaller the probability of judging it as Class I water, and the greater the probability of judging it as Class II water.

[0067] After analysis, the embodiment of the present invention selects the top 20 features in terms of overall importance score and the top five features in terms of importance to each type of water quality characteristics, as well as the spectral variable NDTI to form an initial optimized feature subset, including B1-B5, B1 / B4, B2 / B4, (B1-B4) / B4, etc., a total of 26 feature variables as the initial optimized feature subset.

[0068] The initial optimized feature subset basically covers the features with the largest contribution and tries to ensure the integrity of the feature types. The main purpose is to delete most of the features with low scores and remove redundant variables, so as to prepare for the next step of particle swarm optimization (PSO) optimization.

[0069] Specifically, the S104 uses a particle swarm optimization algorithm to screen the initial optimized feature subset to obtain the optimal feature subset. The particle swarm algorithm is an evolutionary computing technology first proposed by Dr. Eberhart in 1995. Its basic idea is to find the optimal solution through repeated collaboration and information sharing between individuals in the group. In the feature selection process, the particle swarm optimization algorithm repeatedly iterates the sample set, and each sample data finds and tracks the "optimal value" through iterations, and continuously updates itself to finally find the optimal solution. Due to its simple principle and fewer parameters, the particle swarm optimization algorithm is widely used in machine learning and neural network training. However, for feature sets with very high feature dimensions, the training speed of the particle swarm optimization algorithm will be very slow. Therefore, the SHAP algorithm is first used to obtain the initial optimized feature subset containing 26 feature variables by manual selection, and then the particle swarm optimization algorithm is substituted to screen the feature subset to obtain the final optimized subset. The SHAP algorithm can score the importance of features involved in water quality classification inversion, but feature variables with high importance scores are not necessarily the best features, because there may be strong correlations between features, and the SHAP algorithm can only sort the importance of features, and cannot reflect the correlation between features. The particle swarm optimization algorithm takes into account factors such as the collaboration mechanism, mutual relationship and environmental factors between feature variables, so that the most suitable feature subset can be screened out more comprehensively.

[0070] Specifically, the embodiment of the present invention combines the particle swarm optimization algorithm with the support vector machine (SVM) algorithm, takes the classification accuracy of the SVM algorithm as the fitness function, and searches for the classification feature set with the highest classification accuracy. Support vector machine is a classification model algorithm, which is very suitable for small data samples, can solve high-dimensional and nonlinear classification problems, and has strong learning ability and high generalization rate. It is one of the most popular machine learning models today. Support vector machines can generally be divided into three categories: linearly separable support vector machines, linear support vector machines, and nonlinear support vector machines. These three models are used to solve three types of training data, namely, linearly separable training data, approximately linearly separable training data, and linearly inseparable training data. This article trains the third type of nonlinear support vector machine. When the data is linearly inseparable, the nonlinear support vector machine is learned by kernel techniques and soft interval maximization. This article mainly optimizes the adjustable parameters of the support vector machine, such as the penalty parameter C, the kernel function kernel, and the kernel function coefficient gamma. The SVM algorithm has the characteristics of small sample learning and high learning efficiency. It is a research hotspot in the field of machine learning in recent years, and it can be effectively applied to feature selection.

[0071] The initial optimized feature subset of the training set is substituted into the PSO algorithm for training, and the optimal parameters of the model are determined by the grid search method. The penalty term C of SVM is set to 239, and the kernel function type is selected as RBF function; 1c of the PSO algorithm is set to 0.5, 2c is set to 0.5, w is set to 0.8, the population size is set to 30, the number of iterations is set to 200, the speed and position of the particle are randomly initialized, and the fitness function value of the particle is calculated. According to the update formula of the PSO algorithm, the individual extreme value and global extreme value of the particle are continuously updated to find the optimal solution.

[0072] After PSO algorithm optimization, it was found that the model can obtain the optimal solution after selecting 11 features, see Figure 6 As shown, 11 features are selected here to form the optimal feature subset, as shown in Table 3:

[0073] Table 3 Optimal feature subsets

[0074]

[0075] The present invention reduces the number of original features by 82.8% through the SHAP-PSO optimization algorithm. The results show that the more eigenvalues ​​there are, the higher the model accuracy is not necessarily the case. Feature screening can help integrate useful information in high-dimensional data and improve the accuracy of model classification.

[0076] Specifically, the effectiveness of the SHAP-PSO algorithm is evaluated. To verify the effectiveness of the SHAP-PSO algorithm for feature selection, the embodiment of the present invention uses parameters such as precision and recall to compare the classification accuracy of the initial optimized feature subset and the optimized best subset.

[0077] In order to evaluate the accuracy and reliability of the machine learning classification model, the present invention uses a confusion matrix to compare the classification accuracy of the initial optimized feature subset and the optimized best subset. The establishment of the confusion matrix is ​​shown in Table 4. The confusion matrix is ​​an n×n matrix (n represents the number of categories), each row of which represents an actual category and each column represents a predicted category. Each element a in the matrix ij It represents the number of samples that are actually of the i-th class but predicted to be of the j-th class.

[0078] Table 4 Confusion matrix

[0079] True value / predicted value Prediction Category 1 Prediction Category 2 … Prediction category n Real Category 1 <![CDATA[a 11 ]]> <![CDATA[a 12 ]]> … <![CDATA[a 1n ]]> Real Category 2 <![CDATA[a 21 ]]> <![CDATA[a 22 ]]> … <![CDATA[a 2n ]]> … … … … … True category n <![CDATA[a n1 ]]> <![CDATA[a n2 ]]> … <![CDATA[a nn ]]>

[0080] The embodiment of the present invention selects accuracy, recall, F1 value and Kappa coefficient as classification accuracy evaluation indicators. The specific calculation formula is as follows:

[0081] Accuracy refers to the ratio of correctly classified samples to all samples:

[0082]

[0083] Recall refers to the proportion of samples that actually belong to a certain class that are correctly predicted to be of that class:

[0084]

[0085] Precision indicates the proportion of samples predicted to be of a certain class that actually belong to that class:

[0086]

[0087] The F1 value is the harmonic mean of precision and recall, which can be used to evaluate whether a model is suitable. The larger the F1 value, the more suitable the model is:

[0088]

[0089] Among them, P and R represent precision and recall respectively.

[0090] The Kappa coefficient is an indicator of consistency between data in statistics. In classification problems, the Kappa coefficient indicates whether the model prediction results are consistent with the actual classification results. When the Kappa coefficient is within the interval [0.61,1], it means that the model test results are highly consistent with the actual values; when the Kappa coefficient is in the interval [0.41,0.6], it indicates that the consistency is moderate; when the Kappa coefficient is less than 0.4, it means that the prediction results are inconsistent with the actual situation and the model performance is poor. The Kappa coefficient is expressed as:

[0091]

[0092] The classification accuracy results of the support vector machine after five-fold cross validation on the training set are shown in Table 5:

[0093] Table 5 Classification accuracy evaluation indicators

[0094]

[0095] Comparing the classification results of the two feature subsets, it can be seen that the model trained with the optimized best subset has better evaluation indicators than the model trained with the initial feature subset. Its accuracy has increased from 76.5% to 82.94%, and the classification Kappa value has also increased from 0.70 to 0.79, indicating that the predicted value is almost completely consistent with the actual value. These results show that the use of optimized feature subsets can greatly improve the performance of the classification model, and the SHAP-PSO optimization algorithm is effective.

[0096] It can be seen that the present invention provides a processing technology process for algorithm training sample feature selection in nearshore water quality classification remote sensing inversion based on machine learning. The process optimizes layer by layer from original feature selection, screening of initial optimized feature subsets to determination of optimal feature subsets to ensure that a high-quality training sample feature set can be provided for the machine learning algorithm. The SHAP-PSO particle swarm optimization algorithm is used to screen the optimal feature subset required by the machine learning algorithm, which significantly improves the accuracy of the coastal water quality classification remote sensing model.

[0097] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A feature selection method for a water quality classification machine learning model, characterized in that: The following steps are involved: The collected on-site water quality observation parameters and satellite remote sensing data were analyzed using correlation analysis to obtain the original feature subset; The Shapley additive interpretation method is used to calculate the contribution value of each feature in the original feature subset, and the features ranked in the front are selected according to the contribution value as the initial optimized feature subset; The particle swarm algorithm is used to calculate and optimize the initial optimized feature subset to obtain the optimal feature subset.

2. The feature selection method of the water quality classification machine learning model according to claim 1 is characterized in that: The correlation analysis method is used to analyze the on-site water quality observation parameters and satellite remote sensing data. Specifically, the remote sensing reflectivity of different bands in the satellite remote sensing data is correlated with the pollution factor through the correlation analysis method to find sensitive characteristic bands with correlation coefficients higher than a preset threshold.

3. The feature selection method of the water quality classification machine learning model according to claim 2 is characterized in that: The original feature subset includes: Single-band features, including remote sensing reflectance of sensitive feature bands with correlation coefficients with active phosphate, inorganic nitrogen, or dissolved oxygen above a preset threshold; Band ratio feature: the band ratio is constructed based on the permutation and combination of single band features using the band ratio method, and several band ratios with correlation coefficients with active phosphate, inorganic nitrogen or dissolved oxygen higher than a preset threshold are selected as band ratio features; The three-band combination feature includes all three-band combination features obtained by arranging and combining all single-band features; the three-band combination feature represents a feature composed of three bands.

4. The feature selection method of the water quality classification machine learning model according to claim 3 is characterized in that: The three-band combination is represented as (XY) / Z, where X, Y, and Z represent single-band features used to combine the three-band combination.

5. The feature selection method of the water quality classification machine learning model according to claim 3 is characterized in that: The original feature subset also includes a spectral index feature, and the spectral index feature includes: Normalized band difference turbidity index NDTI, expressed as: NDTI = (B4-B3) / (B4+B3); The normalized fluorescence height index NFHI is expressed as: NFHI=B4 / B3; Band Ratio Index BRI, expressed as: BRI=B5 / B4 or BRI=B8A / B4; Among them, B3 and B4 refer to the remote sensing reflectivity of the 3rd and 4th bands of the Landsat 8 satellite or the remote sensing reflectivity of the 3rd and 4th bands of the Sentinel-2 satellite after atmospheric correction, respectively; B5 refers to the remote sensing reflectivity of the 5th band of the Landsat 8 satellite after atmospheric correction; B8A refers to the remote sensing reflectivity of the 8A band of the Sentinel-2 satellite after atmospheric correction.

6. The feature selection method of the water quality classification machine learning model according to claim 1 is characterized in that: The Shapley additive interpretation method is used to calculate the contribution value of each feature in the original feature subset, including: Construct an additive explanatory model by calculating the marginal contribution of each feature in the original feature subset to the model output as the SHAP value; Sort the SHAP values ​​of all features to obtain the overall importance ranking; The SHAP values ​​of all features for different water qualities were ranked to obtain the classification importance ranking; The top several features ranked by overall importance and the top several features ranked by classification importance are selected from the original feature subset as the initial optimized feature subset.

7. The feature selection method of the water quality classification machine learning model according to claim 1 is characterized in that: The particle swarm algorithm is used to perform computational optimization on the initial optimized feature subset, and a method combining the particle swarm optimization algorithm and the support vector machine algorithm is used to take the classification accuracy of the SVM algorithm as the fitness function of the particle swarm optimization algorithm to find the classification feature set with the highest classification accuracy.

8. The feature selection method of the water quality classification machine learning model according to claim 7 is characterized in that: The support vector machine adopts a nonlinear support vector machine, and feature optimization is achieved by tuning the adjustable parameters of the support vector machine, namely, the penalty parameter C, the kernel function kernel, and the kernel function coefficient gamma.

9. The feature selection method of the water quality classification machine learning model according to claim 8 is characterized in that: The particle swarm algorithm is used to perform computational optimization on the initial optimized feature subset, specifically: the initial optimized feature subset is substituted into the particle swarm algorithm for training, the optimal parameters of the model are determined by a grid search method, and the adjustable parameter penalty parameter C and the kernel function kernel of the support vector machine are set; the particle swarm algorithm randomly initializes the speed and position of the particle, calculates the fitness function value of the particle, and continuously updates the individual extreme value and the global extreme value of the particle according to the update formula of the particle swarm algorithm to find the optimal solution, and the features corresponding to the optimal solution are used as the optimal feature subset.

Citation Information

Cited By

  • Scene parameter-based automatic driving system safety analysis method and system

    CN119862792A

  • Aerobic sludge granulation allogenic material adding method, system, equipment and medium

    CN120136297A