Gradient-based causal feature selection method, computer program product and equipment

By designing a gradient-based causal feature selection method, using graph autoencoder and mask matrix pruning technology, combined with the division and governance strategy and gradient descent method, the accuracy and completeness of causal feature recognition in causal feature selection are solved, and efficient causal feature selection is achieved.

CN120492850APending Publication Date: 2025-08-15ANHUI UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510619629.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The existing causal feature selection method based on deep learning is difficult to achieve differentiable recognition of causal features during the gradient optimization process, and it is impossible to ensure the minimum completeness of causal features in the local causal constraint space, resulting in limited accuracy and interpretability of causal feature selection.

Method used

A gradient-based causal feature selection method is designed, using graph autoencoder and mask matrix pruning technology, combined with the division and governance strategy and gradient descent method, local causal graphs are generated through MB identification networks, and DAG constraints and Gumbel-Ma.a Trick strategy are introduced to optimize the causal feature selection process.

Benefits of technology

It improves the accuracy and robustness of causal feature selection, reduces the complexity of model training, enhances the minimum completeness and interpretability of causal features, and is suitable for causal feature recognition in large-scale data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492850A_ABST
    Figure CN120492850A_ABST
Patent Text Reader

Abstract

The invention relates to the field of big data analysis, in particular to a gradient-based causal feature selection method, a computer program product and equipment, and the method comprises the steps: constructing an MB recognition network through AutoEncoder under the framework of a divide-and-conquer method, and enabling the MB recognition network to be used for variable fitting so as to extract a weighted adjacent matrix of a target variable in an information transmission process, and obtaining a corresponding local causal graph. In order to ensure that a causal relationship among variables is accurately captured, a DAG constraint is introduced to standardize a weighted adjacency matrix. In the practical application of the scheme, the embodiment also integrates a mask pruning strategy, defines a local reconstruction loss objective function with non-cyclic constraints, and adopts a causal hub extractor to perform pre-screening on variables. Based on the improvement, efficient optimization can be carried out by utilizing a gradient-based optimizer so as to determine the causal characteristics of the target variable. According to the scheme, the problem that the minimum completeness of an output result cannot be guaranteed due to the fact that an existing scheme is limited by accuracy can be effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data analysis, and in particular to a gradient-based causal feature selection method, and corresponding computer program products, storage media, and computer devices. Background Art

[0002] Causal feature selection is a new technique for revealing causal relationships between variables through data analysis. This technique has been widely used in big data applications such as bioinformatics, neuroscience, and intelligent systems. This method utilizes a Markov blanket (MB) to identify the direct causes, direct consequences, and common causes of a target variable, thereby constructing a more accurate predictive model. This method not only effectively reduces dimensionality and computational overhead but also improves the model's generalization capabilities. Under the assumption of fidelity, MB ensures that the selected feature subset retains sufficient information about the target variable while minimizing information redundancy, thereby enhancing the robustness and interpretability of the predictive model and providing a reliable basis for decision support.

[0003] Existing causal feature selection methods can be broadly categorized into two types: constraint-based and scoring-based. Constraint-based methods adhere to the Markov assumption and the fidelity assumption and rely on conditional independence tests (CI). These methods learn MBs using strategies such as synchronization, divide-and-conquer, or alternation, improving learning efficiency by screening relevant features and eliminating irrelevant ones. However, under noisy conditions or complex data generation mechanisms, CI tests can be biased, leading to erroneous MBs. Scoring-based methods combine greedy search with scoring functions (such as K² and BDeu-l) to determine MBs through Bayesian network (BN) structural learning. Their core idea is to learn directed acyclic graphs (DAGs) over the currently selected features and newly added features, extracting MBs at each iteration. However, when the constrained search space is large, the time complexity of DAG learning can increase dramatically, limiting its applicability to large-scale datasets.

[0004] With the rapid development of deep learning, the field of causal discovery, closely related to causal feature selection, has entered the era of deep neural networks. However, causal feature selection remains limited to early constraint-based and scoring-based methods, failing to effectively integrate modern deep learning techniques. This lag stems primarily from the strict discrete constraints imposed by causal feature selection on the minimum and complete interpretable causal neighborhood (MB) of the target variable. Existing gradient-based techniques typically focus solely on minimizing prediction errors or loss functions, inherently relying on statistical correlations in the data rather than revealing underlying causal mechanisms, resulting in limited interpretability. For gradient-based techniques to truly identify causal features, it is necessary to clearly define constraints and design precise causal objectives during the optimization process. However, existing differentiable causal discovery methods struggle to accurately eliminate global structural redundancy, resulting in insufficient assurance of minimal causal feature completeness. Therefore, achieving differentiable identification of causal features during gradient optimization of neural networks while ensuring minimal causal feature completeness within the local causal constraint space remains a pressing technical challenge. Summary of the Invention

[0005] In order to solve the problems existing in the existing causal feature selection methods based on deep learning, the present invention provides a gradient-based causal feature selection method, and its corresponding computer program product, storage medium and computer device.

[0006] The technical solutions provided by the present invention are as follows:

[0007] A gradient-based causal feature selection method includes the following steps:

