Potential feature quantification method based on global and local self-attention

By combining the collaborative filtering algorithm of global and local self-attention graph models, the attention convolution neural network is optimized and the potential characteristics of soil heavy metal pollution influence factors are extracted, which solves the limitations of traditional methods in processing high-dimensional data and mining complex patterns, and improves the understanding of interactions between pollution factors and the prediction accuracy of soil heavy metal content.

CN119598160APending Publication Date: 2025-03-11HUNAN INST OF AGRI ENVIRONMENT & ECOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411646602.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

Traditional methods have limitations in dealing with high-dimensional data on soil heavy metal pollution and mining potential complex patterns, making it difficult to fully understand the various influencing factors of soil pollution.

Method used

Combining the global and local self-attention graph models in deep learning, a new collaborative filtering algorithm is developed. Through optimization training of global spatial graph attention convolution neural networks and local attribute relationship graph attention convolution neural networks, potential features affecting heavy metal concentration are extracted.

Benefits of technology

This method can more accurately quantify the interactions between multiple influencing factors, reveal implicit associations that are difficult to detect by traditional means, and improve the prediction accuracy of soil heavy metal content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598160A_ABST
    Figure CN119598160A_ABST
Patent Text Reader

Abstract

The invention discloses a potential characteristic quantification method based on global and local self-attention. The method mainly comprises the following steps: acquiring the soil heavy metal concentration of each sampling point; acquiring precipitation and river density of each sample; performing optimization training on the global space graph attention convolutional neural network and the local attribute relation graph attention convolutional neural network by using the precipitation, the river density and the soil heavy metal concentration of each sample; and according to the optimized global space graph attention convolutional neural network and the optimized local attribute relation graph attention convolutional neural network, extracting potential features influencing the heavy metal concentration. According to the method, the local attribute relation graph attention convolutional neural network and the global space graph attention convolutional neural network are optimized based on the potential features, and the potential features influencing the soil heavy metal content are extracted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of deep learning, and specifically relates to a potential feature quantification method based on global and local self-attention, which is suitable for analyzing the main influencing factors of soil heavy metal pollution. Background Art

[0002] With the accelerated development of industrialization and changes in agricultural production methods, heavy metal pollution in soil has become a serious environmental problem facing the world. Once heavy metals enter the soil, they are not only difficult to degrade, but can also accumulate through the food chain, ultimately threatening human health. Therefore, identifying the influencing factors of heavy metal pollution in soil is crucial for formulating effective pollution prevention and control strategies. Traditional research on heavy metal pollution in soil mainly relies on geographic information systems combined with statistical methods to analyze influencing factors. Although this method is effective, it has limitations in processing high-dimensional data and mining potential complex patterns. In recent years, with the development of deep learning technology and its successful application in many fields, it has become possible to explore the use of deep learning technology to analyze the influencing factors of heavy metal pollution in soil.

[0003] Among various deep learning models, the self-attention mechanism has attracted widespread attention due to its ability to capture spatial dependencies in input data. As an implementation of this mechanism, self-attention maps have shown strong capabilities in processing unstructured data. However, using global or local attention alone may not be sufficient to fully understand the various influencing factors of soil contamination. Therefore, a method combining global and local self-attention is proposed to more accurately quantify the potential characteristics of soil contamination.

[0004] This study aims to develop a new collaborative filtering algorithm by combining the global and local self-attention graph models in deep learning to deeply analyze the main influencing factors of soil heavy metal pollution. By quantifying the interactions between multiple influencing factors, this method is expected to reveal implicit associations that are difficult to discover with traditional methods, thus providing a scientific basis for the treatment of soil heavy metal pollution. Summary of the invention

[0005] The purpose of the present invention is to provide a potential feature quantization method based on global and local self-attention to address the above-mentioned problems in the prior art.

[0006] The above-mentioned purpose of the present invention is achieved by the following technical means:

[0007] A latent feature quantization method based on global and local self-attention, the steps are as follows:

[0008] Step 1: Obtain the soil heavy metal concentration at each sampling point;

[0009] Step 2: Obtain the precipitation and river density at each sampling point;

[0010] Step 3: Use the precipitation, river density, and soil heavy metal concentration of each sampling point to optimize the training of the global spatial graph attention convolutional neural network and the local attribute relationship graph attention convolutional neural network;

[0011] Step 4: Extract potential features that affect heavy metal concentrations based on the optimized global spatial graph attention convolutional neural network and the optimized local attribute relationship graph attention convolutional neural network.

