Causal relationship discovery method and system, and related device

By dividing the data set into multiple category groups in the causal relationship discovery algorithm and combining knowledge sets for training, the problem that the causal relationship discovery algorithm in the existing technology can only output a single causal graph and has low accuracy, and the ability to discover multiple accurate causal graphs in small data volume scenarios is realized.

WO2025055901A1PCT designated stage expired Publication Date: 2025-03-20HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/118009
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-12
Filing Date
2024-09-10
Publication Date
2025-03-20

AI Technical Summary

Technical Problem

The existing causal relationship discovery algorithm can only output a single causal graph, with low accuracy, and it is difficult to find accurate causal relationships in small data scenarios.

Method used

Multiple causal graphs are generated by dividing the dataset into multiple category groups and training different submodels using different category groups. At the same time, training is carried out in combination with prior knowledge concentrated to improve the accuracy of causal discovery in small data volume scenarios.

Benefits of technology

The ability to discover multiple causal graphs in small data volume scenarios is realized, which improves the accuracy and stability of causal relationship discovery, and avoids the problem that the accuracy of the causal discovery algorithm depends on the data volume.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024118009_20032025_PF_FP_ABST
    Figure CN2024118009_20032025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a causal relationship discovery method and system, and a related device. The method comprises the following steps: a causal relationship discovery system dividing a data set into a plurality of category groups on the basis of the number of groups that is input by a user, making objects in the category groups be objects sharing a causal graph, and using different category groups to train different sub-models, such that different sub-models can mine causal graphs of observation data in corresponding category groups, thereby obtaining a plurality of causal graphs corresponding to the data set. Thus, the problem whereby current causal discovery algorithms can only identify a single causal graph can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

A causal relationship discovery method, system and related equipment

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on September 12, 2023, with application number 202311172042.9 and application name “A method, system and related equipment for discovering causal relationships”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of artificial intelligence (AI), and in particular to a causal relationship discovery method, system, and related equipment. Background Art

[0003] Causal discovery refers to the process by which AI models discover potential causal relationships between variables from data and construct a causal graph. Nodes in a causal graph represent variables, and edges between nodes represent causal relationships between variables. Typically, when constructing a causal graph, a causal discovery algorithm first identifies possible edges in the graph and then determines a causal estimate for each edge. This estimate assesses the strength of the causal relationship between the two variables connected by the edge. Edges with smaller causal estimates are then deleted, while edges with larger causal estimates are retained, ultimately resulting in a causal graph.

[0004] However, in actual processing environments, there may be multiple causal graphs between multiple variables in a data set, and the causal discovery algorithm can only obtain the causal graph with the strongest causal relationship, and cannot output all the causal graphs. Moreover, the output causal graph may only be a causal graph with an incorrect causal structure composed of multiple strong causal relationships, resulting in low accuracy of the causal discovery algorithm.

[0005] Summary of the Invention

[0006] The present application provides a causal relationship discovery method, system and related equipment for solving the problem that the causal discovery algorithm can only output a single causal graph and the algorithm has low accuracy.

[0007] In a first aspect, a causal relationship discovery method is provided, which includes the following steps: obtaining a data set and a number of groups input by a user, dividing the data set into multiple category groups, wherein the data set includes observation data of multiple objects, each category group in the multiple category groups includes at least one object, and the causal graphs of objects in the same category group are the same, using the multiple category groups to train multiple sub-models, and obtaining a causal graph corresponding to each category group in the multiple category groups, wherein one category group is used to train one sub-model, and one sub-model is used to generate the causal graph of the corresponding category group.

[0008] Implement the method described in the first aspect, divide the data set into multiple category groups, and make the objects in the category groups objects of a common causal graph. Use different category groups to train different sub-models, so that different sub-models can mine the causal graph of the observation data in the corresponding category group, thereby obtaining multiple causal graphs corresponding to the data set. This can solve the problem that the current causal discovery algorithm can only recognize a single causal graph and cannot mine multiple causal graphs from the data.

[0009] In one possible implementation, when multiple sub-models are trained using multiple category groups, a knowledge set input by the user can be first obtained, wherein the observation data of multiple objects include multiple variables, and the knowledge set includes a known causal relationship between at least two of the multiple variables, and then the multiple sub-models are trained using the knowledge set and multiple category groups.

[0010] Furthermore, known causal relationships refer to the known causal relationships between multiple variables in a dataset. Each known causal relationship is obtained based on prior knowledge. This prior knowledge is used to guide the model to discover causal relationships. This prior knowledge can come from the experience of domain experts, domain theories, research results, etc.

[0011] In the above implementation method, when the number of samples in the data set is small, the coverage and diversity of the data will be reduced, and only one-sided or even wrong causal relationships can be discovered through the data set. This application combines prior knowledge with the data set through the knowledge set, which can improve the accuracy of causal discovery in small data volume scenarios.

[0012] In a possible implementation, the known causal relationship includes a first causal relationship with a determined causal direction and a determined quantitative relationship value.

[0013] The causal direction is used to describe how changes in one variable lead to changes in another variable. That is, one variable is considered the cause variable and the other is considered the result variable. The causal direction describes the direction of this causal relationship from the causal variable to the result variable. The causal direction can be unidirectional, indicating that the cause variable affects the result variable. Determining the causal direction means that both the cause variable and the result variable in the causal relationship are determined. For example, rain (the cause) may cause wet ground (the result), but wet ground does not cause rain. Therefore, the causal direction between "precipitation" and "ground humidity" is determined: precipitation → ground humidity.

[0014] A quantitative relationship value is a specific numerical expression of the causal relationship between two variables, used to measure the specific circumstances of the quantitative relationship. A definite quantitative relationship value means that the specific numerical expression is certain. For example, for every 1 unit increase in X, Y increases by 10 units, or A has a 5% impact on B. These examples are for illustrative purposes only and are not intended to be limiting in this application.

[0015] In the specific implementation, for the first causal relationship with determined causal direction and quantitative relationship value, when training each sub-model, the model parameters that control the output of the first causal relationship can be frozen and not participate in the back propagation during the training process. Simply put, part of the parameters of the sub-model are initialized through the first causal relationship, and then during the training process, only the uninitialized parameters are allowed to be adjusted, thereby ensuring that the model parameters that control the output of the first causal relationship will not change with the model training, and ensuring that the causal graph output by the model includes the above-mentioned known first causal relationship.

[0016] It should be understood that the sub-model includes multiple parameters, each of which is used to describe the strength, direction, and type of possible causal relationships between variables. By training the model, the parameters of the model are continuously optimized so that the model can accurately reflect the causal relationship in the input observation data. Therefore, in order to ensure that the causal graph output by the model includes the first causal relationship, the frozen parameters can be parameters related to the first causal relationship, such as freezing the weight of the edge between the two variables of the first causal relationship in the causal graph. The weight of the edge will not be trained during model training, thereby ensuring that the causal graph output by the model includes the first causal relationship determined based on the prior knowledge. Or freeze the elements corresponding to the first causal relationship in the causal adjacency matrix so that it no longer changes with the training of the model. The causal adjacency matrix is ​​usually used to represent the causal relationship between variables during the training process. The rows and columns of the matrix represent different variables, and the elements in the matrix represent the causal relationship between these variables. In the causal adjacency matrix, the element value corresponding to the determined causal direction is represented as a non-zero positive number. On the contrary, if there is a negative causal relationship, the element value is a negative number. The above examples are for illustration and are not specifically limited in this application.

[0017] In one possible implementation, the known causal relationship includes a second causal relationship in which the causal direction is determined and the quantitative relationship value is a non-zero unknown value. The non-zero quantitative relationship value indicates that a certain numerical relationship exists between the two variables, but the relationship cannot be described by a specific numerical value.

[0018] In a specific implementation, when a sub-model is trained using a second causal relationship in which the causal direction is determined and the quantitative relationship value is a non-zero unknown value, a constraint that the causal direction is determined and the quantitative relationship value is non-zero can be set according to the second causal relationship, and then the model is trained in combination with the constraint. It should be understood that since the quantitative relationship value of the second causal relationship is unknown, it is necessary to learn this quantitative relationship value by fitting the data in the data set during the model training process, so that the weight parameters of the model of the second causal relationship are continuously optimized with multiple rounds of training. However, in order to avoid the direction of the second causal relationship from changing during the training process, the constraint on the causal direction is set so that the trained model can output the second causal relationship with the correct causal direction and the quantitative relationship value inferred by the model.

[0019] Furthermore, the aforementioned second causal relationship can be achieved through the following constraints: constraining the elements in the causal adjacency matrix corresponding to the determined direction to be greater than 0, and constraining the elements in the opposite direction to be equal to 0. The causal adjacency matrix is ​​typically used to represent causal relationships. The rows and columns of the matrix represent different variables, and the elements in the matrix represent the causal relationships between these variables. In the causal adjacency matrix, the element value corresponding to the determined causal direction is represented as a non-zero positive number. Conversely, if there is a negative causal relationship, the element value is a negative number.

[0020] It should be understood that setting the element corresponding to the causal relationship to be greater than 0 can ensure the existence of this causal relationship in the forward direction, and setting the element corresponding to the opposite causal relationship to be equal to 0 can ensure the non-existence of this causal relationship in the reverse direction. Such constraint settings can help the sub-model to maintain the causal direction of the secondary causal relationship in the model output during training, even if the model parameters are continuously optimized.

[0021] In one possible implementation, the known causal relationship includes a third causal relationship in which the causal direction is determined but the quantitative relationship value is unknown. The unknown quantitative relationship value means that it is difficult to determine whether there is a numerical relationship between the two variables; there may be a numerical relationship, but the value is unknown; or there may be no numerical relationship at all between the two variables.

[0022] In a specific implementation, when training a sub-model using a third causal relationship with a determined causal direction and an unknown quantitative relationship, a constraint can be set according to the third causal relationship, where the causal direction is determined but the quantitative relationship is not restricted, that is, a constraint that the quantitative relationship may be 0. The model is then trained in conjunction with this constraint. Furthermore, the above-mentioned third causal relationship can be implemented by setting the following constraint: setting the elements in the causal adjacency matrix corresponding to the opposite direction to be determined to be equal to 0. Referring to the above content, it can be seen that in the causal adjacency matrix, the element values ​​corresponding to the determined causal direction are represented as non-zero positive numbers. Conversely, if there is a negative causal relationship, the element value is negative. Therefore, by not constraining the positive elements and only constraining the reverse elements to 0, the third causal relationship can be guaranteed to have no reverse causal relationships. At the same time, by not constraining the positive causal relationship, the model can learn the quantitative relationship in the third causal relationship by fitting the dataset. The positive direction may be 0 or a certain positive value. Such constraint setting can help the sub-model maintain the causal direction of the third causal relationship output by the model during training, even if the model parameters are continuously optimized.

[0023] It should be noted that at least one known causal relationship in the knowledge set can be one or more of the first causal relationship, the second causal relationship, and the third causal relationship. Each known causal relationship can be a causal relationship between two variables, or a causal relationship between more than two variables, that is, a causal diagram. This application does not make specific limitations.

[0024] The above implementation method trains the sub-model by combining the knowledge set and the data set, and the knowledge set includes at least one known causal relationship. These known causal relationships are at least causal relationships with determined causal directions, which can provide guidance for the training of the sub-model. When the data set has a small amount of data, the coverage and diversity of the data will be reduced, and only one-sided or even erroneous causal relationships can be discovered through the data set alone. This application combines prior knowledge with the data set through the knowledge set, which can improve the accuracy of causal discovery in small data volume scenarios.

[0025] In one possible implementation, multiple category groups are used to train multiple sub-models. When obtaining the causal graph corresponding to each category group in the multiple category groups, the penalty threshold input by the user can be first obtained, and then executed on any first model in the multiple sub-models: the category group corresponding to the first model is used to perform multiple rounds of training on the first model. When the gap between the current output result of the first model and the output result of the previous round of training is not less than the penalty threshold, the current output result is used as the penalty parameter to perform the next round of training on the first model. The penalty parameter is used to constrain the range of variation of the model parameters of the first model in the next round of training. The larger the penalty parameter, the smaller the constraint on the range of variation. When the gap between the output result of the first model and the output result of the previous round is less than the penalty threshold, the causal graph corresponding to each category group in the multiple category groups is obtained according to the output result of the first model.

[0026] Simply put, when the difference between the estimated value output by the model and the estimated value output in the previous round is not less than the penalty threshold, the estimated value output in this round is used as the penalty parameter for the next round of training, and so on for multiple rounds of training until the difference between the estimated value output by the current round and the estimated value output in the previous round is less than the penalty threshold.

[0027] In the above implementation method, when the model estimates the causal relationship between variables, due to factors such as data noise and insufficient sample size, the individual estimated values ​​output by the model may have certain deviations. This deviation may affect the accuracy of causal discovery, making it possible for the algorithm to fail to fully capture the true causal structure. However, by using the estimated value of this round as a penalty parameter, this application can achieve the goal of imposing lower penalties on larger parameter values ​​and higher penalties on smaller parameter values, so that the model can adjust the parameter update amplitude according to the output of the estimated value during the training process. The adjustment amplitude of the model during multiple rounds of training is more stable. Even if an erroneous estimated value occurs, it will not cause a large swing in the parameter due to this erroneous estimated value, thereby achieving the effect of correction.

