Ecological clean small watershed construction effectiveness evaluation method based on dynamic adaptive weight

By constructing a weighted watershed spatial correlation graph and a graph attention network, and combining a fully connected layer and the MAML algorithm, the problems of insufficient dynamic adaptability and neglect of spatial dependencies in existing technologies are solved, and a high-precision evaluation of the effectiveness of ecological clean small watershed construction is achieved.

CN122347367APending Publication Date: 2026-07-07LANZHOU SOIL & WATER CONSERVATION SCI TEST STATION OF GANSU PROVINCIAL DEPT OF WATER RESOURCES (GANSU PROVINCIAL INST OF SOIL & WATER CONSERVATION SCI)

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LANZHOU SOIL & WATER CONSERVATION SCI TEST STATION OF GANSU PROVINCIAL DEPT OF WATER RESOURCES (GANSU PROVINCIAL INST OF SOIL & WATER CONSERVATION SCI)
Filing Date
2026-04-30
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing methods for evaluating the effectiveness of ecological clean watershed construction lack dynamic adaptability in the face of real-time environmental changes, ignore the spatial topological relationships between geographical elements within the watershed, and have low evaluation accuracy in scenarios lacking long-term monitoring data.

Method used

By constructing a weighted watershed spatial association graph, a graph attention network is used to extract node feature matrices and environmental feature vectors. A global context vector is generated by combining fully connected layers and nonlinear activation functions. Cosine similarity is calculated to screen similar watersheds. A weighted prediction network is constructed and trained using the MAML algorithm. The output criterion layer weight vector is then used for evaluation.

Benefits of technology

It achieves accurate evaluation under real-time environmental changes, captures the spatial heterogeneity of the watershed, and improves the evaluation accuracy and interpretability in scenarios with few samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122347367A_ABST
    Figure CN122347367A_ABST
Patent Text Reader

Abstract

The application discloses an ecological clean small watershed construction effectiveness evaluation method based on dynamic adaptive weight, which comprises the following steps: constructing a watershed spatial correlation graph based on the spatial geographic data of a target watershed, inputting a node feature matrix into a graph attention network to obtain a graph-level embedding vector; obtaining a global context vector based on an environmental feature vector and the graph-level embedding vector; calculating the cosine similarity between the global context vectors of the target watershed and historical watersheds, selecting similar historical watersheds based on the landform types and the cosine similarity, and constructing a support set; performing offline meta-training on a weight prediction network through an MAML algorithm to obtain network initialization parameters; selecting a few-shot adaptive mode or a zero-shot generalization mode to fine-tune the parameters based on the support set, inputting the global context vector of the target watershed into the weight prediction network with the fine-tuned parameters, outputting a criterion layer weight vector, and weighting and aggregating the data of each evaluation index to obtain a construction effectiveness comprehensive score. The application can improve the evaluation accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of ecological environment monitoring and evaluation technology, and involves, but is not limited to, a method for evaluating the effectiveness of ecological clean small watershed construction based on dynamic adaptive weights. Background Technology

[0002] The construction of ecologically clean small watersheds is an important measure for soil and water conservation and ecological civilization construction. A scientific and accurate evaluation of the construction results is crucial for guiding subsequent governance work and optimizing resource allocation. Currently, the evaluation of the effectiveness of ecologically clean small watershed construction is mainly based on industry standards such as the "Technical Specifications for the Construction of Ecologically Clean Small Watersheds." These standards typically employ a multi-indicator comprehensive evaluation system, covering dimensions such as soil and water conservation, non-point source pollution control, improvement of the living environment, and sustainable socio-economic development. In the specific evaluation process, the analytic hierarchy process (AHP) or entropy weight method is commonly used to determine the indicator weights. For example, subjective weights are calculated by constructing a judgment matrix through expert scoring, or objective weights are calculated using the inherent dispersion of the data. Finally, a comprehensive score for watershed governance is obtained through linear weighted summation.

[0003] In practical applications, existing technologies often suffer from the following significant drawbacks: First, because most existing methods employ fixed weighting systems, they cannot respond to real-time environmental changes. For example, during periods of surging rainfall in the flood season, the weight of non-point source pollution control measures should be increased accordingly, but fixed weighting cannot capture this dynamic demand, leading to distorted evaluation results. Second, existing methods treat each indicator as an independent variable, ignoring the spatial topological relationships and hydrological connectivity between geographical elements within the watershed, such as the relationship between pollution sources and water quality monitoring points, and between engineering measures and vegetation cover, resulting in evaluation models that fail to reflect the spatial heterogeneity of the watershed. Third, for newly established small watersheds lacking long-term monitoring data, traditional machine learning methods struggle to build high-precision models due to insufficient training samples, while simple transfer of historical data often leads to negative transfer due to differences in watershed characteristics, reducing the reliability of evaluation results.

[0004] Therefore, there is an urgent need for a more comprehensive evaluation method for the effectiveness of ecological and clean small watershed construction, in order to solve the problems of insufficient dynamic adaptability, neglect of spatial dependence between indicators, and low evaluation accuracy in scenarios with small sample sizes, and to achieve a significant improvement in the accuracy and interpretability of the evaluation of the effectiveness of ecological and clean small watershed construction. Summary of the Invention

[0005] This application provides a method for evaluating the effectiveness of ecological clean small watershed construction based on dynamic adaptive weights.

[0006] The technical solution of this application embodiment is implemented as follows: In a first aspect, embodiments of this application provide a method for evaluating the effectiveness of ecological clean small watershed construction based on dynamic adaptive weights. The method includes: acquiring spatial geographic data of the target watershed and constructing a weighted watershed spatial association map; extracting node feature matrices based on the watershed spatial association map; inputting the node feature matrices into a graph attention network to obtain a graph-level embedding vector; acquiring real-time environmental monitoring data of the target watershed and constructing an environmental feature vector, concatenating it with the graph-level embedding vector to form a concatenated vector; inputting the concatenated vector into a fully connected layer for feature fusion and dimensionality reduction, and processing it through a nonlinear activation function to obtain a global context vector; for each historical watershed in the historical database, calculating the cosine similarity between the global context vector of the target watershed and the historical watershed; obtaining a candidate historical watershed set based on landform type, and selecting watersheds with features similar to the target watershed based on the cosine similarity. Similar historical watersheds are identified, and corresponding global context vectors and expert weight labels are used to form a support set. A weight prediction network is constructed, and offline meta-training is performed on the weight prediction network using the MAML algorithm. After training, the network initialization parameters are obtained. Based on the support set, the network initialization parameters are fine-tuned using either a few-shot adaptive mode or a zero-shot generalization mode. The global context vector of the target watershed is input into the weight prediction network with the fine-tuned parameters, and the criterion layer weight vector is output. The standardized values ​​of each evaluation index of the target watershed and the first weight coefficient of each index in its respective criterion layer, determined by the entropy weight method, are obtained. The standardized values ​​of all indicators in each criterion layer and their corresponding first weight coefficients are weighted and aggregated to obtain the standardized score of each criterion layer. The standardized scores of each criterion layer are weighted and aggregated using the criterion layer weight vector to obtain the comprehensive score of construction effectiveness.