[0012] As mentioned above, step 3 includes the following steps:

[0013] Step 3.1: Preprocess the heavy metal concentrations and environmental factors at the sampling points;

[0014] Step 3.2, inputting the heavy metal concentration and environmental factors of each sampling point into the global spatial graph attention convolutional neural network, the global spatial graph attention convolutional neural network includes a plurality of serially processed global spatial graph attention convolutional neural network layers, each layer of the global spatial graph attention convolutional neural network layer outputs the corresponding global target data set;

[0015] Step 3.3: Input the heavy metal concentration and environmental factors of each sampling point into the local attribute relationship graph attention convolutional neural network, the local attribute relationship graph attention convolutional neural network includes multiple serially processed local attribute relationship graph attention convolutional neural network layers, and each layer of the local attribute relationship graph attention convolutional neural network layer outputs the corresponding local target data set;

[0016] Step 3.4: Calculate the final dataset based on the global target dataset output by each layer of the global spatial graph attention convolutional neural network layer and the local target dataset output by each layer of the local attribute relationship graph attention convolutional neural network layer

[0017] Step 3.5: Final dataset The input is fed into a multi-layer perceptron, which outputs the predicted value of soil heavy metal concentration and optimizes it based on minimizing the loss function.

[0018] As mentioned above, the preprocessing in step 3.1 is normalization processing.

[0019] The global target dataset output by the global spatial graph attention convolutional neural network layer is based on the following formula:

[0020] h′={F′1,F′2,...,F...,F′ N}

[0021] Where h′ is the global target dataset output by the global spatial graph attention convolutional neural network layer. The global target dataset includes the feature data of N sampling points.

[0022]

[0023] In the formula, F i ′ is the characteristic data of the i-th sampling point, N ci is the total number of sampling points that are similar to sampling point i, c is the serial number of the sampling point that is similar to a single sampling point i, || is the concatenation operation, W1 is the learnable weight, σ is the activation function,

[0024]

[0025] In the formula, α ij is the importance of distance between sampling point i and sampling point j, is a single-layer feed-forward neural network with an attention mechanism, LeakyReLU is the activation function, and N ki is the total number of sampling points that are spatially connected to a single sampling point i, || is the concatenation operation, k is the serial number of the sampling point that is spatially connected to a single sampling point i, W a1 is the attention weight;

[0026] e ij =a(W a1 F i ,W a1 F j )

[0027] In the formula, e ij represents the importance of distance between sampling point i and sampling point j, W a1 is the attention weight, M′ is the number of dimensions, a is the matrix multiplication operation, and F i is the characteristic data of the i-th sampling point;

[0028]

[0029] Where, SG ij Represents the distance relationship between sampling point i and sampling point j, d() is the Euclidean space distance algorithm, i, j∈1~N, LON is the longitude of the sampling point location, LAT is the latitude of the sampling point location, LON i ,LAT i is the longitude and latitude of the i-th sampling point, LON j ,LAT j is the longitude and latitude of the jth sampling point.

[0030] The local target dataset corresponding to the output of the local attribute relationship graph attention convolutional neural network layer is based on the following formula:

[0031] h″={F1″′,F″′2,...,F″′ N}

[0032] Where h″ is the local target dataset output by the local attribute relationship graph attention convolutional neural network layer. The local target dataset includes the feature data of N sampling points. The dimensions of the feature data of each sampling point include soil heavy metal concentration, precipitation, and river density.

[0033]

[0034] In the formula, F i ′ is the characteristic data of the i-th sampling point, N ci is the total number of sampling points that are similar to sampling point i, c is the serial number of the sampling point that is similar to a single sampling point i, || is the concatenation operation, W1 is the learnable weight, and σ is the activation function;

[0035]

[0036] In the formula, α ij is the importance of distance between sampling point i and sampling point j, is a single-layer feed-forward neural network with an attention mechanism, LeakyReLU is the activation function, and N ki is the total number of sampling points that are spatially connected to a single sampling point i, || is the concatenation operation, k is the serial number of the sampling point that is spatially connected to a single sampling point i, W a1 is the attention weight,

[0037] e ij =a(W a1 F i ,W a1 F j )

[0038] In the formula, e ij represents the importance of distance between sampling point i and sampling point j, W a1 is the attention weight, a is the matrix dot multiplication operation, F i is the characteristic data of the i-th sampling point;

[0039] SG ij =d((LON i ,LAT i ),(LON j ,LAT j ))