[0028] In one possible implementation, when dividing a data set into multiple category groups, the data set is first divided into multiple initial category groups according to the number of groups input by the user, and then multiple sub-models are trained using the multiple initial category groups to obtain multiple initial causal graphs, wherein one initial category group is used to train one sub-model, and the observation data of each of the multiple objects is substituted into the multiple initial causal graphs to obtain multiple substitution results for each object. Finally, based on the multiple substitution results of each object, the category group to which each object belongs is determined to obtain multiple category groups of the data set.

[0029] Optionally, the observation data of each object can be substituted into each initial causal graph, and the category group corresponding to each object can be determined based on the substitution result of each initial causal graph, and then the multiple initial category groups can be updated. In a specific implementation, the loss value of each initial causal graph can be determined based on the substitution result of each initial causal graph, and then the category group corresponding to the initial causal graph with the smallest loss value can be determined as the category group of the object. For example, the observation data of object A is substituted into k initial causal graphs to obtain k loss values. The minimum value of the k loss values ​​is the loss value of causal graph 3. Then, category group 3 corresponding to causal graph 3 is the category group corresponding to object A. Similarly, the category groups corresponding to the observation data of other objects can be obtained, thereby obtaining multiple updated category groups.

[0030] It should be understood that each initial causal graph is generated after training the sub-model using category groups. Model parameters are updated by minimizing the loss function. The smaller the loss function, the better the model fits the underlying causal structure in the observed data, and the more accurately the causal graph generated by the model can describe the causal relationships between the observed data. Therefore, the smaller the loss value obtained by substituting the observed data of each object into the causal graph, the more closely the causal relationship described by the causal graph fits the causal relationship implied by the observed data of that object. Updating the objects in each category group in this way ensures that the multiple objects in the resulting category group share a common causal graph, and that objects in different category groups have different causal graphs.

[0031] Optionally, after updating the category groups and obtaining multiple updated category groups, each updated category group can be used to train the corresponding sub-model, and then multiple updated initial causal graphs can be obtained. The observation data of each object is then substituted into the updated multiple initial causal graphs, and the category group of each object is determined based on the loss values ​​of the multiple initial causal graphs. This process is repeated until the preset conditions are met, and multiple causal graphs corresponding to the multiple category groups are obtained. The preset conditions here can be the number of updates, or it can be that the objects in the category group no longer change after x consecutive rounds of updates, such as x being 2. This is not specifically limited in this application.

[0032] The above implementation method, through multiple rounds of updates to the category groups, allows objects sharing the same causal graph to be gradually divided into the same category group, and uses the observation data of the objects sharing the same causal graph to train the sub-model. In this way, even if the causal relationship in the causal graph of this category group is weak, the corresponding causal graph can be output, thereby solving the problem that the current causal discovery algorithm can only generate a single causal graph, and also solving the problem that the current causal discovery algorithm is prone to causal structure fusion.

[0033] In one possible implementation, data to be processed input by a user is obtained, the data to be processed including observation data of multiple objects to be processed, the observation data of the multiple objects to be processed are substituted into multiple causal graphs, and multiple substitution results of each of the multiple objects to be processed are obtained, and based on the multiple substitution results of each object to be processed, the category group to which each object to be processed belongs is determined, and based on the causal graph corresponding to the category group to which each object to be processed belongs, one or more causal graphs corresponding to the data to be processed are determined.

[0034] Optionally, the observation data of each object to be processed can be substituted into multiple causal graphs respectively, and the category group corresponding to each object to be processed can be determined according to the loss value of each causal graph. In a specific implementation, the category group corresponding to the causal graph with the smallest loss value is the category group corresponding to the object to be processed.

[0035] In the above implementation method, for new data to be processed, each object to be processed in the data to be processed can be substituted into multiple causal graphs to determine the most suitable causal graph for each object to be processed, thereby determining one or more causal graphs corresponding to the data to be processed. This method enables new data to be quickly discovered, and the discovered causal graph is not a single causal graph. The accuracy and efficiency of causal discovery are very high.

[0036] In a second aspect, a causal relationship discovery system is provided, which includes: an acquisition unit for acquiring a data set and a number of groups input by a user, dividing the data set into multiple category groups, wherein the data set includes observation data of multiple objects, each category group in the multiple category groups includes at least one object, and the causal graphs of objects in the same category group are the same; a training unit for training multiple sub-models using the multiple category groups to obtain a causal graph corresponding to each category group in the multiple category groups, wherein one category group is used to train one sub-model, and one sub-model is used to generate the causal graph of the corresponding category group.

[0037] Implement the system described in the second aspect, divide the data set into multiple category groups, and make the objects in the category groups objects of the common causal graph. Use different category groups to train different sub-models, so that different sub-models can mine the causal graph of the observation data in the corresponding category group, thereby obtaining multiple causal graphs corresponding to the data set. This can solve the problem that the current causal discovery algorithm can only recognize a single causal graph and cannot mine multiple causal graphs from the data.

[0038] In one possible implementation, the system also includes a knowledge injection unit and an acquisition unit for acquiring a knowledge set input by a user, wherein the observation data of multiple objects include multiple variables, the knowledge set includes a known causal relationship between at least two of the multiple variables, and the knowledge injection unit is used to train multiple sub-models using the knowledge set and multiple category groups.

[0039] In a possible implementation, the known causal relationship is obtained based on prior knowledge, and the known causal relationship includes a first causal relationship with a determined causal direction and a determined quantitative relationship value.

[0040] In a possible implementation, the known causal relationship includes a second causal relationship in which the causal direction is determined and the quantitative relationship value is a non-zero unknown value.

[0041] In a possible implementation, the known causal relationship includes a third causal relationship with a determined causal direction and an unknown quantitative relationship value.

[0042] In one possible implementation, the system also includes a penalty unit, an acquisition unit for acquiring a penalty threshold input by a user, and a penalty unit for executing on any first model among multiple sub-models: performing multiple rounds of training on the first model using the category group corresponding to the first model, and when the gap between the current output result of the first model and the output result of the previous round of training is not less than the penalty threshold, using the current output result as a penalty parameter to perform the next round of training on the first model, the penalty parameter is used to constrain the range of variation of the model parameters of the first model in the next round of training, the larger the penalty parameter, the smaller the constraint on the range of variation, and when the gap between the output result of the first model and the output result of the previous round is less than the penalty threshold, obtaining a causal graph corresponding to each category group in the multiple category groups based on the output result of the first model.

[0043] In one possible implementation, the system also includes a grouping unit and a grouping update unit. The grouping unit is used to divide the data set into multiple initial category groups according to the number of groups input by the user. The training unit is used to train multiple sub-models using the multiple initial category groups to obtain multiple initial causal graphs, wherein one initial category group is used to train one sub-model. The grouping update unit is used to substitute the observation data of each of the multiple objects into the multiple initial causal graphs to obtain multiple substitution results for each object. The grouping update unit is used to determine the category group to which each object belongs based on the multiple substitution results of each object to obtain multiple category groups of the data set.

[0044] In one possible implementation, the system also includes an output unit and a group prediction unit. The acquisition unit is further used to obtain the data to be processed input by the user, and the data to be processed includes observation data of multiple objects to be processed. The group prediction unit is used to substitute the observation data of the multiple objects to be processed into multiple causal graphs to obtain multiple substitution results for each of the multiple objects to be processed. The group prediction unit is used to determine the category group to which each object to be processed belongs based on the multiple substitution results of each object to be processed. The output unit is used to determine one or more causal graphs corresponding to the data to be processed based on the causal graph corresponding to the category group to which each object to be processed belongs.

[0045] In a third aspect, a computing device is provided, which includes a processor and a memory, wherein the memory is used to store instructions and the processor is used to execute instructions, so that the computing device implements the method described in the first aspect.

[0046] In a fourth aspect, a computing device cluster is provided, which includes at least one computing device, each of the at least one computing device includes a processor and a memory, and the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster implements the method described in the first aspect.

[0047] In a fifth aspect, a computer-readable storage medium is provided, in which instructions are stored. When the instructions are executed by a computing device or a computing device cluster, the method described in the first aspect is implemented.

[0048] In a sixth aspect, a computer program product comprising instructions is provided, wherein the computer program product includes instructions that can be run on a computing device or stored in software or program products in any available medium, and when the computer program product is run on a computing device or a computing device cluster, the computing device or computing device cluster executes the method described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] FIG1 is an architecture diagram of a causal relationship discovery system provided by the present application;

[0050] FIG2 is a schematic diagram of the structure of the causal relationship discovery system provided by the present application;

[0051] FIG3 is a flowchart of the steps of a causal relationship discovery method provided by the present application in the training phase;

[0052] FIG4 is a schematic diagram of the training process of each sub-model in the causal relationship discovery method provided by this application;

[0053] FIG5 is a schematic diagram of the steps of a causal relationship discovery method provided by the present application in the reasoning stage;

[0054] FIG6 is a schematic diagram of an interface provided by this application;

[0055] FIG7 is a schematic diagram of the structure of a computing device provided by the present application. DETAILED DESCRIPTION

[0056] First, the application scenario "causal discovery" involved in this application is explained.

[0057] Causal discovery is a key step in causal AI (Causal AI). Causal AI is a technology that leverages causal relationships to improve the predictive and decision-making capabilities of artificial intelligence systems. It helps AI models better understand the causal relationships between variables, thereby improving the models' predictive and decision-making capabilities and addressing issues such as fault link detection, drug efficacy inference, and risk attribution. Causal AI includes two key steps: causal discovery and causal inference. Causal discovery is used to identify potential causal relationships between variables in data and construct a causal graph. Causal inference is used to evaluate, infer, or analyze causal relationships based on causal graphs. For example, it can determine whether the causal relationships in the graph actually exist and the strength of these relationships, thereby improving the accuracy of AI predictions and decisions.

[0058] For example, causal discovery can determine the existence of a causal relationship between advertising and sales. Causal inference can then be used to estimate the reliability and strength of this causal relationship. Reliability refers to whether the causal relationship between advertising and sales remains stable across different scenarios, while strength refers to the extent of the impact of advertising on sales. It should be understood that while causal discovery can establish a causal relationship between advertising and sales, causal inference techniques are still needed to control for other potential confounding factors to ensure the accuracy of the resulting causal relationship.

[0059] Therefore, causal discovery focuses on exploring and discovering causal relationships in large-scale data, while causal inference focuses on evaluating, analyzing, and reasoning about known causal relationships. Causal discovery is the foundation of causal inference, and obtaining a causal graph from observational data is an important research area. Typically, when constructing a causal graph, causal discovery can first identify the possible edges in the graph and then determine the causal estimate for each edge. This causal estimate is used to assess the strength of the causal relationship between the two variables connected by the edge. Edges with smaller causal estimates are then deleted, while edges with larger causal estimates are retained, thus obtaining a causal graph.

[0060] However, such an algorithm can only obtain one causal graph between multiple variables. In the actual processing environment, there may be multiple causal graphs between multiple variables in the data set. The causal discovery algorithm can only obtain a causal graph that contains strong causal relationships, thereby missing other causal graphs that may have weak causal relationships, and may even form an erroneous causal graph composed of multiple strong causal relationships.

[0061] At the same time, such algorithms require a large amount of data support. When the number of samples is small, the coverage and diversity of the data will be reduced. The causal relationship obtained by using the causal discovery algorithm in this scenario is often one-sided and erroneous, which makes the causal discovery algorithm dependent on large amounts of data and insufficient in dealing with small amounts of data. Most application scenarios have the problems of high data collection costs and difficulty in obtaining data, resulting in poor stability and low accuracy of the causal discovery algorithm.

[0062] In summary, current causal discovery algorithms can only identify one causal graph in a data set, which is prone to causal graph omissions. In addition, the accuracy of the algorithm depends on the amount of data. In scenarios with small data volumes, the stability and accuracy of the algorithm are difficult to guarantee, which limits the causal discovery algorithm.

[0063] In order to solve the problem that the above-mentioned causal discovery algorithm can only identify a single causal graph and cannot mine multiple causal graphs from the data, and relies on a large amount of data, and the stability and accuracy of the algorithm are difficult to guarantee in a small data volume scenario, the present application provides a causal relationship discovery system, which divides the data set into multiple category groups, and makes the objects in the category group objects that share the causal graph. Different sub-models are trained using different category groups, so that different sub-models can mine the causal graph of the observation data in the corresponding category group, thereby obtaining multiple causal graphs corresponding to the data set. This can solve the problem that the current causal discovery algorithm can only identify a single causal graph and cannot mine multiple causal graphs from the data. At the same time, each sub-model is combined with a knowledge set to train the model. The knowledge set includes multiple known causal relationships determined by causal directions. These known causal relationships can provide guidance for the training of the sub-models, which can improve the accuracy of causal discovery in a small data volume scenario. Finally, during the training process, each sub-model uses the estimated value of this round as the penalty parameter for the next round of training, with the goal of imposing lower penalties on larger parameter values ​​and higher penalties on smaller parameter values. This allows the model to adjust the parameter update amplitude according to the estimated value output during training. The adjustment amplitude of the model is more stable during multiple rounds of training. Even if an incorrect estimated value occurs, the parameter will not swing significantly due to this incorrect estimated value, thereby achieving the effect of correction and ensuring the accuracy of the causal discovery algorithm.