[0007] Optionally, the spatial geographic data includes coordinates of soil and water conservation engineering points, coordinates of vegetation cover area boundaries, coordinates of pollution source distribution, and coordinates of water quality monitoring points. The watershed spatial association graph is constructed from a set of nodes, a set of edges, and a set of edge weights. The set of nodes, the set of edges, and the set of edge weights are determined through the following process: abstracting soil and water conservation engineering points, vegetation cover areas defined by boundary coordinates, pollution sources, and water quality monitoring points into nodes of a graph structure, forming a set of nodes and node feature vectors. The node feature vectors include type encoding, elevation value, slope value, and area value. Calculating the Euclidean distance between any two nodes in the set of nodes. Calculating the hydrological connectivity coefficient between nodes based on the digital elevation model of the target watershed. Calculating the edge weights connecting nodes based on preset spatial proximity influence factors and hydrological connectivity influence factors, combined with the Euclidean distance and the hydrological connectivity coefficients, wherein the spatial proximity influence factor and the hydrological connectivity influence factor are both non-negative real numbers and their sum is one.

[0008] Optionally, the graph attention network includes two graph attention layers and a readout layer connected in sequence. The step of inputting the node feature matrix into the graph attention network to obtain a graph-level embedding vector includes: in the first graph attention layer, performing a linear transformation on the node feature matrix using a learnable weight matrix; calculating the original attention scores between all node pairs, normalizing the original attention scores of all neighboring nodes of each node to obtain attention weights; weighted aggregation of neighboring node features based on the attention weights, and processing through a non-linear activation function to obtain node embedding vectors; arranging the node embedding vectors corresponding to all nodes in the node set by row to obtain a first intermediate feature matrix; mapping the first intermediate feature matrix to a second intermediate feature matrix through the second graph attention layer, with the operational logic in the first and second graph attention layers being completely consistent; and in the readout layer, performing average pooling on all node embedding vectors in the second intermediate feature matrix to obtain the graph-level embedding vector of the target watershed.

[0009] Optionally, the step of obtaining a candidate historical watershed set based on landform type and selecting historical watersheds similar to the target watershed based on cosine similarity includes: obtaining a first landform type label for the target watershed and a second landform type label for each historical watershed in the historical database; performing physical constraint filtering on all historical watersheds in the historical database, retaining historical watersheds whose second landform type label matches the first landform type label, thus obtaining a candidate historical watershed set; and selecting historical watersheds similar to the target watershed based on cosine similarity from the candidate historical watershed set, wherein the cosine similarity of the selected historical watersheds is greater than a preset adaptive similarity threshold.

[0010] Optionally, the weight prediction network is a fully connected neural network, which includes an input layer, two hidden layers, and an output layer connected in sequence. The input layer receives a global context vector. The first hidden layer performs a nonlinear transformation on the global context vector using 128 neurons and a modified linear unit activation function to obtain a first hidden layer output feature vector. The second hidden layer performs a nonlinear transformation on the first hidden layer output feature vector using 32 neurons and a modified linear unit activation function to obtain a second hidden layer output feature vector. The output layer maps and normalizes the second hidden layer output feature vector using 4 neurons and a normalized exponential function activation function to obtain a criterion layer weight vector. The criterion layer weight vector includes weight coefficients for soil and water conservation criterion layer, non-point source pollution control criterion layer, human settlement environment improvement criterion layer, and socio-economic sustainable development criterion layer.

[0011] Optionally, the offline meta-training of the weight prediction network using the MAML algorithm, and the resulting network initialization parameters, include: constructing a training sample set using sample data from historical watersheds, where each historical watershed's sample data includes its global context vector and corresponding expert weight labels, with the expert weight labels corresponding to the weight coefficients of the soil and water conservation criteria layer, non-point source pollution control criteria layer, human settlement environment improvement criteria layer, and socio-economic sustainable development criteria layer; treating each historical watershed as an independent learning task, sampling a batch of tasks from all learning tasks in each training iteration, and for each learning task, using the current meta-parameters as initial values, inputting the global context vector of the corresponding historical watershed, and using the expert weight labels as supervision signals, and inputting the global context vector into the weight prediction network. The network first obtains a predicted weight vector through forward propagation. Based on the predicted weight vector and the expert weight labels, a task loss value is calculated using the mean squared error loss function. The current parameters are then updated using gradient descent based on the task loss value to obtain the task parameters corresponding to the learning task. After completing the inner loop update of a batch of tasks, for each learning task, the corresponding task-specific parameters are applied, and the global context vector of the historical watershed is input into the weight prediction network again for forward propagation to obtain a meta-optimized predicted weight vector. Based on the meta-optimized predicted weight vector and the expert weight labels, a meta-loss value is calculated using the mean squared error loss function. The current meta-parameters are then updated using gradient descent based on the sum of the meta-loss values ​​of all learning tasks in a batch of tasks to obtain the updated meta-parameters. The training iteration is repeated until the preset training termination condition is met to obtain the network initialization parameters.

[0012] Optionally, the step of fine-tuning the network initialization parameters based on the support set by selecting either a few-shot adaptive mode or a zero-shot generalization mode, inputting the global context vector of the target watershed into the weight prediction network applying the fine-tuned parameters, and outputting the criterion layer weight vector includes: if the support set is not empty, then using the network initialization parameters as initial values, performing gradient descent fine-tuning on the weight prediction network through the global context vectors of similar historical watersheds in the support set and their expert weight labels to obtain fine-tuning parameters, inputting the global context vector of the target watershed into the weight prediction network applying the fine-tuned parameters, and outputting the criterion layer weight vector of the target watershed through forward propagation; if the support set is empty, then not performing parameter fine-tuning, directly inputting the global context vector of the target watershed into the weight prediction network applying the network initialization parameters, and outputting the criterion layer weight vector of the target watershed through forward propagation.

[0013] Secondly, embodiments of this application provide an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements the steps in the above-mentioned method for evaluating the effectiveness of ecological clean small watershed construction based on dynamic adaptive weights.

[0014] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the above-described method for evaluating the effectiveness of ecological clean small watershed construction based on dynamic adaptive weights.