[0040] Where, SGij Represents the distance relationship between sampling point i and sampling point j, d() is the Euclidean space distance algorithm, i, j∈1~N, LON is the longitude of the sampling point location, LAT is the latitude of the sampling point location, LON i ,LAT i is the longitude and latitude of the i-th sampling point, LON j ,LAT j is the longitude and latitude of the jth sampling point;

[0041] The final dataset is as described above Calculated based on the following formula:

[0042]

[0043] h p =h″ (1) +h″ (2) +...+h″ (L)

[0044] h s =h′ (1) +h′ (2) +...+h′ (L)

[0045] In the formula, h s represents the merged features based on global spatial graph attention, L represents the number of layers, and h ( ' 1) ~h ( ' L) is the global target dataset corresponding to the 1st layer of global spatial graph attention convolutional neural network layer ~ the Lth layer of global spatial graph attention convolutional neural network layer, h p represents the result merging based on the attention of the local attribute relationship graph, L represents the number of layers, and h ( '1' ) ~h ( ' L ' ) It is the local target data set corresponding to the 1st local attribute relationship graph attention convolutional neural network layer to the Lth local attribute relationship graph attention convolutional neural network layer.

[0046] As mentioned above, the multilayer perceptron is based on the following formula:

[0047] Y p =g(x·w+b)

[0048] Where Y p is the predicted value of soil heavy metal concentration, and x is the final data set The feature data corresponding to the precipitation dimension, river density dimension, and potential feature dimension, w is the learnable weight, b is the bias,

[0049] The loss function Loss is:

[0050]

[0051] Where Y t is the true value of soil heavy metal concentration, Y p is the predicted value of soil heavy metal concentration, and N is the number of sampling points.

[0052] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the prediction method according to any one of claims 1 to 7 when executing the computer program.

[0053] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the prediction method according to any one of claims 1 to 7.

[0054] A computer program product comprises a computer program, which, when executed by a processor, implements the steps of the prediction method according to any one of claims 1 to 7.

[0055] Compared with the prior art, the present invention has the following beneficial effects:

[0056] 1. The present invention creatively develops a collaborative filtering method based on global and local self-attention, and quantifies the potential features generated by the combined influence of multiple factors.

[0057] 2. Based on the data of soil heavy metals, precipitation and river density, the rationality of the present invention was tested, and the relationship between the potential characteristics and the main factors was deeply analyzed, which provided ideas for further analyzing the interaction mechanism between the factors. The local attribute relationship graph attention convolutional neural network and the global spatial graph attention convolutional neural network were optimized based on the potential characteristics to improve the prediction accuracy of soil heavy metal content. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is a schematic diagram of the process of the present invention.

[0059] Figure 2 It is the relationship diagram between the latent feature Z (SCD-Z) and its related independent variables X1 and X2 under global conditions, where Rain represents precipitation and RiverDen represents river density.

[0060] Figure 3 This is the relationship diagram between the potential characteristic Z and the dependent variable (soil heavy metal content SCD) under global conditions.

[0061] Figure 4It is a relationship diagram between the feature data of the potential feature dimension, independent variable dimension, and dependent variable dimension of the global target dataset of sampling point a, sampling point b, sampling point c, and sampling point d in the global target dataset.

[0062] Figure 5 It is a relationship diagram between the feature data of the potential feature dimension, independent variable dimension, and dependent variable dimension of the local target data set of sampling point a, sampling point b, sampling point c, and sampling point d in the local target data set. DETAILED DESCRIPTION

[0063] In order to facilitate those skilled in the art to understand and use the present invention, the present invention is further described in detail below in conjunction with embodiments. The embodiments described herein are only used to illustrate and explain the present invention and are not intended to limit the present invention.

[0064] Embodiment 1:

[0065] A potential feature quantification method based on global and local self-attention collects the concentration of heavy metals in farmland soil (cadmium Cd in this example) and the closely related environmental factors (precipitation and river density) to verify the feasibility of the method. The specific implementation steps are as follows:

[0066] Step 1: Read the soil heavy metal concentration at each sampling point;

[0067] Sampling points were arranged according to the random point arrangement method, and soil samples were collected using the 5-point sampling method to detect the concentration of heavy metals in the soil (Cd concentration in this embodiment).