[0008] Design a MB recognition network that includes a graph autoencoder, a mask unit, and a parameter update unit. The graph autoencoder uses an auto encoder that includes an encoder and a decoder. The parameter update unit is used to dynamically update the transformation matrix A, the mask matrix M, and the model parameters of the auto encoder according to preset rules. The graph transformation network converts the input variable set X into the corresponding potential representation H through the encoder. (j) ; Then combine A T For H (j) Perform linear transformation to obtain H (j)′ ; Finally, the decoder is used according to H (j)′ Reconstruct the corresponding causal diagram The mask unit is used to prune the causal graph using M, thereby obtaining a local causal graph that only contains the specified central node and its adjacent nodes.

[0009] Adopt divide and conquer strategy: (1) take target node x TAs the central node, the causal hub extractor is used to pre-select the original input variable set, and then the variable set containing fewer variables after pre-selection is input into the MB recognition network to generate a local causal graph for the corresponding variable set. The corresponding iterative optimization process is performed cyclically by the gradient descent method to update the network parameters and output the variable set containing x after minimizing the loss function. T The first causal graph of its parent and child nodes. (II) Taking x T Each child node C i As the central node, the causal hub extractor and MB recognition network are used to iteratively optimize again according to the same method to generate i The second causal graph of its parent and child nodes.

[0010] Divide each second causal graph by x T The parent node other than x T The spouse node of the first causal graph and each second causal graph is combined to generate a node containing the specified variable x T and the Markov blanket MB of all its parent nodes, child nodes, and spouse nodes T .

[0011] As a further improvement of the present invention, during the iterative optimization process of the MB recognition network, the preset loss function L rel The calculation formula is as follows:

[0012]

[0013] In the above formula, Represents the node x in the j-th observation sample input to the MB recognition network T 's associated neighborhood; Indicates the output after MB recognition network processing The reconstruction result; n represents the number of samples; F represents the Frobenius norm, which is used to quantify the square error of the matrix elements; λ represents the regularization coefficient; μ represents a Lagrange multiplier used to adjust the influence of the constraint condition; ρ represents a penalty parameter used to control the penalty strength of the constraint term; represents the Hadamard penalty operation of the matrix; h(·) represents the function used to evaluate the smoothness of the matrix, which satisfies:

[0014]

[0015] where tr(·) represents the function used to calculate the trace of the matrix, Representation matrix The matrix index of ; d represents the number of variables contained in the variable set.

[0016] As a further improvement of the present invention, the constraints satisfied by the local causal graph iteratively output by the MB recognition network include:

[0017]

[0018] As a further improvement of the present invention, the parameter updating function of the parameter updating unit is as follows:

[0019]

[0020] In the above formula, A k and A k+1 Represents the transformation matrix before and after the update; M k+1 represents the updated mask matrix; and Represent the encoder parameters before and after the update respectively; and Respectively represent the decoder parameters before and after the update; μ k and μ k+1 Respectively represent the Lagrange multipliers before and after the update; ρ k and ρ k+1 They represent the penalty parameters before and after the update respectively; β and γ represent the adjustment hyperparameters used to control the penalty parameter growth rate and error change threshold respectively, β>1, γ<1.

[0021] As a further improvement of the present invention, each element m in the mask matrix M jk is generated as follows:

[0022]

[0023] That is: if the variable x j and x k None of them belong to the potential associated neighborhood X pl(T) , then the corresponding edge is removed, m jk =0; otherwise, the corresponding edge is retained, m jk =1.

[0024] As a further improvement of the present invention, the process of generating the first causal graph and the second causal graph by the iterative optimization method of gradient descent includes two stages: search and retraining.

[0025] 1. In the search phase, we first use the dynamically updated control parameters in the causal hub extractor For each input variable x n Perform weighted processing to achieve soft selection of variables; then input the soft-selected variable set into the MB recognition network; and then update each control parameter through the back propagation of the loss function in the MB network The value of ; the expression of the variable weighting operation in the soft selection process is as follows:

[0026]

[0027] In the above formula, and Represents the nth variable x n The weight coefficient of being selected or discarded; x′ n Represents x n The result after weighted operation.

[0028] Finally, based on the updated control parameters Generate the probability that the corresponding variable is selected or abandoned and

[0029] 2. In the retraining stage, according to the control parameters For each input variable x n Hard selection is performed to select a new variable set X′ from the original variable set X; the variable set after hard selection is then input into the MB recognition network, and then iterative optimization is performed through the MB recognition network to generate the required local causal graph.

[0030] Among them, the expression of the screening process of the new variable set X′ is:

[0031]

[0032] As a further improvement of the present invention, the control parameters in the retraining phase are and The value of is generated by:

[0033]

[0034] Where g0 and g1 are independent and identically distributed Gumbel noises, and τ represents the temperature parameter used to control the smoothness of Softmax.

[0035] The present invention also includes a computer program product, which includes a computer program, which, when executed by a processor, implements the steps of the gradient-based causal feature selection method as described above, and then generates a variable containing a specified variable x according to an input variable set V. T Markov blanket MB of all parent, child and spouse nodes T .

[0036] The present invention also includes a storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned gradient-based causal feature selection method, and then generates a variable set V containing a specified variable x according to the input variable set V. T Markov blanket MB of all parent, child and spouse nodesT .

[0037] The present invention also includes a computer device comprising a memory, a processor, and a computer program stored in the memory and running on the processor. When the computer program is executed by the processor, the steps of the gradient-based causal feature selection method are implemented, and a variable set V containing a specified variable x is generated according to the input variable set V. T The Markov blanket MB of all parent, child and spouse nodes T .