[0064] The causal relationship discovery system provided by this application is explained below with reference to the accompanying drawings.

[0065] FIG1 is an architecture diagram of a causal relationship discovery system provided by the present application, which includes a client 100, a causal relationship discovery system 200, and a storage system 300. The client 100, the causal relationship discovery system 200, and the storage system 300 establish a communication connection through a network, which can be a wired connection or a wireless connection, which is not specifically limited in the present application. The number of clients 100 and storage systems 300 that establish a communication connection with the causal relationship discovery system 200 can be one or more, which is not specifically limited in the present application.

[0066] The client 100 is used to implement human-computer interaction and can be deployed on terminal devices, including personal computers, smart phones, wearable devices, handheld processing devices, tablet computers, mobile notebooks, augmented reality (AR) devices, virtual reality (VR) devices, integrated handheld devices, wearable devices, vehicle-mounted devices, smart conferencing devices, smart advertising devices, smart home appliances, etc. Smart home appliances can be sweeping robots, mopping robots, etc., which are not specifically limited here.

[0067] In a specific implementation, the above-mentioned client 100 can be a software or application running on a terminal device or computing device controlled by the user, such as a personal computer (PC) client, or a web client accessed based on a browser, or an application (APP) client running on a mobile terminal. This application does not make specific limitations.

[0068] Optionally, the client 100 can be a data analysis client for obtaining causal relationships between data. In specific implementations, in different application scenarios, the client 100 is used to identify different types of causal relationships. For example, in the field of public health, the client 100 can analyze epidemic data to determine the causal relationship between the vaccination of a certain vaccine and the spread of the epidemic, helping decision makers to formulate immunization strategies; in the financial field, the client 100 can analyze financial data to determine the causal relationship between GDP and stock market indices. These causal relationships can be used to predict and manage risks in the financial market so that investors and financial institutions can make corresponding decisions and risk management strategies; in the field of marketing, the client 100 can analyze business data to determine the causal relationship between product sales and advertising channels and promotion strategies, thereby providing companies with better marketing and advertising strategies; in the field of autonomous driving, the client 100 can analyze vehicle sensor data, such as cameras, radars, accelerometers, etc., to determine the causal relationship between different sensor data and the vehicle's acceleration, steering, and braking behaviors. This causal relationship can be used to improve the vehicle's control algorithm and response speed, thereby improving the system's safety and driving comfort. It should be understood that the above examples are for illustrative purposes only and are not specifically limited in this application.

[0069] Optionally, client 100 can also be some application clients that need to use the causal discovery function. For example, in the financial field, client 100 can be a client that recommends stock purchase strategies. The client can analyze financial data, determine the causal relationship between some variables and stock market indexes, and predict risks in the financial market based on these causal relationships to generate stock purchase strategies; for example, in the field of autonomous driving, client 100 can be a client on an autonomous driving vehicle. The client can analyze sensor data, determine the causal relationship between different sensor data and the vehicle's acceleration, steering, braking and other behaviors, and improve the vehicle's control algorithm and response speed based on these causal relationships, thereby improving the system's safety and driving comfort. The above examples are for illustration only and are not specifically limited in this application.

[0070] Optionally, the client 100 can also be a console of the cloud platform, which provides users with causal discovery functions as a sub-service of the cloud platform. Users can use the causal relationship discovery method provided by this application by purchasing cloud services. In a specific implementation, users can purchase the training service of the causal relationship discovery method provided by this application. The cloud platform can provide users with a training platform. Users can use the training platform to input parameters such as knowledge sets, data sets, and number of groups based on business needs. The cloud platform uses the causal relationship discovery method provided by this application to train the causal discovery model. Users can also purchase the reasoning service of the causal relationship discovery method provided by this application. The cloud platform can provide users with a trained causal discovery model. Users can input the data to be processed into the causal discovery model to obtain multiple causal graphs of the data to be processed. Users can choose to use the training service and / or reasoning service based on their own business needs, which is not specifically limited in this application. In a specific implementation, the console can be a web-based client, an application client, or an application programming interface (API), which is not specifically limited in this application.

[0071] The causal relationship discovery system 200 is configured to receive a data set, a knowledge set, a penalty threshold, and training parameters sent by the client 100, train a causal discovery model using the data set, the knowledge set, the penalty threshold, and the number of groups, obtain at least one causal graph for the data to be processed, each causal graph including multiple causal relationships, and then return the at least one causal graph to the client 100. In some application scenarios, the causal relationship discovery system 200 may also send the at least one causal graph to the storage system 300 for storage.

[0072] The storage system 300 is used to receive and store at least one causal graph sent by the causal relationship discovery system 200. In a specific implementation, the storage system 300 can be a database, a file system, or a cloud storage system, etc., which is not specifically limited in this application.

[0073] Furthermore, the storage system 300 can be connected to the causal reasoning system and send at least one stored causal graph to the causal reasoning system. The system can evaluate, verify and further reason on the above-mentioned at least one causal graph, such as inferring whether the causal relationship in each causal graph really exists and the strength of this causal relationship, etc., to obtain a causal inference result. The causal reasoning system can feed back the causal inference result to the client 100, or send the causal inference result to the decision system to generate a decision result. The decision systems in different application scenarios may be different. For example, the decision system in the above-mentioned autonomous driving scenario can improve the vehicle's control algorithm and reaction speed based on these causal relationships, thereby improving the system's safety and driving comfort, or the decision system in the above-mentioned financial scenario can predict risks in the financial market based on these causal relationships and generate stock purchase strategies, etc. This application does not make specific limitations.

[0074] The causal relationship discovery system 200 and storage system 300 can be deployed on computing devices, computing device clusters, or terminal devices. Computing devices include bare metal servers (BMSs), virtual machines, containers, or edge computing devices. A BMS refers to a general-purpose physical server, such as an ARM server or an X86 server. A virtual machine is a complete computer system with complete hardware system functionality, running in a completely isolated environment, simulated by software. Any work that can be performed on a physical computer can also be performed on a virtual machine. When creating a virtual machine on a computing device, part of the physical machine's hard disk and memory capacity is used as the virtual machine's hard disk and memory capacity. Each virtual machine has an independent basic input / output system (CMOS), hard disk, and operating system, allowing it to be operated like a physical machine. A container is a portable software unit that combines an application and all its dependencies into a single software package. This package is not restricted by the underlying host operating system, eliminating the need to build a complex environment and simplifying the application development and deployment process. Edge computing devices are devices that are closer to data sources and end users and feature low latency and high bandwidth, such as smart routers and edge servers. The computing device cluster may include multiple computing devices as described above, such as a data center, which is not specifically limited in this application; the description of the terminal device can refer to the above content and will not be repeated here.

[0075] Optionally, the causal relationship discovery system 200 can be deployed on the same terminal device as the client 100; or, the causal relationship discovery system 200 is deployed on a computing device, and the client 100 is deployed on a terminal device; or, the causal relationship discovery system 200 is deployed on a computing device cluster, and the client 100 is deployed on a terminal device. It should be understood that the above examples are for illustration only, and the specific deployment of the causal relationship discovery system 200 and the client 100 can be determined based on the actual application scenario.

[0076] Optionally, the causal relationship discovery system 200 and the storage system 300 can be deployed on the same computing device; or, the causal relationship discovery system 200 and the storage system 300 can be deployed on different computing devices in the same computing device cluster; or, the causal relationship discovery system 200 and the storage system 300 can be deployed on different computing devices in different computing device clusters. This application does not make specific limitations. For example, the causal relationship discovery system 200 can be any one in a data center, and the storage system 300 can be deployed on another computing device in the data center, or the storage system 300 can be deployed in another data center. The above examples are for illustration only and are not specifically limited in this application.

[0077] Furthermore, the causal relationship discovery system 200 in FIG2 can be further divided into multiple unit modules. For example, FIG2 is a schematic diagram of the structure of the causal relationship discovery system 200 provided by this application. As shown in FIG2, the causal relationship discovery system 200 may include an acquisition unit 211, a grouping unit 212, a training unit 213, a knowledge injection unit 214, a penalty unit 215, a grouping update unit 216, a grouping prediction unit 217, and an output unit 218. It should be understood that FIG2 is an exemplary division method, and the causal relationship discovery system 200 may also include more or fewer units, which is not specifically limited in this application.

[0078] Among them, the acquisition unit 211, grouping unit 212, training unit 213, knowledge injection unit 214, penalty unit 215, group update unit 216, group prediction unit 217, and output unit 218 can be implemented by software or hardware. For example, the implementation of the training unit 213 is described below using the training unit 213 as an example. Similarly, the implementation of the acquisition unit 211, grouping unit 212, knowledge injection unit 214, penalty unit 215, group update unit 216, group prediction unit 217, and output unit 218 can refer to the implementation of the training unit 213.

[0079] As an example of a software functional unit, training unit 213 may include code running on a computing instance. A computing instance may include at least one of a physical host (computing device), a virtual machine, or a container. Furthermore, the computing instance may be one or more. For example, training unit 213 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers running the code may be deployed in the same data center or in different data centers. When the multiple hosts / virtual machines / containers running the code are deployed in different data centers, the different data centers may be located in the same region or in different regions. A region describes the location of a data center. Data centers within the same region share common services such as elastic computing, block storage, and object storage. The different data centers may also be located in the same availability zone (AZ) or in different AZs. Each AZ includes one data center or multiple geographically close data centers. An AZ is a collection of one or more physical data centers, and computing, network, storage, and other resources within the AZ are logically divided into multiple clusters. Typically, a region can include multiple AZs, and multiple AZs in a region are connected via high-speed optical fibers to meet users' needs for building high-availability systems across AZs.

[0080] The training unit 213 is an example of a hardware functional unit. The training unit 213 can also be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. For example, the training unit 213 can be implemented by a data processing unit (DPU), which is not limited in this application.

[0081] It should be noted that the structure shown in Figure 2 can be an implementation method of deploying the causal relationship discovery system 200 on a single computing device. When the causal relationship discovery system 200 is deployed on a computing device cluster composed of multiple computing devices, different computing devices in the computing device cluster can respectively store instructions for implementing the functions of the acquisition unit 211, the grouping unit 212, the training unit 213, the knowledge injection unit 214, the penalty unit 215, the group update unit 216, the group prediction unit 217 and the output unit 218. For example, the computing device A in the computing device cluster stores instructions for implementing the acquisition unit 211, the grouping unit 212, the training unit 213, the knowledge injection unit 214, the penalty unit 215 and the group update unit 216, and the computing device B stores instructions for implementing the functions of the group prediction unit 217 and the output unit 218. Of course, different computing devices may also store the same instructions. For example, computing device A and computing device C both store instructions of the acquisition unit 211, the grouping unit 212, the training unit 213, the knowledge injection unit 214, the penalty unit 215, and the grouping update unit 216, which are used to combine and implement the functions of the above-mentioned acquisition unit 211, the grouping unit 212, the training unit 213, the knowledge injection unit 214, the penalty unit 215, and the grouping update unit 216. This application does not make specific limitations.

[0082] The functions of each unit module in the causal relationship discovery system 200 are described below.

[0083] The acquisition unit 211 is used to acquire a data set.

[0084] In an embodiment of the present application, a data set includes multiple observation data, which may include feature variables, target variables, and confounding variables. Feature variables are input variables used to infer causal relationships, target variables are variables that are expected to be predicted or inferred, that is, predicted results, and confounding variables are other variables that may affect the relationship between feature variables and target variables. In some embodiments, the data set may also include irrelevant variables, which may be irrelevant to the causal relationship between feature variables and target variables, or have little impact on the causal relationship, but still exist in the data. For example, in the example of autonomous driving, feature variables may be vehicle acceleration, speed, road conditions, traffic signs, etc., target variables may be predicted results of vehicle behavior, such as braking, steering, etc., confounding variables may be vehicle model, load, weather conditions, etc., and irrelevant variables may be license plate number, vehicle color, air conditioning temperature, etc. It should be understood that the above examples are for illustrative purposes only and are not specifically limited in this application.

[0085] Furthermore, the multiple observation data in the dataset can be observation data from multiple objects, where each object refers to a single observation unit, individual or entity in the dataset. For example, an object can be a person, a car, a family, a company, etc., depending on the actual application scenario. Objects usually have unique identifiers or identities to distinguish the observation data of different objects. In a specific implementation, the above-mentioned multiple observation data can also be data obtained by multiple observations of each object. For example, a dataset includes y observation data of x objects, and the observation data of each object can include the above-mentioned feature variables, target variables, interference variables and irrelevant variables.