[0068] Specific description: In this example, a total of 189 sampling points were set up by random point distribution method, and the location of the sampling points (including longitude LON and latitude LAT) was recorded by portable global positioning system GPS. The sampling area of ​​each sampling point was a square range with a side length of 2m. During collection, the sampling area was cleaned first, and then the surface soil (0-20cm) of the sampling area was dug out with a wooden shovel. Five places were evenly selected in the sampling area, and five surface soil samples were collected and fully mixed. About 1 kg of mixed surface soil samples were taken and placed in a polyethylene bag for storage. The surface soil samples were air-dried in a dust-free environment, impurities were removed, ground into powder, and passed through a 100-mesh nylon sieve for testing. The heavy metal concentration in the surface soil sample was determined by inductively coupled plasma mass spectrometry (ICP-MS) (Cd concentration was measured in this embodiment).

[0069] Step 2, obtaining the precipitation and river density of each sample;

[0070] Collection of environmental factors: In this example, the environmental factors collected for each sampling point mainly include precipitation and river density in the study area.

[0071] Specific description: As an implementable solution, the precipitation (annual precipitation) data of each sampling point comes from the National Tibetan Plateau Science Data Center Platform (https: / / data.tpdc.ac.cn), and the river data of each sampling point comes from the National Geographic Information Resource Catalog Service System (Beijing China, National Catalogue Service For Geographic Information: https: / / www.webmap.cn), 1:250,000 National Basic Geographic Database. The river density of each sampling point was calculated using ArcGIS10.2 (Esri, USA, 2013) software.

[0072] Step 3: Model calculation. In this example, the dependent variable is soil heavy metal concentration, the independent variables are precipitation and river density, and the result is the potential characteristics generated by the interaction between precipitation and river density. The specific process is as follows:

[0073] Step 3.1: Pre-process the heavy metal concentrations and environmental factors at the sampling points.

[0074] Specific description: The data preprocessing process mainly involves minimum-maximum normalization of the data to ensure the uniformity of the data range, which is conducive to the model to obtain accurate results.

[0075] Step 3.2: Input the heavy metal concentration and environmental factors of each sampling point into the global spatial graph attention convolutional neural network. The global spatial graph attention convolutional neural network includes multiple serially processed global spatial graph attention convolutional neural network layers. The global target data set is extracted based on the global spatial graph attention convolutional neural network. The global target data set includes the feature data of N sampling points output by each global spatial graph attention convolutional neural network layer. The dimensions of the feature data of each sampling point include soil heavy metal concentration, precipitation, and river density.

[0076] Specific description: Soil heavy metal concentration is the dependent variable Y, which has Euclidean spatial properties and is represented by plane coordinates longitude LON and latitude LAT; precipitation and river density are represented by X1 and X2 as independent variables respectively. Starting from the spatial relationship, the relationship between the independent variables X1, X2 and Y in the spatial position is extracted, and the local similarities that they may show in space are paid attention to.

[0077]

[0078] Where h is the feature data set of the sampling point, which includes the feature data of N sampling points, and F i is the characteristic data of the i-th sampling point, is the dimension, F1~F NThe characteristic data of the 1st sampling point to the characteristic data of the Nth sampling point, this embodiment includes N=189 sampling points, and the data of each sampling point includes M=3 attributes (dimensions), M is the total number of attributes, respectively Y (soil heavy metal concentration), X1 (precipitation), X2 (river density). For the first layer of global spatial graph attention convolutional neural network layer, the characteristic data of the i-th sampling point is the soil heavy metal concentration, precipitation and river density of the i-th sampling point, and the characteristic data of the i-th sampling point of the non-first layer of global spatial graph attention convolutional neural network layer is the characteristic data of the i-th sampling point output by the previous layer of global spatial graph attention convolutional neural network layer.

[0079]

[0080] Where, SG ij Represents the distance relationship between sampling point i and sampling point j, d() is the Euclidean space distance algorithm, i, j∈1~N, LON is the longitude of the sampling point location, LAT is the latitude of the sampling point location, LON i ,LAT i is the longitude and latitude of the i-th sampling point, LON j ,LAT j are the longitude and latitude of the jth sampling point.

[0081] The graph attention process is as follows,

[0082] e ij =a(W a1 F i ,W a1 F j )

[0083] In the formula, e ij represents the importance of distance between sampling point i and sampling point j, is the learnable attention weight, M′ is the number of dimensions, a is the matrix dot multiplication operation mode.

[0084]

[0085] In the formula, α ij is the importance of distance between sampling point i and sampling point j, is a single-layer feed-forward neural network with an attention mechanism, parameterized by a weight vector, LeakyReLU is the activation function, N ki is the total number of sampling points that are spatially connected to a single sampling point i, || is the concatenation operation, k is the serial number of the sampling point that is spatially connected to a single sampling point i, and F j and F k is the characteristic data of the jth and kth sampling points, are learnable attention weights.