[0038] The present invention has the following beneficial effects:

[0039] The technical solution proposed in this paper utilizes gradient descent and a neural network to explore the MB of a target variable. This solution effectively partitions the local causal constraint space using acyclic constraints and a mask matrix to achieve minimality and completeness. Furthermore, during the search phase, it employs the Gumbel-Maa trick strategy to simulate hard selection, reducing the dimensionality of the variables input to the network model and accelerating the MB learning process.

[0040] Experimental results on both synthetic and real-world datasets confirm that the proposed approach outperforms existing causal feature selection methods in accuracy, validating its effectiveness in this task. Furthermore, the proposed approach demonstrates excellent robustness in high-dimensional and complex data and demonstrates excellent scalability with increasing sample sizes. In practical applications, the proposed approach employs a unified training framework, avoiding the information fragmentation and inconsistency associated with model segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a typical Markov blanket diagram representing the target node T provided in Example 1 of the present invention.

[0042] Figure 2 A flowchart of the steps of the gradient-based causal feature selection method provided in Example 1 of the present invention.

[0043] Figure 3 This is an architecture diagram of the MB identification network designed in Example 1 of the present invention.

[0044] Figure 4 This is a schematic diagram of the MB identification process with search range pre-screening introduced in Embodiment 1 of the present invention.

[0045] Figure 5 This is a schematic diagram of the principle of generating the MB of the target node using the divide-and-conquer strategy in Example 1 of the present invention.

[0046] Figure 6To verify the experiment, when the sample size is 1000, the F1 score of different schemes changes with the node scale.

[0047] Figure 7 To verify the experiment, when the sample size is 5000, the F1 score of different schemes changes with the node scale.

[0048] Figure 8 To verify the learning results of the solution of the present invention on the Sachs dataset in the experiment. DETAILED DESCRIPTION

[0049] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this invention pertains. The terms used herein in the specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "or / and" as used herein includes any and all combinations of one or more of the associated listed items.

[0051] Example 1

[0052] This embodiment provides a gradient-based causal feature selection method for re-identifying a target variable from observation data using a Markov blanket (MB), that is, according to the input multivariate set X (X = (x1, x1, ... x2) T …,x n )) and the specified target node x T , generate a T Markov blanket MB of all parent nodes, child nodes and spouse nodes T .like Figure 1 As shown, for a variable x T For the corresponding node T, the variable corresponding to its parent node P can represent the variable x T The direct cause of the change, the variable corresponding to its child node C can be represented by the variable x T The direct result of the change. The variable corresponding to the spouse node SP is the same as the variable x T The common cause of the change in the variable corresponding to the designated node C. The essence of the solution provided by this embodiment is to identify all P nodes, C nodes, and SP nodes corresponding to the designated node T from the input observation data containing the values of multiple variables.

[0053] In order to solve this problem, the solution provided in this embodiment uses AutoEncoder to build an MB network under the framework of the divide-and-conquer method, and uses it to simultaneously fit the target variable and other variables. The weighted adjacency matrix of the target variable is extracted during the information transmission process to obtain the corresponding local causal graph. To ensure that the causal relationship between variables is accurately captured, the solution of this embodiment introduces DAG constraints to standardize the weighted adjacency matrix. In the practical application of this solution, this embodiment also integrates a mask pruning strategy, defines a local reconstruction loss objective function with non-cyclic constraints, and further promotes the exploration of local causal relationships. Based on the above improvements, this embodiment transforms the discrete search process into an iterative optimization process for minimizing the objective function, and then uses a gradient-based optimizer for efficient optimization to ultimately determine the causal characteristics of the target variable.