[0086] For example, in the aforementioned autonomous driving scenario, a dataset consists of multiple observations of multiple entities (Car A, Car B, and Car C). Each entity records the vehicle's acceleration, speed, road conditions, and traffic signs at different times, as well as corresponding vehicle behaviors such as braking and steering. Furthermore, the data also records the prevailing weather conditions, load, vehicle model, license plate number, vehicle color, and air conditioning temperature. A causal discovery model can use this data to derive causal relationships between variables and analyze the impact of each factor on vehicle behavior, enabling autonomous driving. For another example, in a financial scenario, a dataset consists of multiple observations of multiple entities (Company A, Company B, and Company C). Each observation can be obtained from each entity's quarterly or annual report. Each observation includes one or more of the following: financial data (such as sales, profit, and R&D expenditures), operating data (such as number of employees, number of product launches, and customer satisfaction), and financial index data (such as overall industry growth rate, GDP, and inflation rate). A causal discovery model can use this data to derive causal relationships between variables and analyze the correlation and impact between different companies' financial decisions and financial indices.

[0087] Furthermore, there may be at least one causal graph for multiple observation data in a data set, and each causal graph may include a causal structure and a quantitative relationship value, wherein the causal structure describes the causal relationship between variables, and the quantitative relationship value describes the strength of these causal relationships. In a specific implementation, different objects may correspond to the same or different causal graphs. In other words, some objects in a data set can share a causal graph, while the causal graphs of the observation data of some objects are different and cannot share a causal graph. It should be noted that at least one causal graph existing in the observation data is unknown, and it is necessary to infer at least one causal graph existing in the observation data through the causal discovery algorithm provided in this application.

[0088] Alternatively, different objects may correspond to different causal graphs. This may be due to different causal structures for the different objects. For example, in the medical field, certain drugs may be effective for young people but not for older people. Therefore, the causal graph for young people includes the causal relationship between the drug and the treatment effect, while the causal graph for older people does not. The objects here refer to people of different ages, and the causal graphs for different objects in this application scenario may differ. For example, in a financial scenario, if Company A is a large company and Company B is a small company, then some financial indicators of Company A may influence its business decisions, while some may not. The objects here refer to different companies, and the causal structures of different objects in this application scenario vary, resulting in different causal graphs.

[0089] Alternatively, different causal graphs may differ for different objects because the causal structures are the same but the quantitative relationship values ​​differ, meaning the strength of the causal relationships differs. For example, consider the same causal structure: vehicle speed → fuel consumption. This means that vehicle speed affects fuel consumption. For small cars, an increase in speed leads to increased fuel consumption. However, for large trucks, since they frequently use highways, most trucks have energy-efficient designs, resulting in a relatively small impact of vehicle speed on fuel consumption. Therefore, in this example, the causal structures for different individuals are the same but the quantitative relationship values ​​differ, resulting in different causal graphs. For another example, consider the same causal structure: exercise frequency → weight. This means that exercise frequency affects weight. However, for person A, an increase in exercise frequency directly leads to a significant weight loss. For person B, an increase in exercise frequency has a smaller impact, and they may need to incorporate additional dietary and lifestyle changes to achieve weight loss. The different causal graphs may be due to differences in metabolism and physical condition between person A and person B. This results in different causal graphs for different individuals in this application scenario, even though the causal structures are the same, the quantitative relationship values ​​differ. The above examples are for illustration only and are not intended to be limiting in this application.

[0090] It is understandable that since multiple observation data in a data set may include multiple causal graphs, if the traditional causal discovery method described in the background technology is used to process them, only a causal graph consisting of multiple strong causal relationships can be obtained in the end. This causal graph may be the causal graph of a certain object, or it may be an erroneous causal graph that does not belong to any object and is pieced together by multiple strong causal relationships. In order to solve this problem, the present application divides the observation data into multiple category groups through the grouping unit 212 and the grouping update unit 216, so that the observation data of objects that share the causal graph can be divided into one category group, and objects that do not share the causal graph are divided into different category groups. Then, the training unit 213 uses the observation data of multiple category groups to train multiple sub-models, one category group corresponds to one sub-model, thereby obtaining multiple causal graphs corresponding to the multiple category groups, that is, multiple causal graphs corresponding to the data set. The following is a detailed explanation of how the grouping unit 212, the grouping update unit 216, and the training unit 213 implement the above process.

[0091] In one possible implementation, acquisition unit 211 is further configured to obtain a grouping number input by a user, and grouping unit 212 is configured to group the multiple observations in the dataset into multiple category groups based on the grouping number, where each category group includes observations of at least one object. Each object has its corresponding category group. Grouping update unit 216 is configured to update the multiple category groups generated by grouping unit 212. In a specific implementation, grouping update unit 216 can combine multiple rounds of training by training unit 213 to perform multiple rounds of updates on the multiple category groups, ensuring that the objects in each category group are multiple objects that share a common causal graph.

[0092] In a specific implementation, the grouping unit 212 can determine a corresponding number of category groups based on the number of groups, and then randomly allocate the observation data of the objects within each category group. For example, the observation data of multiple objects can be randomly allocated into the multiple category groups using a sampling method without replacement. Of course, other sampling methods can also be used to implement the above process, and this application does not specifically limit this.

[0093] Optionally, the grouping unit 212 may also allocate the observation data of the objects in each category group according to preset rules, so that the objects sharing the causal graph are allocated to the same category group as much as possible. The preset rules may be determined according to the actual application scenario. For example, the preset rules may be to group company objects of the same size and similar fields into one category group, or to group vehicle objects of the same brand and similar configuration into one category group, or to group user objects in the same region into one category group, etc. Specifically, according to the actual application scenario, multiple objects that may share the causal graph may be placed in the same category group, and this application does not limit this.

[0094] It should be noted that the user can input the number of groups based on the actual application scenario and experience. For example, based on the deviation of the objects in the observed data, it is determined that the number of possible causal graphs is at least 2, and then the number of groups input is also at least 2. The user can also input the number of groups to obtain the training results, and then adjust the number of groups according to the training results until the best training results are achieved. For example, if the number of groups input is 10, and the training results show that 2 of the 10 causal graphs obtained are the same or similar, in other words, these two causal graphs not only have the same or similar causal structures, but also the same or similar quantitative relationship values, then the user can change the number of groups from 10 to 8, and then use the number of groups 8 for further training. The above examples are for illustration only and are not specifically limited in this application.

[0095] The training unit 213 is used to train the causal discovery model 220 using observation data of multiple category groups to obtain multiple initial causal graphs, wherein the causal discovery model 220 includes multiple sub-models, and one category group is used to train one sub-model to obtain the initial causal graph of the corresponding category group.

[0096] In a specific implementation, the training unit 213 can use the observation data of category group 1 to train the group 1 sub-model to obtain the causal graph 1 of category group 1, and use the observation data of category group 2 to train the group 2 sub-model to obtain the causal graph 2 of category group 2, and so on. K category groups can obtain k causal graphs. In addition, the above training process can be trained in parallel according to the processing power. Among them, the above sub-models may include but are not limited to convolutional neural networks (CNN), recurrent neural networks (RNN), graph neural networks (GNN), long short-term memory networks (LSTM), etc., which are not specifically limited in this application. At the same time, when using k category groups to train k sub-models, some causal discovery algorithms can be selected according to the application scenario, such as PC, FCI, Notears, Notears-MLP, etc., which are not specifically limited in this application.

[0097] It should be noted that the causal discovery algorithm used by different sub-models is the same, but the observation data used to train different sub-models is different. One category group is used to train one sub-model, so that each sub-model can generate an initial causal graph for the corresponding category group, thereby obtaining multiple initial causal graphs of the data set.

[0098] The grouping updating unit 216 is used to update the objects in the category group according to the multiple initial causal graphs obtained by the training unit 213, and determine the category group corresponding to the observation data of each object.

[0099] Optionally, group updating unit 216 may substitute the observed data of each object into each initial causal graph and, based on the substitution results for each initial causal graph, determine the category group corresponding to each object. In a specific implementation, the loss value for each initial causal graph may be determined based on the substitution results for each initial causal graph. The category group corresponding to the initial causal graph with the smallest loss value is then determined as the category group for the object. For example, if the observed data of object A is substituted into k initial causal graphs to obtain k loss values, and the minimum of these k loss values ​​is the loss value of causal graph 3, then category group 3 corresponding to causal graph 3 is the category group corresponding to object A. Similarly, the category groups corresponding to the observed data of other objects can be obtained, thereby obtaining multiple updated category groups.

[0100] It should be understood that each initial causal graph is generated after training the sub-model using category groups. Model parameters are updated by minimizing the loss function. The smaller the loss function, the better the model fits the underlying causal structure in the observed data, and the more accurately the causal graph generated by the model can describe the causal relationships between the observed data. Therefore, the smaller the loss value obtained by substituting the observed data of each object into the causal graph, the more closely the causal relationship described by the causal graph fits the causal relationship implied by the observed data of that object. Updating the objects in each category group in this way ensures that the multiple objects in the resulting category group share a common causal graph, and that objects in different category groups have different causal graphs.

[0101] Optionally, the grouping update unit 216 updates the category groups to obtain multiple updated category groups. The training unit 213 can use each updated category group to train the corresponding sub-model, and then obtain multiple updated initial causal graphs. The observation data of each object is then substituted into the multiple updated initial causal graphs, and the category group of each object is determined based on the loss values ​​of the multiple initial causal graphs. This process is repeated until a preset condition is met, and multiple causal graphs corresponding to the multiple category groups are obtained. The preset condition here can be the number of updates, or it can be that the objects in the category group do not change after x consecutive rounds of updates, for example, x is 2. This is not specifically limited in this application.

[0102] It should be understood that through multiple rounds of updates to the category groups, objects sharing the causal graph can be gradually divided into the same category group, and the sub-model can be trained using the observation data of the objects sharing the causal graph. In this way, even if the causal relationship in the causal graph of this category group is weak, the corresponding causal graph can be output, thereby solving the problem that the current causal discovery algorithm can only generate a single causal graph, and also solving the problem that the current causal discovery algorithm is prone to causal structure fusion.

[0103] In one possible implementation, the acquisition unit 211 is further configured to acquire a knowledge set input by a user, and the training unit 213 combines the dataset and the knowledge set to train multiple sub-models. Specifically, the training unit 213 may combine the knowledge set with observation data from multiple category groups to train multiple sub-models, with each sub-model trained using observation data from a different category group but sharing the same knowledge set.

[0104] In a specific implementation, the knowledge set may include at least one known causal relationship determined by a causal direction, wherein the causal direction is used to describe that the change of one variable leads to the change of another variable, that is, one variable is considered to be a cause variable and the other variable is considered to be a result variable, and the causal direction describes that the effect of this causal relationship is from the causal variable to the result variable. The causal direction can be unidirectional, indicating that the cause variable affects the result variable. The determination of the causal direction refers to the determination of the cause variable and the result variable in the causal relationship. For example, rain (cause) may cause the ground to be wet (result), but the wet ground will not cause rain, then the causal direction between "precipitation" and "ground humidity" is determined, that is, precipitation → ground humidity.

[0105] Furthermore, known causal relationships refer to known causal relationships between multiple variables in a dataset. Each known causal relationship is derived from prior knowledge, which is used to guide the model in discovering causal relationships. This prior knowledge can come from the experience of domain experts, domain theories, research results, and so on. It should be understood that when the number of samples in a dataset is small, the coverage and diversity of the data will be reduced, and only one-sided or even erroneous causal relationships can be discovered based on the dataset alone. This application combines prior knowledge with the dataset through a knowledge set, which can improve the accuracy of causal discovery in scenarios with small data volumes.

[0106] Optionally, the knowledge set may include a first causal relationship with a determined causal direction and a determined quantitative relationship value. The description of the causal direction can be found in the aforementioned content. The quantitative relationship value refers to the specific numerical expression of the causal relationship between two variables, which is used to measure the specific circumstances of the quantitative relationship. The determination of the quantitative relationship value means that this specific numerical expression is certain. For example, for every 1 unit increase in X, Y increases by 10 units, or A has a 5% impact on B. The above examples are for illustrative purposes only and are not specifically limited in this application.

[0107] In specific implementations, the content and acquisition methods of the first causal relationship vary in different application scenarios. Taking a financial scenario as an example, the first causal relationship with a determined causal direction and quantitative relationship value can be obtained based on a large number of indicator calculation formulas in this scenario. For example, days sales outstanding (DSO) is a financial indicator used to measure a company's accounts receivable management efficiency. It represents the average time between sales generation and actual customer payment. The lower the DSO, the faster the company converts sales into cash, thereby better managing working capital. The calculation formula for DSO is as follows: DSO = (accounts receivable / total sales) * days. In this example, the causal relationship obtained based on prior knowledge (financial indicators) has a clear causal direction: accounts receivable have an impact on the value of DSO, and a clear quantitative relationship value: DSO = (accounts receivable / total sales) * days. Therefore, this prior knowledge can be used as the first causal relationship in the knowledge set to participate in the training of each sub-model. It should be understood that the above example is for illustrative purposes and is not specifically limited in this application.