[0015] The beneficial effects of the technical solutions provided in this application include at least the following: This application provides a method for evaluating the effectiveness of ecological clean watershed construction based on dynamic adaptive weights. It acquires spatial geographic data of the target watershed and constructs a weighted watershed spatial correlation map. This map physically reflects the diffusion path of pollutants with water flow, solving the problem of traditional graph construction methods neglecting the characteristics of watershed water flow paths. The method extracts node feature matrices from the watershed spatial correlation map and inputs these matrices into a graph attention network. The multi-head attention mechanism of the graph attention network captures the nonlinear spatial dependencies between nodes, and average pooling generates a fixed-length graph-level embedding vector, effectively extracting the spatial structural features of the watershed. This addresses the problem of traditional methods treating indicators as independent variables and ignoring spatial heterogeneity. The problem involves: acquiring real-time environmental monitoring data of the target watershed and constructing an environmental feature vector, which is then concatenated with a graph-level embedding vector to form a concatenated vector; inputting the concatenated vector into a fully connected layer for feature fusion and dimensionality reduction, and processing it through a nonlinear activation function to obtain a global context vector, thus realizing a unified mathematical expression of watershed spatial geometry and environmental state information in the feature space, providing high-quality comprehensive features for subsequent similarity calculation and weight prediction; for each historical watershed in the historical database, calculating the cosine similarity between the global context vectors of the target watershed and the historical watershed, realizing a quantitative comparison of the joint features of spatial structure and environmental state between watersheds, providing a reliable basis for selecting similar watersheds and meta-learning weighting; and selecting based on landform type. From the candidate historical watershed set, historical watersheds with similar characteristics to the target watershed are selected based on cosine similarity. The corresponding global context vectors and expert weight labels are then combined to form a support set, effectively eliminating mismatches caused by geomorphic differences and ensuring a suitable number of similar samples are included in the subsequent fine-tuning process for different historical database sizes. A weight prediction network is constructed and offline meta-trained using the MAML algorithm, yielding network initialization parameters with rapid adaptability. Based on the support set, either a few-shot adaptive mode or a zero-shot generalization mode is selected to fine-tune the network initialization parameters. The global context vector of the target watershed is input into the weight prediction network applying the fine-tuned parameters, outputting the criterion layer weights. The vector effectively solves the problem of negative transfer of cross-basin knowledge under small sample conditions, significantly improving the evaluation accuracy in scenarios with few samples. It obtains the standardized values ​​of each evaluation indicator in the target basin and the first weight coefficient of each indicator in its respective criterion layer, determined by the entropy weight method. It then weights and aggregates the standardized values ​​of all indicators in each criterion layer with their corresponding first weight coefficients to obtain the standardized score of each criterion layer. Finally, it weights and aggregates the standardized scores of each criterion layer using the criterion layer weight vector to obtain the comprehensive score of construction effectiveness. This hierarchical weighting mechanism reflects both the inherent physical importance of the indicators and the strategic priority of each governance objective can be dynamically adjusted according to the real-time environment of the basin, making the evaluation results both objective and adaptable. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein: Figure 1 A flowchart illustrating the evaluation method for the construction effectiveness of ecologically clean small watersheds based on dynamic adaptive weights provided in this application embodiment; Figure 2 This is a schematic diagram of the hardware entity of an electronic device provided in an embodiment of this application. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0019] It should be noted that the terms "first, second, and third" used in the embodiments of this application are merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0020] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which the embodiments of this application pertain. It should also be understood that terms such as those defined in general dictionaries should be understood to have a meaning consistent with their meaning in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.

[0021] The embodiments of this application will be further described below with reference to the accompanying drawings.

[0022] In view of the existing problems in the research on the evaluation of the construction effectiveness of ecological and clean small watersheds in the field of ecological environment monitoring and evaluation technology, this application provides an evaluation method for the construction effectiveness of ecological and clean small watersheds based on dynamic adaptive weights.

[0023] The technical solution of this application is described below, starting with the method embodiments.

[0024] Please refer to Figure 1 It illustrates a flowchart of the method for evaluating the effectiveness of ecological clean small watershed construction based on dynamic adaptive weights provided in an embodiment of this application, such as... Figure 1 As shown, the method includes at least the following steps S110 to S160.

[0025] Step S110: Obtain spatial geographic data of the target watershed and construct a weighted watershed spatial association map.

[0026] In this embodiment, spatial geographic data of the target watershed is acquired through geographic information systems, remote sensing imagery, and on-site monitoring records. This includes coordinates of soil and water conservation engineering points, vegetation cover area boundaries, pollution source distribution coordinates, and water quality monitoring point coordinates. All data coordinates are uniformly transformed to the same projection coordinate system, such as the universal transverse Mercator projection coordinate system, to ensure the accuracy of subsequent calculations and analyses.

[0027] In this embodiment, a weighted watershed spatial association map is constructed based on the spatial geographic data of the target watershed. Specifically, various types of geographic entities are grouped into a node set, namely, soil and water conservation engineering points, vegetation-covered areas defined by boundary coordinate data, pollution sources, and water quality monitoring points are all treated as nodes in the map. For each node in the node set, a node feature vector is constructed, including type code, elevation value, slope value, and area or scale value. The type code is used to distinguish different entity types and can adopt a preset mapping rule. For example, soil and water conservation engineering points are coded as 1, vegetation-covered areas as 2, pollution sources as 3, and water quality monitoring points as 4. The elevation value and slope value are extracted from the digital elevation model. For areal features such as vegetation-covered areas, the area and scale values ​​are taken as their actual areas. For point features such as engineering points and monitoring points, the area and scale values ​​are taken as their scale coefficients. The elevation value, slope value, area value, and scale value are all normalized to eliminate the influence of dimensional differences on subsequent calculations.

[0028] Furthermore, the Euclidean distance between any two nodes in the node set is calculated, and the Euclidean distances between all node pairs in the entire map are normalized. Simultaneously, based on the digital elevation model of the target watershed, the hydrological connectivity coefficient between nodes is calculated. The hydrological connectivity coefficient characterizes the ease with which matter or energy can migrate from one node location to another along a surface water flow path. Specifically, an eight-direction algorithm is used to analyze the digital elevation model, determine the water flow direction for each grid, calculate the shortest confluence path length from one node's grid location to another along the water flow direction, and use the reciprocal of this length as the hydrological connectivity coefficient, which is then normalized. For nodes that are inaccessible by water flow, their hydrological connectivity coefficient is set to zero.