[0086]

[0087] In the formula, F i ′ is the characteristic data of the i-th sampling point, N ci is the total number of sampling points that are similar to sampling point i, c is the serial number of the sampling point that is similar to a single sampling point i, || is the concatenation operation, W1 is the learnable weight of the process, σ is the activation function, F c is the characteristic data of the cth sampling point, SG ic is the distance relationship between sampling point i and sampling point c, α ic is the distance-based importance between sampling point i and sampling point c.

[0088]

[0089] Where h′ is the feature data of each sampling point obtained by the global spatial graph attention convolutional neural network layer, and is recorded as the global target dataset output by the global spatial graph attention convolutional neural network layer. The global target dataset includes the feature data of N sampling points, and the dimensions of the feature data of each sampling point include soil heavy metal concentration, precipitation, and river density.

[0090] The global target datasets corresponding to the 1st global spatial graph attention convolutional neural network layer to the Lth global spatial graph attention convolutional neural network layer are denoted as h ( ' 1) ~h ( ' L) .

[0091] Step 3.3, estimate the potential features based on the local attribute relationship graph (dependent variable-independent variable-potential feature) attention convolutional neural network layer; input the heavy metal concentration and environmental factors of each sampling point into the local attribute relationship graph attention convolutional neural network, the local attribute relationship graph attention convolutional neural network includes multiple local attribute relationship graph attention convolutional neural network layers processed in series, extract the local target data set based on the local attribute relationship graph attention convolutional neural network, the local target data set includes the feature data of N sampling points output by each local attribute relationship graph attention convolutional neural network layer, and the dimensions of the feature data of each sampling point include soil heavy metal concentration, precipitation, and river density.

[0092] Specific description: The present invention designs a local attribute relationship graph-based attention convolutional neural network layer to learn the relationship between the potential feature Z and the known independent variables X1 (precipitation) and X2 (river density). It should be noted that the initial relationship between the dependent variable Y and the independent variables X1 (precipitation) and X2 (river density) is replaced by the Spearman correlation coefficient between the data in this example. The initial relationship coefficient between the potential feature Z and the independent variables (X1, X2) is set to 0.5, and the initial relationship coefficient between the dependent variable Y and the potential feature Z is set to 0.5.

[0093]

[0094] Where h is the feature data set of the sampling point, which includes the feature data of N sampling points, and F i is the characteristic data of the i-th sampling point, is the dimension, F1~F N The characteristic data of the data from the 1st sampling point to the Nth sampling point, this embodiment includes N=189 sampling points, and the characteristic data of each sampling point includes M=3 attributes, where M is the total number of attributes, namely Y (soil heavy metal concentration), X1 (precipitation), and X2 (river density). For the first layer of the local attribute relationship graph attention convolutional neural network layer, the characteristic data of the i-th sampling point are the soil heavy metal concentration, precipitation, and river density of the i-th sampling point, and the characteristic data of the i-th sampling point of the non-first layer local attribute relationship graph attention convolutional neural network layer is the characteristic data of the i-th sampling point output by the previous layer of the local attribute relationship graph attention convolutional neural network layer.

[0095] The representation of the defined attribute relationship graph is as follows:

[0096]

[0097] Where y, x1, and x2 are the characteristic data of soil heavy metal concentration dimension, precipitation dimension, and river density dimension of the i-th sampling point input by the local attribute relationship graph attention convolutional neural network layer, PG i is the local attribute graph of the i-th sampling point, f(*) represents the calculation function of the correlation coefficient between features, and the Spearman correlation coefficient calculation method is used here (in the initial case).

[0098] The expression of independent variables and potential characteristics Z is,

[0099] Z=σ([x1,x2]·W z )

[0100] Where W z is the learnable weight, σ is the activation function, and · is the dot product operation.

[0101]

[0102] In the formula, F i ″ is the feature data of the i-th sampling point after integrating the potential feature Z, and || is the concatenation operation.

[0103] The graph attention process is as follows,

[0104] e i ' j =a(W a2 F i ′,′W a2 F j ″)

[0105] In the formula, e ij ′ represents the importance of the attribute relationship between sampling point i and sampling point j, F i ″ and F j ″ is the feature data of the i-th and j-th sampling points after integrating the potential feature Z. are learnable weights, a is the matrix dot multiplication operation mode.

[0106]