[0108] For example, in an autonomous driving scenario, the first causal relationship with a determined causal direction and a determined quantitative relationship value can be derived based on a large number of physical formulas in the scenario. For example, the relationship between a vehicle's braking strength and its stopping distance can be derived based on Newton's second law F = ma (force equals mass multiplied by acceleration), where force can represent the braking force and mass is the mass of the vehicle. Based on this formula, the vehicle's deceleration a under different braking forces can be determined. Based on the current speed and deceleration, the vehicle's stopping time and stopping distance can be derived, thereby obtaining a derivation formula between the braking force and the stopping distance. Combined with the relationship between different braking strengths and braking forces, a derivation formula between the braking strength and the stopping distance can be derived. In this example, in the causal relationship obtained based on prior knowledge (physical theoretical knowledge), the causal direction is determined: the braking strength affects the stopping distance, and the quantitative relationship value is determined: the derivation formula between the braking strength and the stopping distance. Therefore, this prior knowledge can be used as the first causal relationship in the knowledge set to participate in the training of each sub-model. It should be understood that the above examples are for illustration only and are not specifically limited in this application.

[0109] In a specific implementation, for a first causal relationship with a determined causal direction and a determined quantitative relationship value, when training each sub-model, the training unit 213 may freeze the model parameters that control the output of the first causal relationship, and exclude them from backpropagation during the training process. Simply put, a portion of the sub-model's parameters are initialized using the first causal relationship. Then, during training, only the uninitialized parameters are allowed to be adjusted, thereby ensuring that the model parameters that control the output of the first causal relationship do not change during model training, and ensuring that the causal graph output by the model includes the known first causal relationship. It should be understood that a sub-model includes multiple parameters, each of which is used to describe information such as the strength, direction, and type of a possible causal relationship between variables. Model training continuously optimizes the model parameters so that the model can accurately reflect the causal relationship in the input observation data. Therefore, to ensure that the causal graph output by the model includes the first causal relationship, the frozen parameters may be parameters related to the first causal relationship, such as freezing the edge weight between two variables in the first causal relationship in the causal graph. This edge weight will not be trained during model training, thereby ensuring that the causal graph output by the model includes the first causal relationship determined based on the prior knowledge. Or freeze the element corresponding to the first causal relationship in the causal adjacency matrix so that it no longer changes with the training of the model, wherein the causal adjacency matrix is ​​usually used to represent the causal relationship between variables during the training process, the rows and columns of the matrix represent different variables, and the elements in the matrix represent the causal relationship between these variables, and in the causal adjacency matrix, the element value corresponding to the determined causal direction is represented as a non-zero positive number. On the contrary, if there is a negative causal relationship, the element value is a negative number. The above examples are for illustration only and are not specifically limited in this application.

[0110] Optionally, the knowledge set may include a second causal relationship with a confirmed causal direction and a non-zero unknown quantitative relationship value. The description of the causal direction and the quantitative relationship value can be found in the previous section and will not be repeated here. A non-zero quantitative relationship value indicates that a certain numerical relationship is confirmed between the two variables, but this relationship cannot be described by a specific numerical value.

[0111] For example, in the financial field, based on the known view in economic theory that an increase in the money supply may lead to an increase in the inflation rate, the causal direction between the money supply and the inflation rate is: money supply → inflation rate. However, the impact of the money supply on the inflation rate is influenced by many factors, such as output levels, market expectations, and monetary policy. Therefore, while it is known that an increase in the money supply may be associated with an increase in the inflation rate, it is impossible to provide a specific, universal quantitative formula to accurately predict the magnitude of inflation changes. Therefore, based on this prior knowledge, only a secondary causal relationship with a certain causal direction and a non-zero quantitative relationship value can be obtained.

[0112] For example, in the field of autonomous driving, based on the driving experience that "roads are slippery in rainy days and accidents are prone to occur", we can know that the causal direction between rainfall and accident rate is: rainfall → accident rate. However, driver behavior, vehicle technology, etc. will also have an impact on the accident rate. Therefore, although it is determined based on known experience that an increase in rainfall may be related to an increase in the accident rate, it is impossible to provide a specific quantitative relationship value to accurately describe the relationship between the increase in rainfall and the increase in the accident rate. Therefore, based on this prior knowledge, we can only obtain a second causal relationship with a certain causal direction and a non-zero quantitative relationship value.

[0113] In a specific implementation, when a sub-model is trained using a second causal relationship in which the causal direction is determined and the quantitative relationship value is a non-zero unknown value, the training unit 213 can set a constraint that the causal direction is determined and the quantitative relationship value is non-zero according to the second causal relationship, and then train the model in combination with the constraint. It should be understood that since the quantitative relationship value of the second causal relationship is unknown, it is necessary to learn this quantitative relationship value by fitting the data in the data set during the model training process, so that the weight parameters of the model of the second causal relationship are continuously optimized over multiple rounds of training. However, in order to avoid the direction of the second causal relationship from changing during the training process, setting the constraint on the causal direction can enable the trained model to output the second causal relationship with the correct causal direction and the quantitative relationship value inferred by the model.

[0114] Furthermore, the above-mentioned second causal relationship can be realized through the following constraints: setting a constraint greater than 0 for the elements in the causal adjacency matrix corresponding to the determined direction, and setting a constraint equal to 0 for the elements in the opposite direction. Among them, the causal adjacency matrix is ​​usually used to represent causal relationships. The rows and columns of the matrix represent different variables, and the elements in the matrix represent the causal relationship between these variables. In the causal adjacency matrix, the element value corresponding to the determined causal direction is represented as a non-zero positive number. Conversely, if there is a negative causal relationship, the element value is a negative number. Therefore, setting a constraint greater than 0 for the elements corresponding to the causal relationship can ensure the existence of this causal relationship in the positive causal relationship, and setting a constraint equal to 0 for the opposite elements corresponding to the causal relationship can ensure the non-existence of this causal relationship in the reverse direction. Such constraint settings can help the sub-model to not change the causal direction in the second causal relationship output by the model even if the model parameters are continuously optimized during the training process.

[0115] Optionally, the knowledge set may include a third causal relationship in which the causal direction is determined and the quantitative relationship value is unknown. The description of the causal direction and the quantitative relationship value can refer to the above content and will not be repeated here. Among them, the unknown quantitative relationship value means that it is difficult to determine whether there is a certain numerical relationship between the two variables. There may be a certain numerical relationship, but the value is unknown, or there may be no numerical relationship at all between the two variables.

[0116] For example, in the financial field, expert experience shows that increasing advertising spending can increase sales, which means the causal direction between advertising spending and sales is determined. However, the actual increase in sales will also be affected by market demand, competition, and other factors. Under the influence of various factors, the increase in advertising spending may have a very small impact on sales, or even zero. Therefore, based on the above expert experience, only a third causal relationship with a determined causal direction and unknown quantitative relationship can be obtained.

[0117] To give another example, in the field of autonomous driving, theoretical knowledge shows that lidar technology will provide more accurate environmental perception, thereby improving the safety of autonomous vehicles. In other words, the causal direction between the number of lidar units and driving safety is determined. However, the degree of improvement in safety brought about by each newly added lidar unit may vary depending on factors such as vehicle design and road conditions. It is possible that the improvement in safety brought about by the newly added lidar units is very weak or even zero. Therefore, based on the above theoretical knowledge, only a third causal relationship with a determined causal direction and an unknown quantitative relationship can be obtained.

[0118] In a specific implementation, when a sub-model is trained using a third causal relationship with a determined causal direction and an unknown quantitative relationship, the training unit 213 can set a constraint according to the third causal relationship that the causal direction is determined and the quantitative relationship is not restricted, that is, a constraint that the quantitative relationship may be 0, and then train the model in combination with this constraint. Furthermore, the above-mentioned third causal relationship can be implemented by setting a constraint equal to 0 for the elements in the causal adjacency matrix that are opposite to the determined direction. Referring to the above content, it can be seen that in the causal adjacency matrix, the element value corresponding to the determined causal direction is represented as a non-zero positive number. Conversely, if there is a negative causal relationship, the element value is a negative number. Therefore, by not constraining the positive elements and only constraining the reverse elements to 0, it can be ensured that there will be no reverse causal relationship in the third causal relationship. At the same time, by not constraining the positive causal relationship, the model can learn the quantitative relationship in the third causal relationship by fitting the data set. The positive direction may be 0 or a certain positive value. Such a constraint setting can help the sub-model to not change the causal direction in the third causal relationship output by the model during the training process, even if the model parameters are continuously optimized.

[0119] It should be noted that at least one known causal relationship in the knowledge set can be one or more of the first causal relationship, the second causal relationship, and the third causal relationship. Each known causal relationship can be a causal relationship between two variables, or a causal relationship between more than two variables, that is, a causal graph. For example, the data set includes observation data of variables A to variable E, and the knowledge set includes a causal graph 1 between variables A, variable B, and variable C. There is a first causal relationship 1 between variables A and variable B, and a first causal relationship 2 between variables B and variable C. The two constitute a causal graph 1, but the causal relationship between variables D, variable E and other variables is not determined. The causal graph 2 between variables A to variable E can be output through the sub-model, and the causal graph 2 includes the causal graph 1 between the above-mentioned variables A, variable B, and variable C. The above examples are for illustration only and are not specifically limited in this application.

[0120] It should be understood that the present application trains the sub-model by combining the knowledge set and the data set, and the knowledge set includes at least one known causal relationship. These known causal relationships are at least causal relationships with determined causal directions, which can provide guidance for the training of the sub-model. When the data set has a small amount of data, the coverage and diversity of the data will be reduced, and only one-sided or even erroneous causal relationships can be discovered through the data set alone. The present application combines prior knowledge with the data set through the knowledge set, which can improve the accuracy of causal discovery in small data volume scenarios.

[0121] In one possible implementation, the acquisition unit 211 is further configured to acquire a penalty threshold input by a user, and the training unit 213 performs adaptive penalty training on the sub-model using the penalty unit 215 and the penalty threshold input by the user. Specifically, when the training unit 213 trains multiple sub-models in combination with the knowledge set and observation data from multiple category groups, each sub-model may be adaptively trained using the penalty threshold.

[0122] Optionally, the model's loss function includes a penalty parameter whose value is the same as the causal relationship estimate output by the model in the previous round. Larger estimates result in lower penalties, while smaller estimates result in higher penalties, thereby achieving parameter correction. A larger causal relationship estimate indicates a stronger causal relationship, and vice versa. It should be understood that if the output estimate is large, it indicates that the model has better fitted certain features of the data. Applying an excessively high penalty to large estimates may hinder the model's learning of these important features, thereby affecting model performance. Therefore, applying a lower penalty and a smaller constraint to large estimates not only does not hinder model learning but also helps prevent underfitting. Conversely, if the output estimate is small, it indicates that the model is unable to fit the complex relationships in the data. By applying a higher penalty, the model is encouraged to focus more on the features of the training data, improving model performance. Larger constraints can prevent overfitting. Therefore, using the current round's estimate as a penalty parameter in the next round of training can achieve the goal of applying a lower penalty to larger parameter values ​​and a higher penalty to smaller parameter values. This design can adaptively adjust the training objectives based on the results of each round of training, automatically solving overfitting and underfitting problems, and thus achieving parameter correction.

[0123] Optionally, a user-entered penalty threshold is used to determine the convergence condition of the model. Specifically, the model converges when the difference between the estimated value of the causal relationship output by the model and the estimated value of the causal relationship in the previous round is less than the penalty threshold. Simply put, when the difference between the estimated value output by the model and the estimated value output in the previous round is not less than the penalty threshold, the estimated value output in the current round is used as the penalty parameter for the next round of training, and so on for multiple rounds of training until the difference between the estimated value output by the current round and the estimated value output in the previous round is less than the penalty threshold.

[0124] For example, the penalty parameter is initialized to 1, and then the model is trained to obtain the parameter estimate of the t-th round causal relationship of the k-th category group. When the difference between the estimated value in round t and the estimated value in round t-1 is less than the penalty threshold input by the user, the sub-model corresponding to the trained k-th category group is generated. If it is not less than the penalty threshold, the estimated value in round t can be used as the penalty parameter, and training is performed for round t+1 to obtain the parameter estimate of the t+1-th round causal relationship of the k-th category group. When the difference between the estimated value in round t and the estimated value in round t+1 is less than the penalty threshold input by the user, the sub-model corresponding to the k-th category group is generated. If it is not less than the penalty threshold, the estimated value in round t+1 can be used as the penalty parameter, and training is performed for round t+2, and so on, until the difference between the estimated value of the current output and the estimated value of the previous round is less than the penalty threshold.

[0125] It should be understood that when the model estimates the causal relationship between variables, due to factors such as data noise and insufficient sample size, the individual estimated values ​​output by the model may have certain deviations. This deviation may affect the accuracy of causal discovery, making it possible for the algorithm to fail to fully capture the true causal structure. However, by using the estimated value of this round as a penalty parameter, this application can achieve the goal of imposing lower penalties on larger parameter values ​​and higher penalties on smaller parameter values, so that the model can adjust the parameter update amplitude according to the output of the estimated value during the training process. The adjustment amplitude of the model during multiple rounds of training is more stable. Even if an erroneous estimated value occurs, it will not cause a large swing in the parameter due to this erroneous estimated value, thereby achieving the effect of correction.

[0126] It should be noted that the penalty parameter can be a penalty for a single parameter or a combination of multiple parameters. In other words, the penalty parameter can be an estimated value weight for a single causal relationship or an estimated value weight for multiple causal relationships. This application does not make specific limitations.