[0029] Furthermore, based on the preset spatial proximity influence factor and hydrological connectivity influence factor, combined with the normalized Euclidean distance and hydrological connectivity coefficient, the edge weights between connecting nodes are calculated. Both the spatial proximity influence factor and the hydrological connectivity influence factor are preset non-negative real numbers, and their sum is one. The formula for calculating the edge weights is as follows: In the formula, Represents a node With nodes Edge weights between them; and The calculation method uses spatial proximity and hydrological connectivity factors to assign greater edge weights to node pairs that are spatially closer and have stronger hydrological connectivity. This comprehensively reflects the spatial proximity effect and the connection of hydrological processes. The specific values ​​of the spatial proximity and hydrological connectivity factors can be adjusted according to the watershed topographic features. For example, in steep areas, the spatial proximity factor can be set greater than the hydrological connectivity factor, while in flat areas, the hydrological connectivity factor can be set even greater. The technical solution provided in this application introduces a DEM-based hydrological connectivity coefficient on top of the conventional Euclidean distance when constructing the edge weights of the graph structure. This allows the generated graph structure to physically reflect the diffusion path of pollutants with water flow, rather than simply spatial proximity relationships.

[0030] Finally, based on the set of nodes, the set of edges consisting of connections between nodes, and the set of weights consisting of the weights of each edge, a weighted spatial association graph G = (V, E, W) of the target watershed can be constructed. graph ), where V is the set of nodes, E is the set of edges, and W is the set of edges. graph The set of edge weights is a directed graph in which the direction of the edges is consistent with the direction of water flow, i.e., from upstream nodes to downstream nodes, in order to accurately simulate the diffusion path of pollutants with water flow rather than simple spatial proximity relationships.

[0031] Step S120: Extract node feature matrix based on the watershed spatial association graph; input the node feature matrix into the graph attention network to obtain graph-level embedding vector.

[0032] In this embodiment of the application, a node feature matrix X is extracted from the watershed spatial association map. The matrix has a dimension of N×4, where N is the total number of nodes in the node set V, and 4 is the original feature dimension of each node, including type encoding, normalized elevation value, normalized slope value, and normalized area or size value.

[0033] In this embodiment, a graph attention network is constructed, comprising a first graph attention layer, a second graph attention layer, and a readout layer connected in sequence. The processing procedure of each layer is described in detail below: In the first graph attention layer, K1 attention heads are configured to map the node feature matrix X to a first intermediate feature matrix H. (1) Its dimension is N×D1, where D1 is the total dimension of the output features of the first attention layer. Specifically, for each attention head, a learnable weight matrix is ​​used to linearly transform the input node features. The weight matrix has a dimension of 4×d1, where d1 is the output feature dimension of each attention head, satisfying D1=K1×d1. For any pair of nodes (i, j) connected by an edge in the graph, the original attention score of node j to node i is calculated. The original attention scores of all neighboring nodes of node i are then subjected to Softmax normalization to obtain normalized attention weights. ,in, The weight matrix is ​​a learnable matrix; the matrix dimensions differ for different layers. For attention vectors, This represents a vector concatenation operation. Represents a node The set of neighboring nodes is then used. Further, based on normalized attention weights, the features of the neighboring nodes are weighted and aggregated, and processed by a non-linear activation function σ(·) to obtain the output embedding vector of node i under this attention head. The output embedding vectors of K1 attention heads are concatenated to obtain the output embedding vector of node i in the first graph attention layer, with a dimension of 1×D1. The above operation is performed on all nodes in the node set, and the output embedding vectors of each node are arranged row-wise to obtain the first intermediate feature matrix H. (1) .

[0034] In the second attention layer, K2 attention heads are configured to process the first intermediate feature matrix H. (1) Mapped to the second intermediate feature matrix H (2)Its dimension is N×D2, where D2 is the output feature dimension of the second graph attention layer. The operation logic of each attention head in the second graph attention layer is completely consistent with that of the first graph attention layer, including linear transformation, attention score calculation, softmax normalization, weighted aggregation, and non-linear activation. The only difference is the dimension of the input features and the dimension of the learnable parameters. In the readout layer, the second intermediate feature matrix H is processed... (2) All node embedding vectors are subjected to average pooling, aggregating variable-length node features into fixed-length graph-level vectors. This ensures that watersheds with different numbers of nodes can be uniformly represented as feature vectors of the same dimension, thus obtaining the graph-level embedding vector of the target watershed. ,in, The second intermediate feature matrix H (2) The output embedding vector corresponding to the i-th node has a dimension of 1×D2. This is a graph-level embedding vector with a dimension of 1×D2. This graph-level embedding vector encodes the spatial topology and hydrological connectivity features of the watershed.

[0035] In one specific embodiment, the first graph attention layer contains four attention heads, each mapping the input features to 8-dimensional features, which are then concatenated to obtain a 32-dimensional first intermediate feature matrix. The second graph attention layer contains one attention head, mapping the 32-dimensional features to a 128-dimensional second intermediate feature matrix. The graph-level embedding vector output by the readout layer has a dimension of 128. The nonlinear activation function σ(·) employs either the exponential linear unit activation function or the modified linear unit activation function.

[0036] Step S130: Obtain real-time environmental monitoring data of the target watershed and construct an environmental feature vector, which is then concatenated with the graph-level embedding vector to form a concatenated vector; the concatenated vector is input into a fully connected layer for feature fusion and dimensionality reduction, and processed by a nonlinear activation function to obtain a global context vector.

[0037] In this embodiment, real-time environmental monitoring data of the target watershed is acquired, and an environmental feature vector is constructed accordingly, including pH value, dissolved oxygen concentration, annual average rainfall, extreme rainfall intensity, normalized vegetation index (NDI) mean, watershed type code, and soil and water conservation measure implementation rate. Specifically, pH value and dissolved oxygen concentration are derived from measured data at water quality monitoring points; annual average rainfall and extreme rainfall intensity are derived from meteorological station observation data, with extreme rainfall intensity being the maximum daily rainfall within the statistical period; the NDI mean is derived from inversion calculations of remote sensing images; the watershed type code is coded according to the geomorphological classification standards in the "Technical Specifications for the Construction of Ecological Clean Small Watersheds," for example, 1 for loess hilly gully areas, 2 for rocky mountain areas, and 3 for low hilly areas; the soil and water conservation measure implementation rate is the ratio of the area of ​​implemented measures to the total planned implementation area. All features are normalized to eliminate the impact of dimensional differences on subsequent calculations.