[0107] In the formula, α′ ij is the importance of the attribute relationship between sampling point i and sampling point j, is a single-layer feed-forward neural network with an attention mechanism, parameterized by a weight vector, LeakyReLU is the activation function, N ki is the total number of sampling points that are spatially connected to a single sampling point i, k is the serial number of the sampling points that are spatially connected to a single sampling point i, || is the concatenation operation, is the learnable attention weight, F″ k It is the feature data of the kth sampling point after integrating the potential feature Z.

[0108]

[0109] In the formula, F i ″′ is the characteristic data of the i-th sampling point, N′ ci is the total number of sampling points similar to sampling point i, c is the serial number of sampling points similar to single sampling point i, N′ is the total number of sampling points similar to single sampling point i, || is the concatenation operation, W2 is the learnable weight of the process, σ is the activation function, PG i is the local attribute graph of the i-th sampling point, α′ ic is the importance of the attribute-based relationship between sampling point i and sampling point c, F c″ is the feature data of the cth sampling point after integrating the potential feature Z.

[0110]

[0111] Where h″ is the feature data of each sampling point obtained by the local attribute relationship graph attention convolutional neural network layer, denoted as the local target dataset output by the local attribute relationship graph attention convolutional neural network layer. The local target dataset includes the feature data of N sampling points, and the dimensions of the feature data of each sampling point include soil heavy metal concentration, precipitation, and river density.

[0112] The local target data sets corresponding to the 1st local attribute relationship graph attention convolutional neural network layer to the Lth local attribute relationship graph attention convolutional neural network layer are denoted as h ( '1' ) ~h ( ' L ' ) .

[0113] Step 3.4, using the collaborative filtering method combining global spatial features and local attribute features to obtain the integrated data set;

[0114] Specific description: Integrate the global spatial graph attention model results and the local attribute relationship graph attention results into the final data set, that is, add multiple global spatial graph attention convolutional neural network layers as described in step 3.2 and multiple local attribute relationship graph (dependent variable-independent variable-latent feature) attention convolutional neural network layers as described in step 3.3.