[0127] In one possible implementation, the training unit 213 can also add directed acyclic graph (DAG) constraints to each sub-model so that the causal graph output by the trained model is an acyclic graph without cyclic relationships, avoiding cyclic effects. Because in the presence of cycles, the causal relationship will become confusing and unexplainable. In other words, the DAG constraint is used to ensure that the generated causal graph is reasonable and follows the basic properties of causality.

[0128] In an embodiment of the present application, multiple sub-models are trained through the above-mentioned penalty unit 215 and the knowledge injection unit 214. After the model convergence is determined according to the penalty threshold input by the user, the corresponding initial causal graph is output, and then the initial causal graph is used to update the objects in the category group. Then, the updated category group is used to perform the next round of training on multiple sub-models through the above-mentioned penalty unit 215 and the knowledge injection unit 214. After the model convergence is determined according to the penalty threshold input by the user, the updated initial causal graph is output, and then the objects in the category group are updated using the updated initial causal graph. Similarly, the category group is updated for multiple rounds until the objects in each category group no longer change, and each sub-model can output the causal graph corresponding to each category group.

[0129] Furthermore, the acquisition unit 211 can also be used to acquire data to be processed outside the data set. The data to be processed includes observation data of one or more objects to be processed. For details, please refer to the description of observation data and objects in the above content, which will not be repeated here.

[0130] The grouping prediction unit 217 can also determine the category group corresponding to each object to be processed in the data to be processed based on the above-mentioned multiple causal graphs, and then determine the causal graph corresponding to each object to be processed based on the category group corresponding to each object to be processed, thereby obtaining one or more causal graphs corresponding to the data to be processed.

[0131] Optionally, the observation data of each object to be processed can be substituted into multiple causal graphs respectively, and the category group corresponding to each object to be processed can be determined according to the loss value of each causal graph. In a specific implementation, the category group corresponding to the causal graph with the smallest loss value is the category group corresponding to the object to be processed.

[0132] The output unit 218 can output the one or more causal graphs to the client 100. Alternatively, the output unit 218 can send the one or more causal graphs to the storage system 300 for storage. The storage system 300 can be connected to some application systems to perform causal inference or other further processing based on the causal graphs, which is not specifically limited in this application.

[0133] It should be understood that if the data to be processed deviates significantly from the data in the dataset, for example, a new causal structure emerges, the number of groups can be modified, and the data to be processed can be used to further train multiple sub-models in the sub-model to obtain multiple updated category groups until the objects in the category group no longer change.

[0134] It should be understood that Figure 1 is an exemplary division method. In some embodiments, the causal relationship discovery system 200 may also include more or fewer unit modules. The following examples are given. It should be noted that the multiple implementation methods listed below are only some possible implementation methods provided by this application, but the scope of protection of this application is not limited to this. Any technician familiar with this technical field can easily think of various equivalent repairs or replacements within the technical scope disclosed in this application, and these repairs or replacements should be covered by the scope of protection of this application.

[0135] In one possible implementation, the causal relationship discovery system 200 may include a training unit 213, a knowledge injection unit 214, an acquisition unit 211, and an output unit 218. Specifically, during model training, each sub-model is trained in conjunction with a dataset and a knowledge set. The sub-model, through the knowledge set, combines prior knowledge with the dataset, thereby improving the accuracy of causal discovery in scenarios with small data volumes. For details, please refer to the description of the knowledge injection unit 214, which will not be repeated here.

[0136] In another possible implementation, the causal relationship discovery system may include a training unit 213, a knowledge injection unit 214, a penalty unit 215, an acquisition unit 211, and an output unit 218. That is, during model training, not only is the sub-model trained in conjunction with the knowledge set, but the penalty unit 215 is also used during model training to ensure smooth convergence of model parameters and achieve parameter correction. This sub-model not only combines prior knowledge with the dataset but also enables automatic parameter correction, further improving the accuracy of causal discovery in scenarios with small data volumes.

[0137] In another possible implementation, the causal relationship discovery system 200 may include a training unit 213, a grouping unit 212, a group updating unit 216, an acquisition unit 211, a group prediction unit 217, and an output unit 218. Specifically, during model training, the data set is divided into multiple category groups, and observation data for objects sharing a causal graph is grouped into the same category group. Multiple sub-models are then trained using the multiple category groups to obtain multiple causal graphs corresponding to the multiple category groups. This system can identify multiple causal graphs in a data set, resolving the problem that current causal discovery algorithms can only identify a single causal graph, which can easily lead to causal graph omissions.

[0138] In another possible implementation, the causal relationship discovery system 200 may include a training unit 213, a grouping unit 212, a knowledge injection unit 214, a grouping update unit 216, an acquisition unit 211, a grouping prediction unit 217 and an output unit 218. That is, during model training, the data set is divided into multiple category groups by the grouping unit 212 and the grouping update unit 216, and multiple sub-models are trained using the multiple category groups. At the same time, each sub-model is also trained in combination with the knowledge set.

[0139] In another possible implementation, the causal relationship discovery system 200 is the structure shown in Figure 1, that is, during model training, the data set is divided into multiple category groups through the grouping unit 212 and the grouping update unit 216, and then the multiple category groups are used to train multiple sub-models. One category group corresponds to one sub-model. During the training process, each sub-model is not only trained in combination with the knowledge set, but also adaptively penalized through the penalty unit 215, so that the model parameters converge smoothly and parameter correction is achieved.

[0140] In summary, the causal relationship discovery system provided by the present application divides the dataset into multiple initial category groups according to the number of groups input by the user, and then uses the multiple initial category groups to train multiple sub-models to obtain multiple initial causal graphs. Then, each object in the dataset is substituted into the multiple initial causal graphs to obtain multiple loss values. Then, based on the multiple loss values ​​of each object, the causal graph that best fits each object is determined, and then the category group to which each object belongs is determined. The objects in the initial category group are updated. Then, the updated multiple category groups are used to further train multiple sub-models to obtain multiple updated initial causal graphs. Then, each object in the dataset is substituted into the multiple updated initial causal graphs to obtain multiple loss values ​​for each object. Based on the multiple loss values ​​of each object, the category group to which each object belongs is determined, and the updated initial category group is updated again. This process is repeated until the objects in the category group no longer change. The objects in the category group determined in this way are objects that share the causal graph. The causal graph output by each sub-model is the causal graph corresponding to the category group, thereby obtaining multiple causal graphs corresponding to the dataset. This can solve the problem that current causal discovery algorithms can only identify a single causal structure and cannot mine multiple causal structures from the data.

[0141] At the same time, during the training process, each sub-model is trained in combination with a knowledge set. The knowledge set includes known causal relationships determined by multiple causal directions. These known causal relationships can provide guidance for the training of the sub-model. When the data set is small, the coverage and diversity of the data will be reduced. Only one-sided or even wrong causal relationships can be discovered through the data set alone. This application combines prior knowledge with the data set through the knowledge set, which can improve the accuracy of causal discovery in small data volume scenarios.

[0142] Finally, during the training process, each sub-model uses the estimated value of this round as the penalty parameter for the next round of training, imposing lower penalties on larger parameter values ​​and higher penalties on smaller parameter values. This allows the model to adjust the parameter update amplitude according to the estimated value output during training. The adjustment amplitude of the model is more stable during multiple rounds of training. Even if an incorrect estimated value occurs, the parameter will not swing significantly due to this incorrect estimated value, thereby achieving the effect of correction.

[0143] The above describes in detail the causal relationship discovery system provided by the present application in conjunction with Figures 1 and 2. The following will describe the causal relationship discovery method provided by the present application in conjunction with Figures 3 to 5.

[0144] FIG3 is a flow chart of the steps of a causal relationship discovery method provided by the present application in the training phase. As shown in FIG3 , the method includes the following steps:

[0145] S310: The client 100 sends the knowledge set, data set, number of groups, and penalty threshold input by the user to the causal relationship discovery system 200. This step can be implemented by the acquisition unit 211 in the embodiment of FIG2.

[0146] In a specific implementation, the description of the data set, knowledge set, number of groups and penalty threshold can refer to the relevant content of the embodiment of FIG2 , which will not be repeated here.

[0147] S320: The causal relationship discovery system 200 divides the data set into multiple category groups according to the number of groups. This step can be implemented by the grouping unit 212 in the embodiment of FIG2 .

[0148] In a specific implementation, the causal relationship discovery system 200 can determine a corresponding number of category groups based on the number of groupings, and then randomly assign multiple objects in the data set to the multiple category groups, such as by randomly assigning the observation data of multiple objects to the multiple category groups through sampling without replacement. Of course, the causal relationship discovery system 200 can also use certain preset rules to assign each object so that objects sharing the same causal graph are assigned to the same category group as much as possible. For example, the preset rule can be to group company objects of the same size and similar fields into one category group. The specific preset rules can be determined according to the actual application scenario, and this application does not limit this.

[0149] S330: Use multiple category groups and knowledge sets to perform adaptive penalty training on multiple sub-models to obtain multiple initial causal graphs. This step can be implemented by the knowledge injection unit 214, training unit 213 and penalty unit 215 in the embodiment of FIG2.

[0150] In an embodiment of the present application, a category group is used to train a sub-model to obtain an initial causal graph corresponding to the category group. That is, k category groups train k sub-models respectively. Among them, the possible implementation of the neural network can refer to the relevant content in the embodiment of Figure 2, which will not be repeated here. At the same time, when using k category groups to train k sub-models, some causal discovery algorithms can be selected according to the application scenario. The algorithm used for each sub-model is the same, such as PC, FCI, Notears, Notears-MLP, etc., which is not specifically limited in this application.

[0151] In an embodiment of the present application, each category group can train its corresponding sub-model in conjunction with a knowledge set. Specifically, the knowledge set can include known causal relationships determined by multiple causal directions, where a causal direction describes how a change in one variable leads to a change in another variable. The known causal relationships are determined based on prior knowledge, including but not limited to the experience of domain experts, domain theories, and research results.

[0152] Optionally, the knowledge set may include a first causal relationship with a determined causal direction and a determined quantitative relationship value. The quantitative relationship value refers to a specific numerical expression of the causal relationship between two variables, which is used to measure the specific situation of the quantitative relationship. The quantitative relationship value determination means that this specific numerical expression is determined. For example, for every increase of one unit in X, Y increases by 10 units, or A has a 5% effect on B. The above examples are for illustration only and are not specifically limited in this application. Among them, examples of the first causal relationship in various fields can refer to the relevant content in the embodiment of Figure 2, which will not be repeated here.

[0153] In a specific implementation, in the process of training each sub-model, for the first causal relationship with a determined causal direction and a determined quantitative relationship value, the model parameters that control the output of the first causal relationship can be frozen, and will not participate in the back propagation during the training process, ensuring that the causal graph output by the model includes the above-mentioned known first causal relationship. For example, the elements corresponding to the first causal relationship in the causal adjacency matrix are frozen so that they no longer change with the training of the model. The causal adjacency matrix is ​​usually used to represent the causal relationship between variables during the training process. The rows and columns of the matrix represent different variables, and the elements in the matrix represent the causal relationship between these variables. In the causal adjacency matrix, the element value corresponding to the determined causal direction is represented as a non-zero positive number. On the contrary, if there is a negative causal relationship, the element value is a negative number. The above examples are for illustration only and are not specifically limited in this application.

[0154] Optionally, the knowledge set may include a second causal relationship with a confirmed causal direction and a non-zero unknown quantitative relationship value. The non-zero quantitative relationship value indicates that a certain numerical relationship exists between the two variables, but this relationship cannot be described by a specific numerical value. For examples of the second causal relationship in various fields, please refer to the relevant content of the embodiment of FIG. 2 and will not be repeated here.

[0155] In a specific implementation, when training a sub-model using a second causal relationship with a determined causal direction and a non-zero unknown quantitative relationship value, a constraint can be set in the causal adjacency matrix to constrain the elements in the determined direction to be greater than 0, and to constrain the elements in the opposite direction to be equal to 0. It should be understood that since the quantitative relationship value of the second causal relationship is unknown, it is necessary to learn this quantitative relationship value by fitting the data in the dataset during model training, so that the weight parameters of the model for this second causal relationship are continuously optimized over multiple rounds of training. However, to prevent the direction of the second causal relationship from changing during training, setting a constraint on the causal direction allows the trained model to output the second causal relationship with the correct causal direction and the quantitative relationship value inferred by the model. Setting the constraint of greater than 0 for the elements corresponding to the causal relationship can ensure the existence of this causal relationship in the forward direction, while setting the constraint of equal to 0 for the elements corresponding to the opposite direction can ensure the non-existence of this causal relationship in the reverse direction. Such constraint settings can help the sub-model maintain the causal direction of the second causal relationship output by the model during training, even if the model parameters are continuously optimized.

[0156] Optionally, the knowledge set may include a third causal relationship with a determined causal direction but an unknown quantitative relationship value. The unknown quantitative relationship value refers to the difficulty in determining whether a numerical relationship exists between two variables. A numerical relationship may exist, but the value is unknown. Alternatively, there may be no numerical relationship at all between the two variables. For examples of the third causal relationship in various fields, please refer to the relevant content of the embodiment in FIG. 2 , and will not be repeated here.