[0038] Furthermore, the 128-dimensional graph-level embedding vector and the 7-dimensional environmental feature vector are concatenated along the feature dimensions to obtain a 135-dimensional concatenated vector. This concatenated vector simultaneously contains the spatial structure information and real-time environmental state information of the watershed. This concatenated vector is then input into a fully connected layer for feature fusion and dimensionality reduction, and processed using a non-linear activation function to generate the global context vector of the target watershed. Where W1 is a trainable weight matrix with a dimension of 64×135, b1 is a trainable bias vector with a dimension of 1×64, and ReLU is a modified linear unit activation function. For environmental feature vectors; For the concatenation operation, this global context vector uniformly represents the binary features of the watershed's spatial structure and environmental state. This fully connected layer compresses the 135-dimensional concatenation vector to 64 dimensions through a linear transformation and introduces nonlinearity through the ReLU activation function, enabling the subsequent weight prediction network to learn the complex interaction between spatial features and environmental features.

[0039] Step S140: For each historical watershed in the historical database, calculate the cosine similarity between the global context vector of the target watershed and the historical watershed; obtain a set of candidate historical watersheds based on landform type; select historical watersheds with similar features to the target watershed based on cosine similarity; and form a support set by combining the corresponding global context vector and expert weight labels.

[0040] In this embodiment, a historical database is pre-constructed. Specifically, historical multi-source data from multiple accepted ecological clean watersheds are collected, including spatial geographic data, environmental monitoring data, and expert evaluation data. For each historical watershed, following the same processing procedure as the target watershed, a watershed spatial association map is constructed, graph-level embedding vectors are extracted using a graph attention network, and environmental features are fused to generate a global context vector, resulting in the historical global context vector for each historical watershed. Simultaneously, for each historical watershed, multiple experts in soil and water conservation are organized to conduct multiple rounds of scoring using the Delphi method based on the watershed's real-time environmental monitoring data for that year. After consistency verification, the expert dynamic weight labels for that historical watershed are obtained, including weight coefficients for four criteria layers: soil and water conservation, non-point source pollution control, human settlement environment improvement, and socio-economic sustainable development. Finally, the historical global context vector and expert weight labels for each historical watershed are associated and stored in the historical database. The historical database stores corresponding data for K historical watersheds, where K is the total number of accepted historical watersheds. The database can be stored hierarchically according to geomorphological type to support efficient subsequent retrieval. In one specific embodiment, the historical database contains data on 47 ecologically clean small watersheds that have been accepted by a certain province from 2015 to 2023, covering three landform types: loess hilly gully area, rocky mountain area, and shallow hilly area.

[0041] Furthermore, for each historical watershed k in the historical database, k = 1, 2, ..., K, the global context vector of the target watershed is calculated. With the historical global context vector of this historical watershed The cosine similarity between them is calculated using the following formula: The cosine similarity s has a range of [-1, 1]. A value closer to 1 indicates that the two vectors are more aligned in the feature space, meaning the feature distributions of the two watersheds are more similar. Cosine similarity is insensitive to the magnitude of the vectors, focusing only on directional consistency. Therefore, it effectively measures the similarity between two watersheds in the joint feature space of spatial structure and environmental state, unaffected by the absolute value of the features. Furthermore, the similarity calculation process involves only vector dot product and norm operations, resulting in low computational complexity and an average retrieval time controllable within 50 milliseconds, meeting the real-time requirements of online evaluation.

[0042] In this embodiment, a candidate historical watershed set is obtained based on geomorphological type screening, and historical watersheds with similar characteristics to the target watershed are selected based on cosine similarity. Specifically, the first geomorphological type label of the target watershed is obtained. The geomorphological type label is determined according to the geomorphological classification standards in the "Technical Specification for Construction of Ecological Clean Small Watersheds", such as loess hilly gully area, soil and rocky mountain area, and shallow hilly area. At the same time, the second geomorphological type label of each historical watershed in the historical database is obtained. Further, physical constraint filtering is performed on all historical watersheds in the historical database. Specifically, each historical watershed in the historical database is traversed, and it is determined whether its second geomorphological type label is consistent with the first geomorphological type label of the target watershed. If they are consistent, the historical watershed is retained; if they are inconsistent, the historical watershed is removed. Historical watersheds belonging to the same geomorphological type as the target watershed are retained to form a candidate historical watershed set. This makes watersheds with the same geomorphological type more comparable in terms of hydrological processes, erosion characteristics, and ecological responses. Preliminary screening based on geomorphological type can effectively narrow the candidate range and improve the efficiency and reliability of subsequent similarity screening.

[0043] Furthermore, within the candidate historical watershed set, historical watersheds with similar characteristics to the target watershed are selected based on cosine similarity. The selection rule involves setting an adaptive similarity threshold. ,in The preset minimum similarity threshold is set to 0.75. The preset maximum similarity threshold is set to 0.95. This is a preset adjustment factor with a value of 1.0. The number of watersheds in the candidate historical watershed set is τ. This adaptive similarity threshold can be dynamically adjusted as the number of watersheds in the candidate historical watershed set increases, retaining historical watersheds in the candidate historical watershed set whose cosine similarity is greater than this adaptive similarity threshold as the screening results. The design principle of this adaptive strategy is that when the number of candidate watersheds is small, τ approaches τ. This ensures that sufficient historical samples are included in subsequent processes; when the number of candidate watersheds is large, τ approaches... To improve screening accuracy and ensure that only high-similarity, high-quality samples are selected. For example, the target watershed, the Gongchuan sub-watershed, has a loess hilly gully region. After physical constraint filtering, the candidate historical watershed set contains 20 historical watersheds, which can be calculated using the adaptive similarity threshold formula. From the candidate historical watershed set, three historical watersheds with a similarity greater than 0.75 were selected, with similarity values ​​of 0.92, 0.89, and 0.86, respectively. Finally, the global context vectors corresponding to the selected historical watersheds and their associated expert weight labels were combined to form a support set.

[0044] Step S150: Construct a weight prediction network and perform offline meta-training on the weight prediction network using the MAML algorithm. After training, obtain the network initialization parameters. Based on the support set, select either a few-shot adaptive mode or a zero-shot generalization mode to fine-tune the network initialization parameters. Input the global context vector of the target watershed into the weight prediction network with the fine-tuned parameters and output the criterion layer weight vector.