[0054] Under the framework of the divide-and-conquer approach, the solution provided in this embodiment includes three steps: S1: Searching for the parent and child nodes of the target node. S2: Searching for the parent node of each child node of the target node (the spouse node of the target node is one of the parent nodes of the target node's child nodes). S3: Generating the MB blanket of the target node. Both steps S1 and S2 can be completed through the iterative optimization process described above. To accelerate the feature selection process and reduce the impact of redundant information in variable relationships, this embodiment further divides the iterative optimization process in steps S1 and S2 into two phases: a search phase and a retraining phase.

[0055] During the search phase, this embodiment uses an expected sampling method to select a set of variables from all variable sets for subsequent iterative optimization. Combined with the iterative gradient backpropagation of the MB network, this embodiment iteratively optimizes the probability of each variable being selected or discarded. During the retraining phase, this embodiment directly filters the original variable set based on the optimization results of the search phase. The selected variable set containing fewer variables is then used as the original output of the subsequent MB network. The MB network then generates the corresponding local causal graph through iterative optimization.

[0056] In detail, such as Figure 2 As shown, the gradient-based causal feature selection method of this embodiment includes the following steps:

[0057] S1: Search for the parent and child nodes of the target node.

[0058] (1) Generate the required MB based on iterative optimization of MB recognition network

[0059] In the technical solution provided in this embodiment, in order to search for the parent node and child nodes of the target node, the technicians first designed an MB recognition network including a graph autoencoder, a mask unit, and a parameter update unit. In the MB recognition network of this embodiment, the graph autoencoder adopts an Auto Encoder including an encoder and a decoder. The AutoEncoder is a structural causal model (SCM) that can generate a variable set X (X=(x1, x1, ... x T …,x n ) represents the causal graph G of the causal relationships between the variables in the Auto Encoder. Both the encoder and decoder in the Auto Encoder can be implemented using multi-layer perceptrons (MLPs). The parameter update unit is used to dynamically update the transformation matrix A, the mask matrix M, and the Auto Encoder model parameters according to preset rules.

[0060] In the graph conversion network of this embodiment, the encoder can transform the input variable set X into (j) Converted to the corresponding latent representation H (j) ; Then, combined with the transformation matrix A T Can H (j) Perform linear transformation to realize the information transfer process and obtain the potential representation H (j)′ Finally, the decoder is used according to H (j)′ Reconstruct the corresponding causal diagram Throughout the entire process, the information transfer mechanism in the graph conversion network is similar to that of the graph convolution layer. The information of the vector variable is aggregated into the potential representation of the target variable through the adjacency matrix, realizing information propagation and representation learning on the graph. The feature learning process obtained by the graph conversion network can be expressed as follows:

[0061] H (j) =f1(X (j) ),H (j)′ =A T H (j)

[0062]

[0063] In the above formula, f1 and f2 represent the encoder and decoder respectively; the superscript (j) represents the dimension of the variable.

[0064] In addition, in the MB recognition network of this embodiment, the mask unit is used to prune the causal graph output by the AutoEncoder using the mask matrix M, thereby obtaining a local causal graph containing only the specified central node and its adjacent nodes. Specifically, each element m in the mask matrix M is jk is generated as follows:

[0065]

[0066] Combined with the above formula, we can see that each element m in the mask matrix M jk Used to represent the corresponding variable x j and x k Whether the edges between are preserved. If the variable x j and x k None of them belong to the potential associated neighborhood X pl(T) , then the corresponding edge should be removed. At this time, m jk =0; otherwise, the corresponding edge is retained, m jk =1.

[0067] The Auto Encoder used in this embodiment is a structural causal model (SCM), which can generate a variable set X (X = (x1, x1, ... x2) for representing the input T …,x n ) is a causal graph G = (V, E) of the causal relationships between the variables in the input variable set, where V represents a set of nodes, each node in the node set corresponds to each variable in the input variable set. E represents a set of edges, each edge in the edge set is used to represent the direct causal relationship between the specified variables. i and x j There is a directed edge x between i →x j , then x i x j There is an impact, at this time, x i is x j On the contrary, when x i and x j There is a directed edge x between j →x i , then x j x i There is an impact, at this time, x j is x i In addition, considering that the causal relationship between variables is usually unidirectional, the edges between any nodes in the graph should avoid forming a cyclic structure. Therefore, in the Auto Encoder of this embodiment, a smooth acyclic constraint as follows can be added. This acyclic constraint can ensure that the local causal graph output by the graph conversion network does not contain a cyclic structure, avoiding the situation where the effect is the cause.

[0068]

[0069] In the above formula, represents the Hadamard penalty operation of the matrix; h(·) represents the function used to evaluate the smoothness of the matrix; tr(·) represents the function used to calculate the trace of the matrix, Representation matrix The matrix index of ; d represents the number of variables contained in the variable set, which corresponds to the number of nodes in the causal graph or the dimension of the critical matrix.

[0070] In this embodiment, the process of generating MBs of specified variables according to a multi-variable set using the designed MB recognition network is as follows: Figure 3 As shown in the figure, in order to more efficiently identify the target variable x T For MBs related to the above, it is necessary to define a suitable local search area and accurately restore the local structure by minimizing the local reconstruction error. To this end, this embodiment adopts a local graph construction method to gradually expand x based on the connection relationship between variables. T neighborhood of , thereby determining its potential associated neighborhood (i.e. Figure 3 X in pl(T) In this process, Q is used as the metric of potential associated neighborhood. As Q increases, X pl(T) Gradually expand to variables that are more widely associated with the target variable, so that X pl(T) The set of variables in is conditionally independent of other variables under given conditions. Finally, by minimizing the local reconstruction error and adding regularization terms to enhance the sparsity of the matrix A, the following optimization problem is constructed:

[0071]

[0072] The top is the middle, Represents the node x in the j-th observation sample input to the MB recognition network T 's associated neighborhood; Indicates the output after MB recognition network processing The reconstruction result; n represents the number of samples; F represents the Frobenius norm, which is used to quantize the square error of the matrix elements; λ represents the regularization coefficient; Φ1 and Φ2 represent the weight parameters of the encoder and decoder, respectively.

[0073] After obtaining the solution to the optimization problem through iterative optimization, the set of parent nodes and child nodes of the target variable (denoted as PC) can be identified. However, this method only captures the correlation between variables and cannot distinguish between P and C in the causal relationship. Although there is no need to distinguish between the two when searching for MB, when adopting a divide-and-conquer strategy and learning the parent variable (i.e., SP) through common child variables, distinguishing between P and C helps significantly narrow the search range of SP, thereby improving the efficiency of MB learning. Therefore, in the optimization process of minimizing the local reconstruction error, on the one hand, this embodiment still needs to introduce the directed acyclic constraint of NOTEARS: By limiting the search space, the generated graph structure is ensured to be acyclic, thereby assisting in determining the causal direction between variables. On the other hand, since this embodiment focuses on searching for x T MB, so this embodiment only focuses on x T The local causal graph (containing only x T and its adjacent points) rather than the global causal graph (the causal graph that includes all variables). To this end, a mask matrix M is introduced to prune A: filter and x T Irrelevant parts, focus on optimizing relevant areas to gradually reveal X pl(T) At this point, the optimization problem of this embodiment is further converted into:

[0074]

[0075] In order to better utilize the MB recognition network to solve the above optimization problem, this embodiment further utilizes the augmented Lagrangian method to transform the general form of the above optimization problem into the following unconstrained optimization problem form by introducing Lagrangian multipliers and penalty terms:

[0076]

[0077] Wherein, μ represents a Lagrange multiplier used to adjust the influence of the constraint condition; ρ represents a penalty parameter used to control the penalty intensity of the constraint term; ρ>0.

[0078] In the MB recognition network, by iteratively adjusting these parameters, the error can be minimized while gradually satisfying the constraints. The update rules of each parameter in the iterative optimization process are as follows:

[0079]

[0080] In the above formula, A k and A k+1 Represents the transformation matrix before and after the update; M k+1 represents the updated mask matrix; and Represent the encoder parameters before and after the update respectively; and Respectively represent the decoder parameters before and after the update; μ k and μ k+1 Respectively represent the Lagrange multipliers before and after the update; ρ k and ρ k+1 They represent the penalty parameters before and after the update respectively; β and γ represent the adjustment hyperparameters used to control the penalty parameter growth rate and error change threshold respectively, β>1, γ<1.

[0081] Through the above processing of this embodiment, the optimization problem to be solved by the target recognition network is converted into a first-order differentiable optimization problem, which can be solved using gradient descent. In practical applications, the automatic differentiation (Autograd) function of deep learning frameworks such as TensorFlow can be used in combination with the Adam optimizer to efficiently update parameters.

[0082] At this point, in this embodiment, the MB recognition network based on Auto Encoder designed above is selected, and the loss function is set to:

[0083]

[0084] The specified variable x in the input variable set V can be iteratively optimized by the gradient descent method T All parent nodes, child nodes and spouse nodes of , and generate corresponding MBs.

[0085] (2) Pre-screening of the search range of the MB recognition network

[0086] The previous article introduced the MB recognition network based on the design, which takes the multi-variable set as input and defines the local reconstruction loss function (L rel ), and use the gradient descent method to get the target variable x T This is a complete MB solution. While this solution can fully capture information within a local range, it may still contain redundant information, increasing the complexity of model training. Therefore, this embodiment employs a more improved solution in practical applications. This improved solution automatically selects a local range from the original variable set containing all variables, then uses the MB recognition network to search for the optimal MB in the new variable set containing fewer variables, thereby reducing the impact of redundant information within the local range.

[0087] Specifically, the principle of the improved solution of pre-screening of the search range introduced in this embodiment is as follows: Figure 4 As shown in FIG, the process includes two processes: the search phase and the retraining phase.

[0088] I. Search Phase

[0089] In the search phase, the parameters of the network model are initialized first, and then the set X of all variables is input into the causal hub extractor. The causal hub extractor uses built-in control parameters Perform weighted processing on each input variable to obtain the weighted variable set X′; then gradually optimize these control parameters through gradient descent in the MB recognition network To minimize the loss function. Finally, each variable has T The importance of can be gradually determined in this way. The whole process can be reduced to the expected sampling problem, as follows:

[0090]

[0091] X′=(x1′,x2′,…,x n ′)

[0092] In the above formula, and Represents the nth variable x n The weight coefficient for being selected or discarded.

[0093] In this embodiment, the weight of each variable is dynamically adjusted according to the current parameters of the controller during the search phase by the causal hub extractor. The process is called "soft selection" mechanism.

[0094] However, soft selection cannot completely eliminate the influence of suboptimal variables on the final MB. Therefore, this embodiment further uses the Gumbe-Maa' Trick to simulate the hard selection process based on controller parameters. Specifically, the hard selection process can be implemented as follows:

[0095]

[0096] where g1=-log(-log(μ1))

[0097] g2=-log(-log(μ2))

[0098] μ1, μ2~Uniform(0,1)

[0099] In the above formula, g0 and g1 are independent and identically distributed Gumbel noises, μ1 and μ2 represent parameters adopted from the uniform distribution Uniform(0,1), and z n Represents the parameters obtained by indifferent argmaxH and one-hot operations. Therefore, the Softmax operation is used to approximate the application of the gradient optimization strategy, and the following variable selection probability is obtained

[0100]

[0101] In the above formula, and Represents the variable x n The probability of selection and the probability of abandonment are, τ represents the temperature parameter used to control the smoothness of Softmax; finally, the probability value is generated in the iterative update process and The original variable set X can be screened to obtain a new variable set X′ with fewer variables.

[0102] II. Retraining Phase

[0103] Control parameters updated based on the search phase You can get the updated probability value In this embodiment, the retraining stage directly uses The original variable set is hard selected. The hard selection process can reduce the variable set from the original dimension containing all variables to K dimensions, and then the new variable set X′ containing only K-dimensional features is input into the MB recognition network. By retraining the MB recognition network, the loss function can be minimized by back propagation, and the parameters of each layer of the network model can be updated, thereby searching for x T The parent and child nodes of .

[0104] So far, the above content has introduced how this embodiment uses the multi-dimensional original variable set X to first go through the search phase, then the retraining phase, and then use the MB recognition network to quickly find the target variable x from a smaller local range. T All parent nodes and child nodes of .

[0105] S2: Search for the parent node of each child node of the target node.

[0106] In the causal graph, the spouse node SP of the target node T is essentially one of the parent nodes P of the child node C of the target node T. For any child node C, among all its parent nodes, the parent node other than the target node T is the spouse node SP of T.

[0107] Therefore, this embodiment converts the task of searching for the spouse node of the target node T into the task of searching for the parent nodes of each of the target node's child nodes. In practical applications, this embodiment can sequentially locate the target node within each of the child nodes found in step S1. Then, using the same method as step S1, the aforementioned MB identification strategy including pre-screening is applied to the variable set to find the parent nodes of each child node. The "MB identification strategy including pre-screening" has been described in detail in step S1 and will not be further elaborated in this step.

[0108] S3: Generation of MB blanket of target node.

[0109] In this embodiment, all parent nodes P and child nodes C of the target node T can be obtained in the aforementioned step S1, and the parent nodes of each child node C can be obtained in the aforementioned step S2. Based on this, the spouse node of T can be screened out from the parent nodes of each child node. Figure 5 As shown, in this embodiment, each identified spouse node is added to the local causal graph containing all parent nodes P and child nodes C of the target node T, so as to obtain the Markov blanket MB of the target node T.

[0110] Example 2

[0111] In order to better apply the gradient-based causal feature selection method provided in Example 1, this embodiment further provides a computer program product, a storage medium, and a corresponding computer device capable of implementing the above method. Specifically, this embodiment provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the gradient-based causal feature selection method as described above, and then generates a variable containing a specified variable x according to the input variable set V. T The Markov blanket MB of all parent, child and spouse nodes T .

[0112] This embodiment also provides a storage medium storing a computer program. When the computer program is executed by a processor, the steps of the gradient-based causal feature selection method are implemented, and the input variable set V is used to generate a causal feature selection method containing a specified variable x. T The Markov blanket MB of all parent, child and spouse nodes T .

[0113] This embodiment also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the computer program is executed by the processor, the steps of the aforementioned gradient-based causal feature selection method are implemented, and a causal feature selection method containing a specified variable x is generated based on the input variable set V. T The Markov blanket MB of all parent, child and spouse nodes T .

[0114] In actual applications, the computer device can be an embedded device and deployed in various terminal devices to support data processing and interaction. It can also be used as an independent computer device to support data processing needs in certain scenarios. This non-embedded computer device can be a laptop, tablet computer, desktop computer, or a medium or large computer device such as a rack server, blade server, tower server, or cabinet server (including a standalone server or a server cluster consisting of multiple servers) that can execute computer programs.

[0115] Specifically, the computer device of this embodiment includes at least, but is not limited to, a memory and a processor that can be interconnected via a system bus. In this embodiment, the memory (i.e., a readable storage medium) includes flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, a magnetic disk, an optical disk, etc. In some embodiments, the memory can be an internal storage unit of the computer device, such as the hard disk or internal memory of the computer device. In other embodiments, the memory can also be an external storage device of the computer device, such as a plug-in hard disk equipped with the computer device, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, etc. Of course, the memory can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the memory is generally used to store the operating system and various application software installed on the computer device. In addition, the memory can also be used to temporarily store various types of data that have been output or are about to be output.

[0116] In some embodiments, the processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor is generally used to control the overall operation of a computer device.

[0117] Performance Testing

[0118] 1. Experimental Content

[0119] To verify the effectiveness and accuracy of the technical solution provided by the present invention, technicians conducted experiments on various synthetic datasets generated by two different mechanisms and real datasets. The solution of the present invention (hereinafter referred to as GCFS) was compared with nine causal feature selection algorithms, including divide and conquer methods (MMMB, STMB), synchronous methods (FBED, EAMB), PC-Spouse alternation methods (BAMB, EEMB), score-based methods (SLL, S 2 TMB) and a mutual information based method (CFS-MI).

[0120] In the experiments, precision, recall, CITs, and runtime were used as evaluation metrics to assess the performance differences among various solutions. Precision measures the proportion of true positives (TP) among all output results. Recall is the ratio of TP to the total number of actual positives. The F1 score is the harmonic mean of precision and recall, where F1 = 1 is the best case and F1 = 0 is the worst case. CITs represents the number of conditional independence tests performed. Runtime refers to the execution time of the algorithm. If any algorithm takes more than 1 hour to run once, its runtime is indicated as "-". For ease of observation, the experimental group that achieved the best performance will be marked in bold in the data of each experiment.

[0121] 2. Experimental Results and Analysis on Synthetic Datasets

[0122] The construction of synthetic datasets differs in data generation methods, number of nodes, and sample size. In this experiment, the ER model is used to generate a directed acyclic graph (DAG) at the initial node. The number of nodes d is set to 50, 100, 200, 500, 800, and 1500, and the number of edges is set to 2d. For each DAG, data samples with sample sizes n∈1000 and 5000 are generated. To ensure the reliability of the experiment, each sample group was independently repeated 10 times, and the mean and standard deviation of the results were recorded. Data generation adopts an additive noise model based on Gaussian process (modeling causal relationships through Gaussian process and adding noise); the noise term N i It obeys the standard normal distribution N(0,1), and its introduction adds randomness to the data generation process.

[0123] In the data generation experiment based on the additive noise model with Gaussian processes (ANM with GPs), Tables 1 and 2 show the performance comparison of GCFS with other algorithms when the number of samples is 1000 and 5000 respectively. When the number of samples is 1000 and 5000 respectively, the F1 score of the scheme changes with the node scale as shown in the following figure. Figure 6 and Figure 7 shown.

[0124] Table 1: Performance of different algorithms on the additive noise model when the number of samples is 1000

[0125]

[0126] Table 2: Performance of different algorithms on the additive noise model when the number of samples is 5000

[0127]

[0128] Analysis of the above experimental results shows that GCFS maintains its leading advantage in F1 scores at all node scales and sample sizes. For example, in scenarios with 50 or 100 nodes, constraint-based methods (such as EEMB and EAMB) can achieve high precision, but their F1 scores are limited due to their low recall. GCFS significantly improves recall while maintaining high precision, demonstrating better overall performance. This advantage is particularly significant at larger node scales (500 or 1500 nodes): Traditional methods based on conditional independence tests suffer from a significant drop in F1 scores due to decreased test reliability in high-dimensional complex data; GCFS, through gradient optimization technology and the efficient definition of local constraint space, can still maintain a high F1 score in complex scenarios.

[0129] As the sample size increases, the F1 score of GCFS improves significantly. Taking 800 nodes as an example, when the sample size increases from 1000 to 5000, the F1 score of GCFS increases by 47.5% (from 0.40 to 0.59), while other methods (such as CFS-MI) only show a slight gain or even a decrease. This suggests that large sample size may amplify the negative impact of noise on the mutual information metric. Although CFS-MI can occasionally achieve higher accuracy, its overall performance is limited by the increase in false positives or false negatives, resulting in a low F1 score. Traditional score-based methods (such as S3TMB) show low F1 scores and struggle when dealing with large node scales. In contrast, GCFS exhibits excellent scalability on large-scale datasets and can effectively utilize more sample information to improve the accuracy of causal feature identification.

[0130] In terms of CITs and runtime, GCFS achieves a CIT of zero, indicating that its differentiable causal feature selection avoids redundant conditional independence tests, mitigates MB errors in high-dimensional nonlinear environments, and ensures stable and accurate causal identification. Although GCFS exhibits superior performance on high-dimensional nodes compared to score-based methods, its runtime is relatively long. For example, with 50 nodes and 1,000 samples, it takes 85.34 seconds, while CFS-Ml and EAMB only take 0.01–0.1 seconds. This is due to GCFS's reliance on neural networks and multiple optimization steps to satisfy causal constraints. We provide more details in the supplementary file.

[0131] 3. Experimental Results and Analysis on Real Datasets

[0132] This experiment was conducted on a real biological dataset, specifically the Sachs dataset. This dataset records protein and phospholipid expression levels in human cells using multi-parameter single-cell technology. Its real-world network contains 11 nodes and 17 directed edges. As a common benchmark in the field of graphical models, the Sachs dataset features a consensus network based on experimental annotations and is widely recognized in the biomedical field as the gold standard for causal discovery research.

[0133] In causal feature selection for Sachs data, Figure 8 The following table shows the learning results of GCFS on the Sachs dataset. The red area represents the correct recognition results. The performance of each solution is shown in Table 3:

[0134] Table 3: Performance of different solutions on the Sachs dataset

[0135]

[0136] Analyzing the experimental results above, we find that GCFS outperforms the comparison algorithms in terms of precision (0.95), recall (0.56), and F1 score (0.67), demonstrating its superiority in accurately identifying causal features. Furthermore, while GCFS's runtime (25.72 seconds) is higher than that of the constraint-based approach, it is still faster than the SLL algorithm based on BN structure learning.

[0137] In summary, the present invention proposes a new gradient-based causal feature selection method (GCFS), which uses gradient descent methods and neural networks to explore the MB of the target variable. In order to effectively partition the local causal constraint space to achieve minimality and completeness, the scheme adds non-circular constraints and mask matrices. In addition, in order to accelerate the MB learning process, the scheme adopts the Gumbel-Ma.a Trick strategy to simulate hard selection in the search phase, thereby reducing the dimension of the variables input to the network model. The results of experiments conducted on synthetic datasets and real datasets confirm that the GCFS scheme of the present invention has shown strong competitiveness in the causal feature selection task, especially in terms of significant improvement in accuracy.

[0138] The above-described embodiment merely represents one embodiment of the present invention. While the description is relatively specific and detailed, it should not be construed as limiting the scope of the invention. It should be noted that a person skilled in the art would be able to make various modifications and improvements without departing from the spirit of the present invention, and these modifications and improvements fall within the scope of the present invention. Therefore, the scope of the present invention shall be determined by the appended claims.

Claims

1. A gradient-based causal feature selection method for generating a feature vector containing a specified variable x according to an input variable set V. T Markov blanket MB of all parent, child and spouse nodes T , characterized in that, It includes: A MB recognition network is designed, which includes a graph autoencoder, a mask unit, and a parameter update unit. The graph autoencoder uses an Auto Encoder including an encoder and a decoder. The parameter update unit is used to dynamically update the transformation matrix A, the mask matrix M, and the model parameters of the Auto Encoder according to a preset rule. The graph conversion network converts the input variable set X into the corresponding potential representation H through the encoder. (j) , then combined with A T For H (j) Perform linear transformation to obtain H (j)′ , and finally the decoder according to H (j)′ Reconstruct the corresponding causal diagram The mask unit is used to prune the causal graph using M, thereby obtaining a local causal graph that only includes the specified central node and its adjacent nodes; Adopt the divide-and-conquer strategy; (1) take the target node x T As the central node, the causal hub extractor is used to pre-select the original input variable set, and then the variable set containing fewer variables after pre-selection is input into the MB recognition network to generate a local causal graph of the corresponding variable set; then the gradient descent method is used to loop the corresponding iterative optimization process, update the network parameters and output the graph containing x after minimizing the loss function. T The first causal graph of its parent and child nodes; (ii) with x T Each child node C i As the central node, the causal hub extractor and MB recognition network are used to iteratively optimize again according to the same method to generate i The second causal graph of its parent and child nodes; Divide each second causal graph by x T The parent node other than x T The spouse node of the first causal graph and each second causal graph is combined to generate a node containing the specified variable x T and the Markov blanket MB of all its parent nodes, child nodes, and spouse nodes T .

2. The gradient-based causal feature selection method according to claim 1, characterized in that: Preset loss function L rel The calculation formula is as follows: In the above formula, Represents the node x in the j-th observation sample input to the MB recognition network T 's associated neighborhood; Indicates the output after MB recognition network processing The reconstruction result; n represents the number of samples; F represents the Frobenius norm, which is used to quantify the square error of the matrix elements; λ represents the regularization coefficient; μ represents a Lagrange multiplier used to adjust the influence of the constraint condition; ρ represents a penalty parameter used to control the penalty strength of the constraint term; represents the Hadamard penalty operation of the matrix; h(·) represents the function used to evaluate the smoothness of the matrix, which satisfies: where tr(·) represents the function used to calculate the trace of the matrix, Representation matrix The matrix index of ; d represents the number of variables contained in the variable set.

3. The gradient-based causal feature selection method according to claim 2, characterized in that The constraints satisfied by the local causal graph iteratively output by the MB recognition network include:

4. The gradient-based causal feature selection method according to claim 3, characterized in that The parameter updating function of the parameter updating unit is as follows: In the above formula, A k and A k+1 Represents the transformation matrix before and after the update; M k+1 represents the updated mask matrix; and Represent the encoder parameters before and after the update respectively; and Respectively represent the decoder parameters before and after the update; μ k and μ k+1 Respectively represent the Lagrange multipliers before and after the update; ρ k and ρ k+1 They represent the penalty parameters before and after the update respectively; β and γ represent the adjustment hyperparameters used to control the penalty parameter growth rate and error change threshold respectively, β>1, γ<1.

5. The gradient-based causal feature selection method according to claim 4, characterized in that Each element m in the mask matrix M jk is generated as follows: In the above formula, if the variable x j and x k None of them belong to the potential associated neighborhood X pl(T) , then the corresponding edge is removed, m jk =0; otherwise, the corresponding edge is retained, m jk =1.

6. The gradient-based causal feature selection method according to claim 1, wherein: The process of generating the first causal graph and the second causal graph by the iterative optimization method of gradient descent includes two stages: search and retraining; 1. In the search phase, we first use the dynamically updated control parameters in the causal hub extractor For each input variable x n Perform weighted processing to achieve soft selection of variables; then input the soft-selected variable set into the MB recognition network; and then update each control parameter through the back propagation of the loss function in the MB network The value of ; the expression of the variable weighting operation in the soft selection process is as follows: In the above formula, and Represents the nth variable x n The weight coefficient of being selected or discarded; x n ′ represents x n The result after weighted operation; Finally, based on the updated control parameters Generate the probability that the corresponding variable is selected or abandoned and 2. In the retraining stage, according to the control parameters For each input variable x n Perform hard selection to select a new variable set X′ from the original variable set X, then input the variable set after hard selection into the MB recognition network, and then perform iterative optimization through the MB recognition network to generate the required local causal graph; Among them, the expression of the screening process of the new variable set X′ is:

7. The gradient-based causal feature selection method according to claim 6, characterized in that The control parameters in the retraining phase and The value of is generated by: Where g0 and g1 are independent and identically distributed Gumbel noises, and τ represents the temperature parameter used to control the smoothness of Softmax.

8. A computer program product comprising a computer program, characterized in that: When the computer program is executed by a processor, the steps of the gradient-based causal feature selection method according to any one of claims 1 to 7 are implemented, and the input variable set V is used to generate a variable containing a specified variable x. T The Markov blanket MB of all parent, child and spouse nodes T .

9. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the gradient-based causal feature selection method according to any one of claims 1 to 7 are implemented, and the input variable set V is used to generate a variable containing a specified variable x. T Markov blanket MB of all parent, child and spouse nodes T .

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the computer program is executed by a processor, the steps of the gradient-based causal feature selection method according to any one of claims 1 to 7 are implemented, and the input variable set V is used to generate a variable containing a specified variable x. T Markov blanket MB of all parent, child and spouse nodes T .

Citation Information

Cited By

  • Industrial quality prediction method based on priori knowledge constraint graph convolution

    CN121073310A