[0157] In a specific implementation, when a sub-model is trained using a third causal relationship with a determined causal direction and an unknown quantitative relationship, a constraint equal to 0 can be set for the elements in the causal adjacency matrix that should be in the opposite direction. Referring to the above content, it can be seen that in the causal adjacency matrix, the element value corresponding to the determined causal direction is represented as a non-zero positive number. Conversely, if there is a negative causal relationship, the element value is a negative number. Therefore, by not constraining the positive elements and only constraining the reverse elements to 0, it can be ensured that there will be no reverse causal relationship in the third causal relationship. At the same time, by not constraining the forward causal relationship, the model can learn the quantitative relationship in the third causal relationship by fitting the data set. The forward direction may be 0 or a certain positive value. Such a constraint setting can help the sub-model in the training process. Even if the model parameters are continuously optimized, the causal direction in the third causal relationship output by the model will not change.

[0158] In an embodiment of the present application, each sub-model can also be trained with an adaptive penalty threshold input by the user during the training process in conjunction with the knowledge set. Specifically, the loss function of the sub-model includes a penalty parameter, the value of which is the same as the estimated value of the causal relationship output by the model in the previous round. A larger estimated value can be punished with a lower penalty, and a smaller estimated value can be punished with a higher penalty, thereby achieving the function of parameter correction. Among them, the larger the estimated value of the causal relationship, the stronger the causal relationship, and vice versa.

[0159] It should be understood that if the output estimate is large, the larger estimate means that the model has better fit certain features of the data. If the larger estimate is penalized too highly, it may hinder the model's learning on these important features, thereby affecting the model's performance. Therefore, a lower penalty is imposed on the larger estimate. This will not only not hinder the model's learning, but also avoid underfitting of the model. On the contrary, if the output estimate is small, the smaller estimate means that the model cannot fit the complex relationships in the data. By imposing a higher penalty, the model is encouraged to pay more attention to the features of the training data, improve model performance, and avoid overfitting of the model. Therefore, using the estimated value of this round as a penalty parameter in the next round of training can achieve the goal of imposing lower penalties on larger parameter values ​​and higher penalties on smaller parameter values. This design can adaptively adjust the training target based on the results of each round of training, automatically solve the problems of overfitting and underfitting, and thus achieve parameter correction.

[0160] In the specific implementation, when the difference between the estimated value output by the model and the estimated value output in the previous round is not less than the penalty threshold, the estimated value output in this round is used as the penalty parameter for the next round of training. When the difference between the estimated value of the causal relationship output by the model and the estimated value of the causal relationship in the previous round is less than the penalty threshold, the model converges and the initial causal graph corresponding to the category group is obtained.

[0161] In order to make the present application better understood, Figure 4 is a schematic diagram of the training process of each sub-model in the causal relationship discovery method provided by the present application. As shown in Figure 4, when each sub-model undergoes multiple rounds of training, if the difference between the causal relationship estimation value output by each round of training and the causal relationship estimation value of the previous round is not less than the penalty threshold input by the user, then the sub-model continues to be trained. If it is less than the penalty threshold input by the user, then the training can be terminated to obtain the initial causal graph corresponding to the category group.

[0162] Each round of training uses a penalty parameter to limit the adjustment range of the model parameters. The penalty parameter used in each round of training is the estimated value of the current round of training. If the estimated value of the current round of training is large, that is, the predicted causal relationship strength is high, then the adjustment range of the model parameters can be slightly constrained. If the estimated value of the current round of training is small, that is, the predicted causal relationship strength is weak, then the adjustment range of the model parameters can be greatly constrained. In order to achieve the goal of applying lower penalties for larger parameter values ​​and higher penalties for smaller parameter values, this design can adaptively adjust the training objectives based on the results of each round of training, automatically solve the problems of overfitting and underfitting, and thus achieve parameter correction.

[0163] Furthermore, the sub-models can be trained using knowledge sets and category groups. As shown in Figure 4, category group 1 and knowledge set are used to train sub-model 1 to obtain causal graph 1, and category group 2 and knowledge set are used to train sub-model 2 to obtain causal graph 2. The causal discovery algorithm used in the training of sub-model 1 and sub-model 2 is the same, but because they are trained using observation data from different category groups, the causal relationships fitted by the sub-models finally obtained are also different, and the causal graphs output by each sub-model are also different.

[0164] S340: Substitute the observation data of each object into multiple initial causal graphs to determine the category group to which each object belongs. This step can be implemented by the grouping update unit 216 in the embodiment of FIG2 .

[0165] In a specific implementation, the observation data of each object in the data set can be substituted into multiple initial causal graphs obtained in multiple steps S330. Each object can obtain multiple loss values, and each loss value corresponds to an initial causal graph. The initial causal graph corresponding to the minimum loss value among the multiple loss values ​​is the causal graph that best suits the object, and the category group corresponding to the initial causal graph is the category group to which the object belongs. For example, the observation data of object A is substituted into k initial causal graphs to obtain k loss values. The minimum value among the k loss values ​​is obtained by substituting into the initial causal graph of group 3, then object A will be classified into group 3. The above examples are for illustrative purposes only and are not specifically limited in this application.

[0166] S350: Update the objects in the category group. This step can be implemented by the group updating unit 216 in the embodiment of FIG2 .

[0167] In a specific implementation, after determining the category group corresponding to each object, the objects in the category group divided in step S320 may be updated to obtain a plurality of updated category groups.

[0168] S360: Determine whether the objects in the category group have not changed for multiple consecutive rounds. Specifically, if yes, execute step S370, if not, execute step S330. This step can be implemented by the group updating unit 216 in the embodiment of FIG2.

[0169] In a specific implementation, the number of rounds in which no change occurs can be user-defined. For example, the number of rounds can be 2, meaning no change occurs for two consecutive rounds. Other values ​​are also possible and are not specifically limited in this application. It should be understood that the fact that no change occurs for multiple consecutive rounds indicates that the objects in each category group are already objects in the shared causal graph and therefore no longer need to be updated.

[0170] S370: Obtain multiple causal graphs corresponding to the data set based on the causal graph corresponding to each category group. This step can be implemented by the training unit 213 in the embodiment of FIG2 .

[0171] It should be understood that through multiple rounds of updates to the category group, objects sharing the causal graph can be gradually divided into the same category group. The sub-model trained for the category group is also obtained through multiple rounds of training using the observation data of the objects sharing the causal graph, so that the sub-model corresponding to the category group gradually has the ability to predict the causal structure of the category group through multiple rounds of training. A data set containing multiple causal structures can obtain the causal graph corresponding to each causal structure through multiple sub-models, thereby solving the problem that current causal discovery can only generate a single causal structure.

[0172] S380A: Return multiple causal graphs of the data set to the client. This step can be implemented by the output unit 218 in the embodiment of FIG2 .

[0173] S380B: Send multiple causal graphs of the data set to the storage system. This step can be implemented by the output unit 218 in the embodiment of FIG2 .

[0174] In a specific implementation, if the client is used to obtain causal graphs, such as a data analysis client, the causal relationship discovery system can feed back multiple causal graphs after obtaining them from a dataset. If the client is a client that uses causal graphs to perform certain reasoning, the causal relationship discovery system can send the generated causal graphs to a storage system, which can store the graphs. The storage system can then connect to other causal reasoning systems, which can then obtain the causal graphs from the storage system, perform some causal reasoning, and then feed back the reasoning results to the client. For example, in the financial field, the client may be a client that recommends stock purchase strategies. The client may first analyze financial data through a causal relationship discovery system to determine a causal graph between some variables and stock market indices. The causal graph is stored in a storage system, so that the causal inference system can predict risks in the financial market and generate stock purchase strategies based on the causal graph. For example, in the field of autonomous driving, the client 100 may be a client on an autonomous driving vehicle. The client may analyze sensor data through a causal relationship discovery system to determine a causal graph between different sensor data and the vehicle's acceleration, steering, braking and other behaviors. The causal graph is stored in a storage system, so that the causal inference system can output the vehicle's control algorithm decision based on the causal graph, thereby improving the system's safety and driving comfort. The above examples are for illustration only and are not specifically limited in this application.

[0175] In some embodiments, after step S380A or step S380B, when the user inputs new data to be processed, the client can determine the causal graph of the data to be processed based on the multiple causal graphs obtained in step S370. The following describes the steps for determining the causal graph of the data to be processed in conjunction with Figure 5. To facilitate a better understanding of this application, the steps shown in Figure 3 can be understood as the training phase of the sub-model, and the steps shown in Figure 5 as the inference phase of the sub-model.

[0176] As shown in FIG5 , FIG5 is a schematic flow chart of the steps of a causal relationship discovery method provided by the present application in the reasoning stage. As shown in FIG5 , the method may include the following steps:

[0177] S510: The client sends the data to be processed to the causal relationship discovery system. This step can be implemented by the acquisition unit 211 in the embodiment of FIG2 .

[0178] In a specific implementation, the data to be processed may include observation data of one or more objects to be processed. The description of the observation data and the objects can be referred to the above content and will not be repeated here.

[0179] S520: Substitute the observation data of each object into the multiple causal graphs obtained in S370 to determine the category group to which each object belongs. This step can be implemented by the group prediction unit 217 in the embodiment of FIG2 .

[0180] In the specific implementation, the observation data of each object can be input into multiple sub-models, and each sub-model can obtain a loss value for the object. The smaller the loss value, the more closely the observation data of the object fits the causal structure learned by the sub-model. Therefore, the sub-model with the smallest loss value is the most suitable sub-model for the object, and the category group corresponding to the sub-model is the category group to which the object belongs.

[0181] S530: Determine the causal graph of each object according to the category group to which each object belongs, and obtain multiple causal graphs of the data to be processed. This step can be implemented by the output unit 218 in the embodiment of FIG2 .

[0182] Steps S310 to S370 obtain the causal graph corresponding to each category group. Therefore, after determining the category group corresponding to each object in the data to be processed, the causal graph corresponding to each object can be obtained, thereby obtaining multiple causal graphs of the data to be processed.

[0183] It is understood that if a new causal graph appears in the data to be processed input by the user, the number of groups can be increased, the data to be processed can be added to the data set, and multiple sub-models can be trained according to steps S310 to S370 to obtain multiple new causal graphs, thereby determining multiple causal graphs of the data to be processed.

[0184] S540A: Return multiple causal graphs of the data to be processed to the client. This step can be implemented by the output unit 218 in the embodiment of FIG2 .

[0185] S540B: ​​Send multiple causal graphs of the data to be processed to the storage system. This step can be implemented by the output unit 218 in the embodiment of FIG2 .

[0186] The description of step S540A and step S540B can refer to the description of step S380A and step S380B in the embodiment of FIG3 , and will not be repeated here.

[0187] In order to make the present application better understood, the causal relationship discovery method provided by the present application is further explained below in conjunction with Figure 6. Figure 6 is a schematic diagram of an interface provided by the present application. The interface can be an exemplary display interface when step S310 obtains the number of groups, penalty threshold, knowledge set and data set input by the user. It should be understood that Figure 6 is used for illustration and the present application does not limit the interface.

[0188] As shown in Figure 6, users can enter the desired number of groups, penalty threshold, knowledge set, and dataset through the input boxes on the page. Other training parameters can also be set, but these are not detailed here. For descriptions of the number of groups, penalty threshold, and knowledge set, please refer to Figures 2-5 and will not be repeated here.

[0189] It should be understood that the causal relationship discovery method provided by this application only requires the user to input the number of groups, the penalty threshold, and the knowledge set to obtain a causal graph composed of multiple different causal structures existing in the data set, thereby solving the problem that the current causal discovery algorithm can only identify a single causal structure and cannot mine multiple causal structures from the data, avoiding users from obtaining incorrect causal graphs and improving the user experience.

[0190] In summary, the causal relationship discovery method provided by the present application divides the dataset into multiple initial category groups according to the number of groups input by the user, and then uses the multiple initial category groups to train multiple sub-models to obtain multiple initial causal graphs. Then, each object in the dataset is substituted into the multiple initial causal graphs to obtain multiple loss values. Then, based on the multiple loss values ​​of each object, the causal graph that best fits each object is determined, and then the category group to which each object belongs is determined. The objects in the initial category group are updated, and then the updated multiple category groups are used to further train multiple sub-models to obtain multiple updated initial causal graphs. Then, each object in the dataset is substituted into the multiple updated initial causal graphs to obtain multiple loss values ​​for each object. Based on the multiple loss values ​​of each object, the category group to which each object belongs is determined, and the updated initial category group is updated again. This process is repeated until the objects in the category group no longer change. The objects in the category group determined in this way are objects that share the causal graph. The causal graph output by each sub-model is the causal graph corresponding to the category group, thereby obtaining multiple causal graphs corresponding to the dataset. This can solve the problem that current causal discovery algorithms can only identify a single causal structure and cannot mine multiple causal structures from the data.

[0191] At the same time, during the training process, each sub-model is trained in combination with a knowledge set. The knowledge set includes known causal relationships determined by multiple causal directions. These known causal relationships can provide guidance for the training of the sub-model. When the data set is small, the coverage and diversity of the data will be reduced. Only one-sided or even wrong causal relationships can be discovered through the data set alone. This application combines prior knowledge with the data set through the knowledge set, which can improve the accuracy of causal discovery in small data volume scenarios.