[0045] In this embodiment, a weight prediction network is constructed. This network is a fully connected neural network used to establish a mapping from the global context vector to the criterion layer weight vector. The fully connected neural network includes an input layer, a first hidden layer, a second hidden layer, and an output layer connected in sequence. Specifically, in the input layer, a global context vector with a dimension of 64 is received. In the first hidden layer, the global context vector is nonlinearly transformed using 128 neurons and a rectified linear unit (ReLU) activation function to obtain the first hidden layer output feature vector H1 with a dimension of 1×128. In the second hidden layer, the first hidden layer output feature vector H1 is nonlinearly transformed using 32 neurons and a rectified linear unit (ReLU) activation function to obtain the second hidden layer output feature vector H2 with a dimension of 1×32. In the output layer, the second hidden layer output feature vector H2 is mapped and normalized using 4 neurons and a normalized exponential function (Softmax) activation function to obtain the criterion layer weight vector W = [w1, w2, w3, w4]. Among them, w1, w2, w3, and w4 correspond to the weight coefficients of the soil and water conservation guidelines, the non-point source pollution control guidelines, the human settlement environment improvement guidelines, and the socio-economic sustainable development guidelines, respectively. The sum of the four weight coefficients is 1, and each weight value is between 0 and 1.

[0046] In this embodiment, based on sample data from all historical watersheds in the historical database, the weight prediction network is trained offline using the MAML algorithm. After training, a set of network initialization parameters with rapid adaptability is obtained. Specifically, a training sample set is constructed, which contains sample data from K historical watersheds in the historical database. The sample data for each historical watershed includes the global context vector and the corresponding expert weight label. The K historical watersheds are treated as K independent learning tasks. Each learning task takes the global context vector of the historical watershed as input and the expert weight label of the historical watershed as the supervision signal to learn the mapping from watershed features to evaluation weights. In each training iteration, a batch of tasks is randomly sampled from all learning tasks. For each learning task in the batch, an inner loop update is performed. Specifically, the current meta-parameters are used as initial values, and the global context vector of the historical watershed corresponding to the learning task is input into the weight prediction network. The predicted weight vector is obtained through forward propagation. Based on the predicted weight vector and the expert weight label of the historical watershed, the task loss value is calculated using the mean squared error loss function. The current parameter θ is updated using gradient descent based on the task loss value to obtain the task parameters corresponding to this learning task. The gradient descent update formula is as follows: Where α is the inner loop learning rate, This represents a weighted prediction network with parameter θ.

[0047] Furthermore, after completing the inner loop update for all tasks in the same batch, outer loop meta-optimization is performed. For each learning task in the batch, using its corresponding task parameters, the global context vector of the historical watershed corresponding to that learning task is input again into the weight prediction network, and the meta-optimized predicted weight vector is obtained through forward propagation. Based on the meta-optimized predicted weight vector and expert weight labels, the meta-loss value is calculated using the mean squared error loss function. The meta-loss values ​​of all tasks in the batch are summarized, and the current meta-parameters θ are updated by gradient descent based on the sum of the meta-loss values ​​to obtain the updated meta-parameters. , where β is the meta-learning rate. The iterative process of inner loop update and outer loop meta-optimization is repeated until a preset training termination condition is met, such as reaching the maximum number of iterations, or the decrease in the meta-loss value within multiple consecutive iterations being less than a preset threshold. After training, the network initialization parameters are obtained.

[0048] In this embodiment, based on the support set, either a few-shot adaptive mode or a zero-shot generalization mode is selected to fine-tune the network initialization parameters. The global context vector of the target watershed is input into the weight prediction network applying the fine-tuned parameters, and the criterion layer weight vector is output. Specifically, the network initialization parameters obtained from offline meta-training and its support set for the target watershed are loaded. Depending on whether the support set is empty, different inference modes are selected: if the support set is not empty, the few-shot adaptive mode is executed, using the network initialization parameters as initial values, and utilizing the global context vectors of similar historical watersheds in the support set and their expert weight labels, the weight prediction network is fine-tuned using gradient descent for a preset number of steps. The fine-tuning process is similar to the inner loop update in meta-training, that is, starting from the network initialization parameters, the mean squared error loss is calculated using samples in the support set, and the network parameters are updated through gradient descent to obtain the fine-tuned parameters. The number of fine-tuning steps is set to 1 to 5 steps, and the fine-tuning learning rate is set to 0.005. The global context vector of the target watershed is input into the weight prediction network applying the fine-tuned parameters, and after forward propagation, the criterion layer weight vector of the target watershed is output.

[0049] In another scenario, if the support set is empty (i.e., there are no historical watersheds in the historical database that meet the similarity criteria with the target watershed), then a zero-shot generalization mode is executed. In this mode, no parameter fine-tuning is performed; the global context vector of the target watershed is directly input into a weight prediction network whose parameters are the network's initialization parameters. After forward propagation, the criterion layer weight vector of the target watershed is output. This mode relies entirely on the generalization ability of the initialization parameters obtained through meta-learning, avoiding the negative transfer problem caused by forcibly transferring dissimilar watersheds. For example, for the Gongchuan small watershed, the criterion layer weight vector is [0.28, 0.32, 0.22, 0.18]. Compared to traditional fixed weights, this weight vector automatically increases the weight for non-point source pollution control, which is consistent with the actual situation of frequent agricultural activities in this watershed during the current season.

[0050] Step S160: Obtain the standardized values ​​of each evaluation indicator in the target watershed and the first weight coefficient of each indicator in its respective criterion layer, determined based on the entropy weight method; weight and aggregate the standardized values ​​of all indicators in each criterion layer and their corresponding first weight coefficients to obtain the standardized score of each criterion layer; weight and aggregate the standardized scores of each criterion layer through the criterion layer weight vector to obtain the comprehensive score of construction effectiveness.

[0051] In this embodiment, the standardized values ​​of each evaluation indicator in the preset evaluation index system for the target watershed are obtained. There are 15 evaluation indicators in total, grouped according to their respective criterion layers: the soil and water conservation criterion layer includes three indicators: forest and grassland coverage rate, normalized vegetation index, and area of ​​soil and water conservation; the non-point source pollution control criterion layer includes five indicators: water quality grade, pesticide application intensity, fertilizer application intensity, domestic sewage treatment rate, and large-scale livestock wastewater treatment rate; the human settlement environment improvement criterion layer includes three indicators: garbage harmless treatment rate, sanitary toilet coverage rate, and village greening and beautification rate; and the socio-economic sustainable development criterion layer includes four indicators: population density, per capita disposable income, agricultural product commodity rate, and annual cumulative number of tourists. All indicator values ​​are normalized. Simultaneously, the first weight coefficient of each indicator within its respective criterion layer, predetermined based on the entropy weight method, is obtained. This weight reflects the objective importance of each indicator. Further, a first-layer weighted aggregation is performed. For each criterion layer, the standardized score of each criterion layer is calculated by weighted summation using the standardized values ​​of its included evaluation indicators and the corresponding first weight coefficient. Furthermore, a second layer of weighted aggregation is performed. The scores of the four criteria layers are weighted and summed using dynamic weight vectors and multiplied by 100 to obtain the final comprehensive score of construction effectiveness. This score serves as a quantitative evaluation result of the construction effectiveness of the ecological clean watershed in the target watershed, with a score range between 0 and 100.