[0115] h s =h ( ' 1) +h ( ' 2) +...+h ( ' L)

[0116] In the formula, h s represents the merged features based on global spatial graph attention, L represents the number of layers, and h ( ' 1) ~h ( ' L) It is the global target dataset corresponding to the 1st global spatial graph attention convolutional neural network layer to the Lth global spatial graph attention convolutional neural network layer.

[0117] h p =h ( '1' ) +h ( '2' ) +…+h ( ″L)

[0118] In the formula, h p represents the result merging based on the attention of the local attribute relationship graph, L represents the number of layers, and h ( '1' ) ~h ( ' L ' ) It is the local target data set corresponding to the 1st local attribute relationship graph attention convolutional neural network layer to the Lth local attribute relationship graph attention convolutional neural network layer.

[0119]

[0120] In the formula, is the final dataset obtained.

[0121] Step 3.5: Final dataset Input into the multi-layer perceptron, predict the feature data (dependent variable Y) it contains and evaluate the accuracy of the results.

[0122] Specific instructions:

[0123] Y p =g(x·w+b)

[0124] Where Y p is the predicted value of soil heavy metal concentration, and x is the final data set The feature data corresponding to the precipitation dimension, river density dimension, and potential feature dimension (that is, the feature data except the heavy metal concentration dimension), w is the learnable weight, and b is the bias.

[0125] The loss function (Loss) selects the mean square error function (MSE).

[0126]

[0127] Where Y t is the true value of soil heavy metal concentration (dependent variable Y), Y p is the predicted value of soil heavy metal concentration (dependent variable Y), and N is the number of sampling points.

[0128] When the above loss function reaches the minimum, the optimized global spatial graph attention convolutional neural network and local attribute relationship graph attention convolutional neural network are obtained, as well as the optimized learnable weights W z and learnable weights w to extract the final latent features Z,

[0129] Step 4: Based on the optimized global spatial graph attention convolutional neural network, the optimized local attribute relationship graph attention convolutional neural network, and the optimized learnable weights Wz And learnable weights w, get the final data set Based on the final dataset Extract potential features affecting heavy metal concentrations.

[0130] Statistical analysis was performed on the latent feature Z and the related original variables to evaluate their rationality.

[0131] Specific description: Evaluate the relationship between the potential feature Z and its related independent variables X1, X2 (precipitation and river density) under global conditions. Evaluate the relationship between the potential feature Z and the dependent variable (soil Cd content) under global conditions. Evaluate the relationship between the potential feature Z, independent variables (precipitation and river density), and dependent variable (soil Cd content) under local conditions.

[0132] The results of this example are as follows Figure 2 , Figure 3 , Figure 4 , Figure 5 As shown. Among them, Figure 2 The relationship between the potential feature and its related independent variables X1, X2 (precipitation and river density) in this embodiment is shown. The potential feature first increases and then decreases with the increase of precipitation, and the corresponding critical value is 0.4. Under the influence of precipitation, the normalized range of the intensity of the potential feature is 0.1–0.4. In addition, the intensity of the potential feature gradually increases with the increase of river density, and the growth rate fluctuates in the range of 0.2–0.4. Figure 3 The relationship between the potential characteristic Z and the dependent variable (soil Cd content) in this example is shown. The soil Cd concentration increases with the change of the potential characteristic, and when the potential characteristic is in the range of 0.2–0.4, the soil Cd concentration trend tends to be stable. Figure 2 When the river density and precipitation are at medium intensity (0.2-0.6), the potential characteristic intensity reaches the highest, indicating that the influence of medium river density and precipitation on soil Cd concentration in the study area reaches a balanced state. In this state, areas with higher river density will experience further accumulation of soil Cd elements, while areas with lower river density will reduce soil Cd accumulation. In addition, areas with higher or lower precipitation will reduce soil Cd concentration. Figure 4 and Figure 5 The relationship between the potential feature Z, the independent variables (precipitation and river density), and the dependent variable (soil Cd content) in this example is shown. From the global attention map ( Figure 4 From the perspective of the left, the distance between sampling points is the main reference indicator. From the perspective of local attribute relationship, there are differences in the relationship between attributes of sampling points at different locations.

[0133] This paper proposes a potential feature quantification method based on global and local self-attention to quantify the potential features formed by the interaction of multiple independent variables. This method simultaneously considers the correlation of the spatial position of the data set and the correlation between attribute variables, which can fully mine the data features and clarify the hidden intrinsic connections in the data.

[0134] It should be noted that the embodiments described in the present invention are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the described embodiments or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the attached claims.

Claims

1. A latent feature quantization method based on global and local self-attention, characterized in that: Here are the steps: Step 1: Obtain the soil heavy metal concentration at each sampling point; Step 2: Obtain the precipitation and river density of each sample; Step 3: Use the precipitation, river density, and soil heavy metal concentration of each sample to optimize the training of the global spatial graph attention convolutional neural network and the local attribute relationship graph attention convolutional neural network; Step 4: Extract potential features that affect heavy metal concentrations based on the optimized global spatial graph attention convolutional neural network and the optimized local attribute relationship graph attention convolutional neural network.

2. The method for quantifying latent features based on global and local self-attention according to claim 1, characterized in that: The step 3 comprises the following steps: Step 3.1: Preprocess the heavy metal concentrations and environmental factors at the sampling points; Step 3.2, inputting the heavy metal concentration and environmental factors of each sampling point into the global spatial graph attention convolutional neural network, the global spatial graph attention convolutional neural network includes a plurality of serially processed global spatial graph attention convolutional neural network layers, each layer of the global spatial graph attention convolutional neural network layer outputs the corresponding global target data set; Step 3.3: Input the heavy metal concentration and environmental factors of each sampling point into the local attribute relationship graph attention convolutional neural network, the local attribute relationship graph attention convolutional neural network includes multiple serially processed local attribute relationship graph attention convolutional neural network layers, and each layer of the local attribute relationship graph attention convolutional neural network layer outputs the corresponding local target data set; Step 3.4: Calculate the final dataset based on the global target dataset output by each layer of the global spatial graph attention convolutional neural network layer and the local target dataset output by each layer of the local attribute relationship graph attention convolutional neural network layer Step 3.5: Final dataset The input is fed into a multi-layer perceptron, which outputs the predicted value of soil heavy metal concentration and optimizes it based on minimizing the loss function.

3. The method for quantifying latent features based on global and local self-attention according to claim 2, characterized in that: The preprocessing in step 3.1 is normalization processing.

4. The method for quantifying latent features based on global and local self-attention according to claim 2, characterized in that: The global target dataset output by the global spatial graph attention convolutional neural network layer is based on the following formula: h′={F1′,F2′,...,F N ′} Where h′ is the global target dataset output by the global spatial graph attention convolutional neural network layer. The global target dataset includes the feature data of N sampling points. In the formula, F i ′ is the characteristic data of the i-th sampling point, N ci is the total number of sampling points that are similar to sampling point i, c is the serial number of the sampling point that is similar to a single sampling point i, || is the concatenation operation, W1 is the learnable weight, σ is the activation function, In the formula, α ij is the importance of distance between sampling point i and sampling point j, a is a single-layer forward neural network with attention mechanism, LeakyReLU is the activation function, N ki is the total number of sampling points that are spatially connected to a single sampling point i, || is the concatenation operation, k is the serial number of the sampling point that is spatially connected to a single sampling point i, W a1 is the attention weight; have been ij =a(W a1 F i ,W a1 F j ) In the formula, e ij represents the importance of distance between sampling point i and sampling point j, W a1 is the attention weight, M′ is the number of dimensions, a is the matrix multiplication operation, and F i is the characteristic data of the i-th sampling point; In the formula, SG ij Represents the distance relationship between sampling point i and sampling point j, d() is the Euclidean space distance algorithm, i, j∈1~N, LON is the longitude of the sampling point location, LAT is the latitude of the sampling point location, LON i ,LAT i is the longitude and latitude of the i-th sampling point, LON j ,LAT j are the longitude and latitude of the jth sampling point.

5. The method for quantifying latent features based on global and local self-attention according to claim 4, characterized in that: The local target dataset corresponding to the output of the local attribute relationship graph attention convolutional neural network layer is based on the following formula: h″={F″′1,F″′2,...,F″′ N } Where h″ is the local target dataset output by the local attribute relationship graph attention convolutional neural network layer. The local target dataset includes the feature data of N sampling points. The dimensions of the feature data of each sampling point include soil heavy metal concentration, precipitation, and river density. In the formula, F i ′ is the characteristic data of the i-th sampling point, N ci is the total number of sampling points that are similar to sampling point i, c is the serial number of the sampling point that is similar to a single sampling point i, || is the concatenation operation, W1 is the learnable weight, and σ is the activation function; In the formula, α ij is the importance of distance between sampling point i and sampling point j, a is a single-layer forward neural network with attention mechanism, LeakyReLU is the activation function, N ki is the total number of sampling points that are spatially connected to a single sampling point i, || is the concatenation operation, k is the serial number of the sampling point that is spatially connected to a single sampling point i, W a1 is the attention weight, have been ij =a(W a1 F i ,W a1 F j ) In the formula, e ij represents the importance of distance between sampling point i and sampling point j, W a1 is the attention weight, a is the matrix dot multiplication operation, F i is the characteristic data of the i-th sampling point; SG ij =d((LON i ,YEARS i ),(LON j ,YEARS j )) In the formula, SG ij Represents the distance relationship between sampling point i and sampling point j, d() is the Euclidean space distance algorithm, i, j∈1~N, LON is the longitude of the sampling point location, LAT is the latitude of the sampling point location, LON i ,LAT i is the longitude and latitude of the i-th sampling point, LON j ,LAT j are the longitude and latitude of the jth sampling point.

6. The method for quantifying latent features based on global and local self-attention according to claim 2, characterized in that: The final dataset Calculated based on the following formula: h p =h ( ′1′ ) +h ( ′2′ ) + … +h ( ″ L) h s =h ( ′ 1) +h ( ′ 2) + … +h ( ′ L) In the formula, h s represents the merged features based on global spatial graph attention, L represents the number of layers, and h ( ' 1) ~h ( ' L) is the global target dataset corresponding to the 1st global spatial graph attention convolutional neural network layer to the Lth global spatial graph attention convolutional neural network layer, h p represents the result merging based on the attention of the local attribute relationship graph, L represents the number of layers, and h ( '1' ) ~h ( ' L ' ) It is the local target data set corresponding to the 1st local attribute relationship graph attention convolutional neural network layer to the Lth local attribute relationship graph attention convolutional neural network layer.

7. The method for quantifying latent features based on global and local self-attention according to claim 2, characterized in that: The multilayer perceptron is based on the following formula: Y p =g(x·w+b) Where Y p is the predicted value of soil heavy metal concentration, and x is the final data set The feature data corresponding to the precipitation dimension, river density dimension, and potential feature dimension, w is the learnable weight, b is the bias, The loss function Loss is: Where Y t is the true value of soil heavy metal concentration, Y p is the predicted value of soil heavy metal concentration, and N is the number of sampling points.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the prediction method according to any one of claims 1 to 7 are implemented.

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

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the prediction method according to any one of claims 1 to 7 are implemented.