[0192] Finally, during the training process, each sub-model uses the estimated value of this round as the penalty parameter for the next round of training, imposing lower penalties on larger parameter values ​​and higher penalties on smaller parameter values. This allows the model to adjust the parameter update amplitude according to the estimated value output during training. The adjustment amplitude of the model is more stable during multiple rounds of training. Even if an incorrect estimated value occurs, the parameter will not swing significantly due to this incorrect estimated value, thereby achieving the effect of correction.

[0193] The causal relationship discovery method provided by this application has been described in detail above in conjunction with Figures 2 to 5 . The computing device provided by this application will now be described in conjunction with Figure 7 . Figure 7 is a schematic diagram of the structure of a computing device provided by this application, which may be the causal relationship discovery system 200 described above.

[0194] Furthermore, the computing device 700 includes a processor 701, a storage unit 702, a storage medium 703 and a communication interface 704, wherein the processor 701, the storage unit 702, the storage medium 703 and the communication interface 704 communicate through a bus 705, and also communicate through other means such as wireless transmission.

[0195] The processor 701 is composed of multiple general-purpose processors, such as a CPU, an NPU, or a combination of a CPU and a hardware chip. The hardware chip is an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD is a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a system on chip (SoC), or any combination thereof. The processor 701 executes various types of digital storage instructions, such as software or firmware programs stored in the storage unit 702, which enables the computing device 700 to provide a wide variety of services.

[0196] In a specific implementation, as an embodiment, the processor 701 includes one or more CPUs, such as CPU0 and CPU1 shown in FIG. 7 .

[0197] In a specific implementation, as an embodiment, computing device 700 also includes multiple processors, such as processor 701 and processor 706 shown in FIG7 . Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor here refers to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0198] The storage unit 702 is used to store program code, and is controlled by the processor 701 to execute the processing steps of the causal relationship discovery method in any of the embodiments in Figures 1 to 7 above. The program code includes one or more software units. The one or more software units are the acquisition unit, grouping unit, training unit, knowledge injection unit, penalty unit, group update unit, group prediction unit and output unit in the embodiment of Figure 2, wherein the acquisition unit is used to obtain the data set, knowledge set, number of groups and penalty threshold input by the user, as well as the data to be processed input by the user, specifically for implementing S310 and its optional steps in the embodiment of Figure 3 and step S510 and its optional steps in the embodiment of Figure 5, the grouping unit is used to divide the data set into multiple category groups according to the number of groups, specifically for implementing step S320 and its optional steps in the embodiment of Figure 3, the training unit, knowledge injection unit and penalty unit are used to use the knowledge set and multiple category groups to perform adaptive penalty training on multiple neural networks to obtain multiple sub-models, specifically for implementing As shown in S330 and its optional steps in the embodiment of Figure 3, the grouping update unit is used to input the observation data of each object into multiple sub-models, determine the category group to which each object belongs based on the loss values ​​output by the multiple models, and then update the objects in the category group, which is specifically used to implement S340 and S350 in the embodiment of Figure 3 and its optional steps. The grouping prediction unit is used to input the observation data of each object into multiple sub-models, determine the category group to which each object belongs based on the loss values ​​output by the multiple models, which is specifically used to implement S520 in the embodiment of Figure 5 and its optional steps. The output unit is used to output multiple causal graphs of the data set or multiple causal graphs of the data to be processed, which is specifically used to implement S380A and S380B in the embodiment of Figure 3, S540A and S540B in the embodiment of Figure 5 and their optional steps.

[0199] The storage unit 702 includes a read-only memory and a random access memory, and provides instructions and data to the processor 701. The storage unit 702 also includes a non-volatile random access memory. The storage unit 702 is a volatile memory or a non-volatile memory, or includes both volatile and non-volatile memories. Among them, the non-volatile memory is a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory is a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are used, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronized dynamic random access memory (SLDRAM), and direct RAM bus RAM (DR RAM). A hard disk, a universal serial bus (USB), a flash memory, a secure digital memory card (SD card), a memory stick, etc., and a hard disk can be a hard disk drive (HDD), a solid state drive (SSD), a mechanical hard disk (HDD), etc., which is not specifically limited in this application.

[0200] The storage medium 703 is a carrier for storing data, such as a hard disk, a universal serial bus (USB), a flash memory, a secure digital memory card (SD card), a memory stick, etc. The hard disk can be a hard disk drive (HDD), a solid state disk (SSD), a mechanical hard disk (HDD), etc., and this application does not make specific limitations.

[0201] The communication interface 704 is a wired interface (such as an Ethernet interface), an internal interface (such as a high-speed serial computer expansion bus (Peripheral Component Interconnect express, PCIe) bus interface), a wired interface (such as an Ethernet interface) or a wireless interface (such as a cellular network interface or a wireless local area network interface) for communicating with other servers or units.

[0202] Bus 705 is a Peripheral Component Interconnect Express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (UBus or UB), a compute express link (CXL), or a cache coherent interconnect for accelerators (CCIX). Bus 705 is divided into an address bus, a data bus, and a control bus.

[0203] In addition to the data bus, the bus 705 also includes a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity, various buses are labeled as bus 705 in the figure.

[0204] It should be noted that FIG7 is only one possible implementation of the embodiment of the present application. In actual applications, the computing device 700 may also include more or fewer components, which is not limited here. For matters not shown or described in the embodiment of the present application, please refer to the relevant description in the embodiments of FIG1 to FIG7 above, and will not be repeated here.

[0205] The embodiment of the present application further provides a computing device cluster, which includes at least one computing device 700. The storage unit 702 in one or more computing devices 700 in the computing device cluster may store the same or different instructions for executing the causal relationship discovery method.

[0206] Embodiments of the present application also provide a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the causal relationship discovery method.

[0207] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a high-density digital video disc (DVD)), or a semiconductor medium (for example, a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the causal relationship discovery method.

[0208] The above embodiments can be implemented in whole or in part through software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. A computer program product includes multiple computer instructions. When the computer program instructions are loaded or executed on a computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.

[0209] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent repairs or replacements within the technical scope disclosed in the present invention, and such repairs or replacements should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A causal relationship discovery method, characterized in that: The method is applied to a causal relationship discovery system, and the method comprises: Obtaining a data set and a number of groups input by a user, and dividing the data set into a plurality of category groups, wherein the data set includes observation data of a plurality of objects, each of the plurality of category groups includes at least one object, and the causal graphs of the objects in the same category group are the same; The multiple sub-models are trained using the multiple category groups to obtain a causal graph corresponding to each category group in the multiple category groups, wherein one category group is used to train one sub-model, and one sub-model is used to generate a causal graph corresponding to the category group.

2. The method according to claim 1, characterized in that The using the multiple category groups to train multiple sub-models comprises: Acquire a knowledge set input by a user, wherein the observation data of the plurality of objects include a plurality of variables, and the knowledge set includes a known causal relationship between at least two variables of the plurality of variables; The plurality of sub-models are trained using the knowledge set and the plurality of category groups.

3. The method according to claim 2, characterized in that The known causal relationship is obtained based on prior knowledge, and the known causal relationship includes a first causal relationship determined by a causal direction and a quantitative relationship value.

4. The method according to claim 2 or 3, characterized in that: The known causal relationship includes a second causal relationship whose causal direction is determined and whose quantitative relationship value is a non-zero unknown value.

5. The method according to any one of claims 2 to 4, characterized in that: The known causal relationship includes a third causal relationship with a determined causal direction and an unknown quantitative relationship value.

6. The method according to any one of claims 1 to 5, characterized in that: The using the multiple category groups to train the multiple sub-models to obtain the causal graph corresponding to each category group in the multiple category groups comprises: Get the penalty threshold entered by the user; For any first model of the plurality of sub-models, execute: Performing multiple rounds of training on the first model using the category group corresponding to the first model, and when the difference between the current output result of the first model and the output result of the previous round of training is not less than the penalty threshold, performing the next round of training on the first model using the current output result as a penalty parameter, wherein the penalty parameter is used to constrain the range of variation of the model parameters of the first model in the next round of training, and the larger the penalty parameter, the smaller the constraint on the range of variation; When the difference between the output result of the first model and the output result of the previous round is smaller than the penalty threshold, a causal graph corresponding to each category group in the multiple category groups is obtained according to the output result of the first model.

7. The method according to any one of claims 1 to 5, characterized in that: The dividing the data set into a plurality of category groups comprises: Dividing the data set into a plurality of initial category groups according to the number of groupings input by a user; Using the multiple initial category groups to train multiple sub-models to obtain multiple initial causal graphs, wherein one initial category group is used to train one sub-model; Substituting the observation data of each object in the multiple objects into the multiple initial causal graphs to obtain multiple substitution results for each object; According to the multiple substitution results of each object, the category group to which each object belongs is determined, and multiple category groups of the data set are obtained.

8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Acquire data to be processed input by a user, wherein the data to be processed includes observation data of multiple objects to be processed; Substituting the observation data of the multiple objects to be processed into the multiple cause-effect graphs to obtain multiple substitution results for each of the multiple objects to be processed; Determining, according to the multiple substitution results of each object to be processed, the category group to which each object to be processed belongs; According to the cause-effect graph corresponding to the category group to which each object to be processed belongs, one or more cause-effect graphs corresponding to the data to be processed are determined.

9. A causal relationship discovery system, characterized in that: The system comprises: an acquisition unit, configured to acquire a data set and a number of groups input by a user, and divide the data set into a plurality of category groups, wherein the data set includes observation data of a plurality of objects, each of the plurality of category groups includes at least one object, and the causal graphs of the objects in the same category group are the same; A training unit is used to train multiple sub-models using the multiple category groups to obtain a causal graph corresponding to each category group in the multiple category groups, wherein one category group is used to train one sub-model, and one sub-model is used to generate a causal graph corresponding to the category group.

10. The system according to claim 9, characterized in that The system further comprises a knowledge injection unit, The acquisition unit is used to acquire a knowledge set input by a user, wherein the observation data of the multiple objects include multiple variables, and the knowledge set includes a known causal relationship between at least two variables of the multiple variables; The knowledge injection unit is used to train the multiple sub-models using the knowledge set and the multiple category groups.

11. The system according to claim 9, characterized in that The known causal relationship is obtained based on prior knowledge, and the known causal relationship includes a first causal relationship determined by a causal direction and a quantitative relationship value.

12. The system according to claim 10 or 11, characterized in that The known causal relationship includes a second causal relationship whose causal direction is determined and whose quantitative relationship value is a non-zero unknown value.

13. The system according to any one of claims 10 to 12, characterized in that: The known causal relationship includes a third causal relationship with a determined causal direction and an unknown quantitative relationship value.

14. The system according to any one of claims 9 to 13, characterized in that: The system further comprises a penalty unit, The acquisition unit is used to acquire a penalty threshold input by a user; The penalty unit is used to execute on any first model among the multiple sub-models: use the category group corresponding to the first model to perform multiple rounds of training on the first model, and when the gap between the current output result of the first model and the output result of the previous round of training is not less than the penalty threshold, use the current output result as a penalty parameter to perform the next round of training on the first model, and the penalty parameter is used to constrain the range of variation of the model parameters of the first model in the next round of training, and the larger the penalty parameter, the smaller the constraint on the range of variation; when the gap between the output result of the first model and the output result of the previous round is less than the penalty threshold, obtain the causal graph corresponding to each category group in the multiple category groups according to the output result of the first model.

15. The system according to any one of claims 9 to 14, characterized in that: The system further comprises a grouping unit and a grouping updating unit, The grouping unit is used to divide the data set into a plurality of initial category groups according to the number of groups input by the user; The training unit is used to train multiple sub-models using the multiple initial category groups to obtain multiple initial causal graphs, wherein one initial category group is used to train one sub-model; The grouping updating unit is used to substitute the observation data of each object in the multiple objects into the multiple initial causal graphs to obtain multiple substitution results for each object; The grouping updating unit is used to determine the category group to which each object belongs according to the multiple substitution results of each object, so as to obtain the multiple category groups of the data set.

16. The system according to any one of claims 9 to 15, characterized in that: The system also includes an output unit and a group prediction unit, The acquisition unit is further used to acquire the data to be processed input by the user, wherein the data to be processed includes observation data of multiple objects to be processed; The group prediction unit is used to substitute the observation data of the multiple objects to be processed into the multiple causal graphs to obtain multiple substitution results for each of the multiple objects to be processed; The group prediction unit is used to determine the category group to which each object to be processed belongs according to the multiple substitution results of each object to be processed; The output unit is used to determine one or more cause-effect graphs corresponding to the data to be processed according to the cause-effect graph corresponding to the category group to which each object to be processed belongs.

17. A computing device, characterized in that The computing device includes a processor and a memory, wherein the memory is used to store instructions, and the processor is used to execute the instructions, so that the computing device implements the system according to any one of claims 1 to 8.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and the instructions are executed by a computing device or a computing device cluster to implement the system according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Service rule automatic generation method and system

    CN112365344A

  • Model construction method and related device

    CN116384760A

  • Dynamic causal discovery in imitation learning

    US20230080424A1

  • Neural network construction method and apparatus

    WO2022083536A1

Cited By

  • Landscaping engineering project intelligent management system based on big data analysis

    CN122175534A