[0052] In summary, the method for evaluating the effectiveness of ecological clean small watershed construction based on dynamic adaptive weights provided in this application acquires spatial geographic data of the target watershed, constructs a weighted watershed spatial correlation graph, and this correlation graph can physically and realistically reflect the diffusion path of pollutants with water flow, solving the problem of traditional graph construction methods ignoring the characteristics of watershed water flow paths; it extracts node feature matrices based on the watershed spatial correlation graph; the node feature matrices are input into a graph attention network, and the nonlinear spatial dependencies between nodes are captured through the multi-head attention mechanism of the graph attention network, and a fixed-length graph-level embedding vector is generated through average pooling, thereby effectively extracting the spatial structure features of the watershed, solving the problem of traditional methods treating each indicator as an independent variable and ignoring... Addressing the issue of spatial heterogeneity, this study acquires real-time environmental monitoring data of the target watershed and constructs an environmental feature vector, which is then concatenated with a graph-level embedding vector to form a concatenated vector. This concatenated vector is input into a fully connected layer for feature fusion and dimensionality reduction, and processed using a nonlinear activation function to obtain a global context vector. This achieves a unified mathematical expression of watershed spatial geometry and environmental state information in the feature space, providing high-quality comprehensive features for subsequent similarity calculation and weight prediction. For each historical watershed in the historical database, the cosine similarity between the global context vectors of the target watershed and historical watersheds is calculated, enabling a quantitative comparison of the joint features of spatial structure and environmental state between watersheds. This provides a reliable basis for selecting similar watersheds and meta-learning weighting. Based on geomorphological classes... A candidate historical watershed set is obtained through pattern screening. Historical watersheds with similar characteristics to the target watershed are selected based on cosine similarity. The corresponding global context vector and expert weight labels are combined to form a support set, thereby effectively eliminating mismatches caused by topographic differences and ensuring that an appropriate number of similar samples are included in the subsequent fine-tuning process under different historical database sizes. A weight prediction network is constructed and offline meta-trained using the MAML algorithm. After training, network initialization parameters with fast adaptability are obtained. Based on the support set, the network initialization parameters are fine-tuned using either a few-shot adaptive mode or a zero-shot generalization mode. The global context vector of the target watershed is input into the weight prediction network with the fine-tuned parameters, and the criterion layer is output. The weight vector effectively solves the problem of negative transfer of cross-basin knowledge under small sample conditions, significantly improving the evaluation accuracy in scenarios with few samples. It obtains the standardized values ​​of each evaluation indicator in the target basin and the first weight coefficient of each indicator in its respective criterion layer, determined by the entropy weight method. The standardized values ​​of all indicators in each criterion layer and their corresponding first weight coefficients are weighted and aggregated to obtain the standardized score of each criterion layer. The standardized scores of each criterion layer are weighted and aggregated through the criterion layer weight vector to obtain the comprehensive score of construction effectiveness. Through this hierarchical weighting mechanism, it not only reflects the inherent physical importance of the indicators, but also dynamically adjusts the strategic priority of each governance objective according to the real-time environment of the basin, making the evaluation results both objective and adaptable.

[0053] It should be noted that, in the embodiments of this application, if the above-mentioned method for optimizing whole grain food formulations based on a multi-objective genetic algorithm is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a magnetic disk, or an optical disk. Thus, the embodiments of this application are not limited to any specific hardware and software combination.

[0054] Correspondingly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the steps in any of the above embodiments of the whole-grain food formulation optimization method based on a multi-objective genetic algorithm. Correspondingly, embodiments of this application also provide a computer program product, which, when executed by a processor of an electronic device, is used to implement the steps in any of the above embodiments of the whole-grain food formulation optimization method based on a multi-objective genetic algorithm.

[0055] Based on the same technical concept, this application provides an electronic device for implementing a whole grain food formulation optimization method based on a multi-objective genetic algorithm as described in the above method embodiments. Figure 2 This is a hardware entity diagram of an electronic device provided in an embodiment of this application, such as... Figure 2 As shown, the electronic device 200 includes a memory 210 and a processor 220. The memory 210 stores a computer program that can run on the processor 220. When the processor 220 executes the program, it implements the steps in any of the whole grain food formulation optimization methods based on multi-objective genetic algorithms described in the embodiments of this application.

[0056] The memory 210 is configured to store instructions and applications executable by the processor 220, and can also cache data to be processed or already processed by the processor 220 and various modules in the electronic device (e.g., image data, audio data, voice communication data and video communication data), which can be implemented by flash memory or random access memory (RAM).

[0057] When processor 220 executes a program, it implements the steps of a whole-grain food formulation optimization method based on a multi-objective genetic algorithm, as described above. Processor 220 typically controls the overall operation of electronic device 200.

[0058] The aforementioned processor can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor. It is understood that other electronic devices can also implement the functions of the aforementioned processor, and this application does not specifically limit the specific implementation.

[0059] The aforementioned computer storage media / memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it can be various electronic devices that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0060] It should be noted that the descriptions of the storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0061] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0062] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0063] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0064] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of the embodiments of this application, depending on actual needs.

[0065] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0066] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause the device automatic test line to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0067] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0068] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0069] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for evaluating the effectiveness of ecological clean small watershed construction based on dynamic adaptive weights, characterized in that, The method includes: Acquire spatial geographic data of the target watershed and construct a weighted spatial relationship map of the watershed; Node feature matrices are extracted based on the watershed spatial association graph; the node feature matrices are then input into a graph attention network to obtain graph-level embedding vectors. Real-time environmental monitoring data of the target watershed is acquired and an environmental feature vector is constructed. This vector is then concatenated with the graph-level embedding vector to form a concatenated vector. The concatenated vector is input into a fully connected layer for feature fusion and dimensionality reduction, and then processed by a nonlinear activation function to obtain a global context vector. For each historical watershed in the historical database, the cosine similarity between the target watershed and the global context vector of the historical watershed is calculated; a candidate historical watershed set is obtained based on landform type; historical watersheds with similar features to the target watershed are selected based on cosine similarity; and the corresponding global context vectors and expert weight labels are combined to form a support set. A weight prediction network is constructed, and the weight prediction network is trained offline using the MAML algorithm. After training, the network initialization parameters are obtained. Based on the support set, the network initialization parameters are fine-tuned by selecting either a few-shot adaptive mode or a zero-shot generalization mode. The global context vector of the target watershed is input into the weight prediction network with the fine-tuned parameters, and the criterion layer weight vector is output. Obtain the standardized values ​​of each evaluation indicator in the target watershed and the first weight coefficient of each indicator in its respective criterion layer, determined by the entropy weight method; weight and aggregate the standardized values ​​of all indicators in each criterion layer with their corresponding first weight coefficients to obtain the standardized score of each criterion layer; weight and aggregate the standardized scores of each criterion layer through the criterion layer weight vector to obtain the comprehensive score of construction effectiveness.

2. The method according to claim 1, characterized in that, The spatial geographic data includes coordinates of soil and water conservation engineering points, coordinates of vegetation cover area boundaries, coordinates of pollution source distribution, and coordinates of water quality monitoring points; the watershed spatial correlation graph is constructed from a set of nodes, a set of edges, and a set of edge weights, which are determined through the following process: The soil and water conservation engineering points, vegetation coverage areas defined by boundary coordinates, pollution sources and water quality monitoring points are abstracted as nodes in a graph structure, forming a node set and node feature vectors. The node feature vectors include type encoding, elevation value, slope value and area value. Calculate the Euclidean distance between any two nodes in the node set; calculate the hydrological connectivity coefficient between nodes based on the digital elevation model of the target watershed; Based on the preset spatial proximity influence factor and hydrological connectivity influence factor, and combined with the Euclidean distance and the hydrological connectivity coefficient, the edge weights between connecting nodes are calculated, wherein the spatial proximity influence factor and the hydrological connectivity influence factor are both non-negative real numbers and their sum is one.

3. The method according to claim 2, characterized in that, The graph attention network comprises two graph attention layers and a readout layer connected in sequence. The step of inputting the node feature matrix into the graph attention network to obtain a graph-level embedding vector includes: In the first attention layer, the node feature matrix is ​​linearly transformed using a learnable weight matrix; the original attention scores between all node pairs are calculated, and the original attention scores of all neighboring nodes of each node are normalized to obtain attention weights; the neighboring node features are weighted and aggregated based on the attention weights, and processed by a non-linear activation function to obtain node embedding vectors; the node embedding vectors corresponding to all nodes in the node set are arranged in rows to obtain the first intermediate feature matrix. The first intermediate feature matrix is ​​mapped to the second intermediate feature matrix through the second graph attention layer, and the operation logic in the first graph attention layer and the second graph attention layer is completely consistent. In the readout layer, all node embedding vectors in the second intermediate feature matrix are averaged and pooled to obtain the graph-level embedding vector of the target watershed.

4. The method according to claim 1, characterized in that, The candidate historical watershed set obtained based on landform type is further selected by using cosine similarity to identify historical watersheds with similar characteristics to the target watershed, including: Obtain the first geomorphic type label of the target watershed, and the second geomorphic type label of each historical watershed in the historical database; Physical constraint filtering is performed on all historical watersheds in the historical database, and historical watersheds whose second landform type label is consistent with the first landform type label are retained to obtain a candidate historical watershed set. In the candidate historical watershed set, historical watersheds with similar characteristics to the target watershed are selected based on cosine similarity, and the cosine similarity of the selected historical watersheds is greater than a preset adaptive similarity threshold.

5. The method according to claim 1, characterized in that, The weight prediction network is a fully connected neural network, which includes an input layer, two hidden layers, and an output layer connected in sequence, wherein: The input layer is used to receive the global context vector; The first hidden layer is used to perform nonlinear transformation processing on the global context vector through 128 neurons and a modified linear unit activation function to obtain the output feature vector of the first hidden layer. The second hidden layer is used to perform nonlinear transformation on the output feature vector of the first hidden layer through 32 neurons and a modified linear unit activation function to obtain the output feature vector of the second hidden layer. The output layer is used to map and normalize the output feature vector of the second hidden layer through four neurons and a normalized exponential activation function to obtain the criterion layer weight vector. The criterion layer weight vector includes the weight coefficients of the soil and water conservation criterion layer, the non-point source pollution control criterion layer, the human settlement environment improvement criterion layer, and the socio-economic sustainable development criterion layer.

6. The method according to claim 5, characterized in that, The weight prediction network is trained offline using the MAML algorithm. After training, the network initialization parameters are obtained, including: A training sample set is constructed using sample data from historical watersheds. The sample data for each historical watershed includes the global context vector of that historical watershed and the corresponding expert weight label. The expert weight label corresponds to the weight coefficients of the soil and water conservation criteria layer, the non-point source pollution control criteria layer, the human settlement environment improvement criteria layer, and the socio-economic sustainable development criteria layer. Each historical watershed is treated as an independent learning task. In each training iteration, a batch of tasks is sampled from all learning tasks. For each learning task, the current meta-parameters are used as initial values, the global context vector of the corresponding historical watershed is used as input, and the expert weight labels are used as supervision signals. The global context vector is input into the weight prediction network, and the predicted weight vector is obtained through forward propagation. Based on the predicted weight vector and the expert weight labels, the task loss value is calculated using the mean squared error loss function. The current parameters are updated by gradient descent based on the task loss value to obtain the task parameters corresponding to the learning task. After completing the inner loop update of a batch of tasks, for each learning task, the corresponding task-specific parameters are applied, and the global context vector of the historical watershed is input into the weight prediction network again for forward propagation to obtain the meta-optimized prediction weight vector. Based on the meta-optimized prediction weight vector and the expert weight label, the meta-loss value is calculated through the mean squared error loss function. The current meta-parameters are updated by gradient descent according to the sum of the meta-loss values ​​of all learning tasks in a batch of tasks to obtain the updated meta-parameters. Repeat the training iterations until the preset training termination condition is met to obtain the network initialization parameters.

7. The method according to claim 6, characterized in that, Based on the support set, the network initialization parameters are fine-tuned by selecting either a few-shot adaptive mode or a zero-shot generalization mode. The global context vector of the target watershed is input into the weight prediction network applying the fine-tuned parameters, and the criterion layer weight vector is output, including: If the support set is not empty, the network initialization parameters are used as the initial values. The weight prediction network is fine-tuned by gradient descent using the global context vectors of similar historical watersheds in the support set and their expert weight labels to obtain the fine-tuning parameters. The global context vector of the target watershed is input into the weight prediction network with the fine-tuning parameters applied, and the criterion layer weight vector of the target watershed is output through forward propagation. If the support set is empty, no parameter fine-tuning is performed. Instead, the global context vector of the target watershed is directly input into the weight prediction network that initializes the application network parameters, and the criterion layer weight vector of the target watershed is output through forward propagation.

8. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 7.