User travel decision causal analysis method based on anti-fact data augmentation
By using a counterfactual data augmentation method, user-related, interest-related, and spatiotemporal-related factors are defined. A decision structure learner and a counterfactual comparison learner are constructed using a self-projection attention mechanism and a sparse likelihood estimation method. Counterfactual decisions are generated and causal dependency scores are learned, which solves the problems of insufficient data and false interpretations in causal analysis in existing technologies, and achieves more accurate causal explanations and support for downstream tasks.
Patent Information
- Application Number
- CN202410991249.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-26
Smart Images

Figure CN119026687A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of causal inference, and in particular to a method for causal analysis of user travel decisions based on counterfactual data augmentation. Background Art
[0002] With the rapid development of smart mobile devices and Internet technology, network information has shown an explosive growth trend, announcing that we have entered the era of big data and digitalization. With the continuous improvement and advancement of the Global Positioning System (GPS) technology, a large number of location-based network services (LBNS) have emerged, promoting the rapid development of route planning navigation, point of interest location search, and livelihood service guarantee, providing security and convenience for the daily lives of urban residents. The emergence of LBNS (such as Dianping, Amap, etc.) has also attracted tens of millions of users to share their life information, such as check-in records, travel experiences, etc. These information closely related to mass travel and urban development can not only promote the rapid development of the country and cities, but also bring commercial benefits to enterprises and various social institutions.
[0003] The large amount of data generated by LBNS has opened up a new research path in the field of urban computing and spawned a new subfield in personalized recommendation systems, namely point of interest recommendation, which can recommend places of interest to users in a personalized way, provide travel services, and help them explore urban life. In order to gain a deeper understanding of user behavior and promote the development of applications such as user analysis, product recommendation, and business intelligence, it is very important to conduct causal analysis on users' urban travel decisions. Causal analysis of user travel decisions attempts to find out the real factors that really affect users' decisions on points of interest, so that users' behavioral decisions can be better explained and better serve downstream applications.
[0004] In general, the explanation of user decisions is mainly based on external data, including user ratings, comments, and item attributes. For example, Wang et al. further generalized explainable recommendations based on matrix decomposition through multi-task learning on tensors, which can predict the user's preference for items at the feature level and generate textual explanations. Wu et al. proposed a new context-fusion-aware model to better understand the user's rating behavior by integrating the interaction between users and items and user comment information. Lu et al. added a review discriminator based on adversarial sequence-to-sequence learning in the joint optimization framework so that the generator can generate natural language explanations for users and their recommendation results.
[0005] Although there are many existing research works on explaining user decisions, most of the existing methods are based on external data, which are easily limited by insufficient external data and incomplete feature selection, and cannot provide a general solution. In addition, the above work mainly learns the correlation between users and decision items and directly uses it as a causal explanation, ignoring that items with strong correlations may not be the cause of user decisions, thus generating false explanations. False explanations will affect the effectiveness and reliability of the model, making it difficult to perform downstream tasks. Summary of the invention
[0006] The purpose of the present invention is to provide a user travel decision causal analysis method based on counterfactual data augmentation in order to address the problems existing in the above-mentioned prior art.
[0007] The technical solution to achieve the purpose of the present invention is: on the one hand, a method for causal analysis of user travel decisions based on counterfactual data augmentation is provided, and the method comprises the following steps:
[0008] Step 1: Define three types of factors: user-related, interest point-related, and time-space related, and construct a factor representation of user behavior decision-making;
[0009] Step 2, using the self-projection attention mechanism and sparse likelihood estimation method to calculate the mutual contribution between the factors and learn the possibility of the current factor becoming a correlation factor;
[0010] Step 3, construct a decision structure learner to maintain the user's decision structure by maximizing the scalar projection objective;
[0011] Step 4: construct a counterfactual contrast learner, construct counterfactual distribution decision samples, and learn factor representation;
[0012] Step 5, constructing and training a sign-in rate prediction model R based on the decision structure learner and the counterfactual contrast learner to predict the probability of a decision;
[0013] Step 6: construct a counterfactual representation generator to generate counterfactual decisions;
[0014] Step 7: construct a causal dependency learner to learn the causal dependency score of each factor based on augmented counterfactual decisions;
[0015] Step 8: Sort the causal dependencies of each factor in the decision and output the intersection of the k factors with the highest causal dependencies and the correlation factor to generate a causal explanation at the factor level.
[0016] On the other hand, a user travel decision causal analysis system based on counterfactual data augmentation is provided, the system comprising:
[0017] The first module is used to define three types of factors: user-related, interest point-related, and time-space related, and to construct a factor representation of user behavior decisions;
[0018] The second module is used to calculate the mutual contribution between the factors and learn the possibility of the current factor becoming a correlation factor by using a self-projection attention mechanism and a sparse likelihood estimation method;
[0019] The third module is used to build a decision structure learner to maintain the user's decision structure by maximizing the scalar projection objective;
[0020] The fourth module is used to construct a counterfactual contrast learner, construct counterfactual distribution decision samples, and learn factor representations;
[0021] A fifth module is used to construct and train a sign-in rate prediction model R based on the decision structure learner and the counterfactual contrast learner to predict the probability of a decision;
[0022] The sixth module is used to build a counterfactual representation generator to generate counterfactual decisions;
[0023] The seventh module is used to build a causal dependency learner, which learns the causal dependency score of each factor based on augmented counterfactual decisions;
[0024] The eighth module is used to sort the causal dependencies of each factor in the decision and output the intersection of the k factors with the highest causal dependencies and the correlation factor to generate a causal explanation at the factor level.
[0025] Compared with the prior art, the present invention has the following significant advantages:
[0026] 1) We innovatively designed a joint counterfactual contrastive learning paradigm, which uses a self-projection attention mechanism and sparse likelihood estimation method to mine relevant factors that have an important impact on user decisions.
[0027] 2) A maximization scalar projection optimization objective is proposed to preserve the user decision structure and better learn factor representations.
[0028] 3) A counterfactual representation generator is designed to generate counterfactual decisions, which alleviates data sparsity and helps explore more potential causal factors through a simple causal dependency learner.
[0029] The present invention is further described in detail below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 Flowchart of the causal analysis method for user travel decisions based on counterfactual data augmentation.
[0031] Figure 2Graph showing the model fidelity results in one embodiment.
[0032] Figure 3 FIG. 1 is a schematic diagram showing the influence of hyperparameters γ and τ on the check-in rate prediction performance in an embodiment, wherein Figure 3 (a) shows that the present invention is affected by the hyperparameter γ on the F1 index. Figure 3 (b) shows that the AUC index of the present invention is affected by the hyperparameter γ. Figure 3 (c) shows that the F1 index of the present invention is affected by the hyperparameter τ. Figure 3 (d) shows that the AUC index of the present invention is affected by the hyperparameter τ.
[0033] Figure 4 Schematic diagram of the effect of hyperparameter m on model fidelity in one embodiment. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0035] It should be noted that if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0036] In one embodiment, in combination Figure 1 , a method for causal analysis of user travel decisions based on counterfactual data augmentation is provided, the method comprising the following steps:
[0037] Step 1: Define three types of factors: user-related, interest point-related, and time-space related, and construct a factor representation of user behavior decision-making;
[0038] Step 2, using the self-projection attention mechanism and sparse likelihood estimation method to calculate the mutual contribution between the factors and learn the possibility of the current factor becoming a correlation factor;
[0039] Step 3, construct a decision structure learner to maintain the user's decision structure by maximizing the scalar projection objective;
[0040] Step 4: construct a counterfactual contrast learner, construct counterfactual distribution decision samples, and learn factor representation;
[0041] Step 5, constructing and training a sign-in rate prediction model R based on the decision structure learner and the counterfactual contrast learner to predict the probability of a decision;
[0042] Step 6: construct a counterfactual representation generator to generate counterfactual decisions;
[0043] Step 7: construct a causal dependency learner to learn the causal dependency score of each factor based on augmented counterfactual decisions;
[0044] Step 8: Sort the causal dependencies of each factor in the decision and output the intersection of the k factors with the highest causal dependencies and the correlation factor to generate a causal explanation at the factor level.
[0045] Further, in one embodiment, the three types of factors described in step 1 are specifically:
[0046] User-related factors, including user ID and the frequency with which users visit different POI categories;
[0047] POI related factors, including POI ID, POI category, POI brand and POI popularity; where POI popularity needs to be logarithmically normalized to be divided into 6 levels: (i) when z1≤-1, it means that the popularity of the POI is very low; (ii) when z1∈(-1,-0.5], it means that the POI is not popular; (iii) when z1∈(-0.5,0], it means that the POI is relatively unpopular; (iv) when z1∈(0,0.5], it means that the POI is relatively popular; (v) when z1∈(0.5,1], it means that the POI is popular; (vi) when z1>1, it means that the POI is very popular; where z1 is the value of the POI popularity after logarithmically normalized processing;
[0048] The time-space related factors include the user's check-in time, day of the week, map query behavior time period, and the spatial distance between the query point of interest and the check-in point of interest. The spatial distance is divided into five levels: (i) less than or equal to 1 km; (ii) 1 km to 3 km; (iii) 3 km to 7 km; (iv) 7 km to 15 km; and (v) greater than or equal to 15 km.
[0049] Furthermore, in one embodiment, the self-projection attention mechanism and the sparse likelihood estimation method are used in step 2 to calculate the mutual contribution between the factors, specifically including:
[0050] Step 2-1, given a decision D = {f 1 , ..., fn} and its factor representation matrix F = [f 1 , ..., f n ] T ; where f i and f i They represent the i-th factor constituting the decision and its corresponding representation, i = 1, 2, .., n, where n is the number of factors constituting the decision;
[0051] Step 2-2, calculate the representation f of other factors j In the current factor representation f i Scalar projection on the scalar projection matrix P∈R between the two factors n×n :
[0052]
[0053] Where P ij is the element in the i-th row and j-th column of the scalar projection matrix P, T represents the transpose, R n×n Represents an n×n matrix:
[0054] Step 2-3, use the softmax function to normalize each row of P:
[0055]
[0056] For each factor fi, the attention representation representing the sum of the effects of other factors on fi The calculation formula is:
[0057]
[0058] The corresponding self-projection attention representation matrix is
[0059] Where P i: represents the data of the i-th row in P, is the element of the i-th row and j-th column of the normalized scalar projection matrix P; R n×d represents a matrix of n×d dimensions, where d is the dimension of the latent space;
[0060] Step 2-4, concatenate the original representation of the factor with the self-projected attention representation, expressed as:
[0061] Step 2-5: Input the concatenated result in step 2-4 into a multilayer perceptron (MLP) with a Dropout layer and a ReLU activation function to obtain a dense likelihood vector l∈R n :
[0062]
[0063] Step 2-6, calculate the sparse probability of each factor becoming a correlation factor:
[0064]
[0065] In the formula, Δ n-1 = {p∈R n |1 T p=1,p≥0} represents the probability simplex of n dimensions, is a sparse normalized vector indicating the relevance factors and their contribution to the decision.
[0066] Preferably, a three-layer MLP is used in steps 2-5, and the corresponding learnable matrix parameters are W 1 ∈R2 d×d , W 2 ∈R d×d and W 3 ∈R d×1 .
[0067] Further, in one embodiment, the step of constructing a decision structure learner in step 3 to maintain the user's decision structure by maximizing the scalar projection target specifically includes:
[0068] The correlation decision representation d obtained by weighted aggregation of correlation factors is calculated as:
[0069]
[0070] In the formula, F represents the factor representation matrix corresponding to the current decision, express The i-th element in ;
[0071] The optimization objective of maximizing the scalar projection is:
[0072]
[0073] Define the predicted check-in rate r(D) of user decision as:
[0074] r(D)=σ(f′ T d / |d|)
[0075] Where, σ(·) represents the sigmoid function;
[0076] The binary cross entropy loss function is used to make the predicted distribution close to the empirical distribution, thereby optimizing the factor representation and the optimization function L d for:
[0077]
[0078] In the formula, Defined as the experience check-in rate of user decision D. For the user's historical check-in decision, i.e., positive decision, its experience check-in rate is defined as 1, and for negative decision, its experience check-in rate is defined as 0; Represents the set of positive decision instances That is, the original user check-in data and the set of negative decision instances The union of .
[0079] Further, in one embodiment, the construction of the counterfactual contrastive learner in step 4 is specifically:
[0080] L c = max{d(F, F p )-d(F,F n )+δ,0}
[0081] In the formula, F p represents the positive and counterfactual samples obtained by replacing the correlation factor in the original decision factor representation F, F n represents the negative counterfactual sample obtained by replacing the supporting factor in F, d(·,·) represents the Euclidean distance between the factor representation F of the original decision and the counterfactual sample, and δ is the control d(F,F p ) and d(F, F n ) is a boundary hyperparameter for the maximum distance between
[0082] Further, in one embodiment, the overall optimization target O of the sign-in rate prediction model R in step 5 is R for:
[0083] O R =L d +γL c
[0084] Where γ represents the contribution of controlling the counterfactual contrastive learning optimization function.
[0085] After training with the above objectives, an accurate and robust factor representation can be obtained, and the relevance factors and support factors can be distinguished for each user decision.
[0086] Furthermore, in one embodiment, constructing a counterfactual representation generator in step 6 to generate a counterfactual decision specifically includes:
[0087] Step 6-1, the training objective of the counterfactual representation generator is:
[0088]
[0089]
[0090] In the formula, p(z) represents the prior distribution, Q θ (z|F) represents the inference network with input F, i.e., the encoder, p φ (F|z) represents the generator network with input z, i.e. the decoder. represents the expectation of the latent representation z sampled from the encoder, F c represents the counterfactual representation generated by the decoder, λ is a hyperparameter that balances the reconstruction loss and the model generation ability, KL represents the Kullback-Leibler divergence, and MSE represents the mean square error;
[0091] Step 6-2, pre-training the counterfactual representation generator based on the training objective;
[0092] Step 6-3, for each original decision D, input its factor representation F into the encoder of the counterfactual representation generator pre-trained by step 6-2, and sample the potential representation z m times with different noises, and then pass it through the decoder of the counterfactual representation generator to generate m counterfactual representations
[0093] Step 6-4, mapping the m counterfactual representations into factors with realistic meanings, defined as is a counterfactual decision, and each counterfactual decision The factors and their representations are expressed as and
[0094] Further, in one embodiment, the step 7 of constructing a causal dependency learner to learn the causal dependency score of each factor based on augmented counterfactual decisions specifically includes:
[0095] Step 7-1: For each original user decision D, its counterfactual decision Input into the check-in rate prediction model R trained in step 5 to predict the label of each counterfactual decision; for a user decision D, its label indicates whether the decision will occur;
[0096] Label Set It is expressed as:
[0097]
[0098] in,
[0099]
[0100] In the formula, R(·) represents the check-in rate prediction model;
[0101] Step 7-2: For each original decision D, further obtain the augmented decision-label pair set S D :
[0102]
[0103] Where m represents the number of counterfactual decisions, F D Denotes the original decision D, Y D Represents the label of the original decision D, with a value of 1;
[0104] Step 7-3, uniformly define S D Each decision-label pair in For each decision-label pair Extract Each factor in With label Pairing is done to construct factor-label pairs And perform deduplication processing, j = 1, 2, ..., n;
[0105] For each and Extracted factor-label pairs
[0106] First, use one-hot encoding to represent it:
[0107] H = {0, 1} T
[0108] Then, the logistic regression model Model the probability of:
[0109]
[0110] Where, σ(*)=1 / (1+e -* ), θ represents a trainable causal dependency score.
[0111] Furthermore, in one embodiment, the causal dependency of each factor in the decision is sorted in step 8, and the intersection of the k factors with the highest causal dependency and the correlation factor is output to generate a factor-level causal explanation, which specifically includes:
[0112] Step 8-1, in the decision-label pair set S D Select the factor-label pair with the same label as the original user decision, that is, Then they are sorted in descending order according to the causal dependency score;
[0113] Step 8-2, select the top k causal dependency scores 2 factor-label pairs And extract their factor parts
[0114] Step 8-3, take the set of correlation factors between C and the original user decision The intersection of and is denoted as ε;
[0115] Step 8-4: If there are one or more factors in ε, consider these factors as causal factors of the original user decision D and construct As a causal explanation of D.
[0116] In one embodiment, a user travel decision causal analysis system based on counterfactual data augmentation is provided, the system comprising:
[0117] The first module is used to define three types of factors: user-related, interest point-related, and time-space related, and to construct a factor representation of user behavior decisions;
[0118] The second module is used to calculate the mutual contribution between the factors and learn the possibility of the current factor becoming a correlation factor by using a self-projection attention mechanism and a sparse likelihood estimation method;
[0119] The third module is used to build a decision structure learner to maintain the user's decision structure by maximizing the scalar projection objective;
[0120] The fourth module is used to construct a counterfactual contrast learner, construct counterfactual distribution decision samples, and learn factor representations;
[0121] A fifth module is used to construct and train a sign-in rate prediction model R based on the decision structure learner and the counterfactual contrast learner to predict the probability of a decision;
[0122] The sixth module is used to build a counterfactual representation generator to generate counterfactual decisions;
[0123] The seventh module is used to build a causal dependency learner, which learns the causal dependency score of each factor based on augmented counterfactual decisions;
[0124] The eighth module is used to sort the causal dependencies of each factor in the decision and output the intersection of the k factors with the highest causal dependencies and the correlation factor to generate a causal explanation at the factor level.
[0125] For the specific limitations of the user travel decision causal analysis system based on counterfactual data augmentation, please refer to the limitations of the user travel decision causal analysis method based on counterfactual data augmentation above, which will not be repeated here. Each module in the above-mentioned user travel decision causal analysis system based on counterfactual data augmentation can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0126] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following is achieved:
[0127] Step 1: Define three types of factors: user-related, interest point-related, and time-space related, and construct a factor representation of user behavior decision-making;
[0128] Step 2, using the self-projection attention mechanism and sparse likelihood estimation method to calculate the mutual contribution between the factors and learn the possibility of the current factor becoming a correlation factor;
[0129] Step 3, construct a decision structure learner to maintain the user's decision structure by maximizing the scalar projection objective;
[0130] Step 4: construct a counterfactual contrast learner, construct counterfactual distribution decision samples, and learn factor representation;
[0131] Step 5, constructing and training a sign-in rate prediction model R based on the decision structure learner and the counterfactual contrast learner to predict the probability of a decision;
[0132] Step 6: construct a counterfactual representation generator to generate counterfactual decisions;
[0133] Step 7: construct a causal dependency learner to learn the causal dependency score of each factor based on augmented counterfactual decisions;
[0134] Step 8: Sort the causal dependencies of each factor in the decision and output the intersection of the k factors with the highest causal dependencies and the correlation factor to generate a causal explanation at the factor level.
[0135] For the specific limitations of each step, please refer to the limitations of the user travel decision-making causal analysis method based on counterfactual data augmentation mentioned above, which will not be repeated here.
[0136] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements:
[0137] Step 1: Define three types of factors: user-related, interest point-related, and time-space related, and construct a factor representation of user behavior decision-making;
[0138] Step 2, using the self-projection attention mechanism and sparse likelihood estimation method to calculate the mutual contribution between the factors and learn the possibility of the current factor becoming a correlation factor;
[0139] Step 3, construct a decision structure learner to maintain the user's decision structure by maximizing the scalar projection objective;
[0140] Step 4: construct a counterfactual contrast learner, construct counterfactual distribution decision samples, and learn factor representation;
[0141] Step 5, constructing and training a sign-in rate prediction model R based on the decision structure learner and the counterfactual contrast learner to predict the probability of a decision;
[0142] Step 6: construct a counterfactual representation generator to generate counterfactual decisions;
[0143] Step 7: construct a causal dependency learner to learn the causal dependency score of each factor based on augmented counterfactual decisions;
[0144] Step 8: Sort the causal dependencies of each factor in the decision and output the intersection of the k factors with the highest causal dependencies and the correlation factor to generate a causal explanation at the factor level.
[0145] For the specific limitations of each step, please refer to the limitations of the user travel decision-making causal analysis method based on counterfactual data augmentation mentioned above, which will not be repeated here.
[0146] As a specific example, in one of the embodiments, the present invention is further verified and explained.
[0147] This embodiment uses two POI recommendation datasets: City 1 Check-in dataset (SH) and City 2 Check-in dataset (NYC), and a movie recommendation dataset: MovieLens (ml1m). It is worth noting that in order to verify the generalization ability of the FCE-UTD model (the present invention), the user's rating behavior of movies in ml1m is regarded as the POI check-in behavior. The City 1 dataset (SH) is provided by a third-party map service platform and contains the user's map query behavior records and check-in behavior records. Similar to the data processing method adopted by Hu et al., each user map query list consists of the following parts: a user identifier (user ID), and a user query list. The user query list consists of several user query records, each query record includes the time of the user query and the queried POI and its attribute information (category and geographic location). For each query, if the user visits a POI in the query list within the next two days, a positive decision instance is constructed, and a negative decision instance is constructed using those queried POIs that have not been visited. If there is no POI in the user's query list that is subsequently visited, the query record is filtered. In addition, the present invention calculates the popularity of the point of interest by the frequency of its visit, and calculates the distance between the queried point of interest and the user's final check-in point of interest according to the latitude and longitude coordinates. The City 2 dataset (NYC) is generated based on the public check-in dataset Foursquare, which contains information about points of interest and user check-in records. Each check-in record of the user is defined as a positive decision instance, and further uses the factors of the points of interest of the same category as the check-in point of interest to replace the factors related to the points of interest in the original decision, thereby constructing a negative decision instance. The calculation method of the popularity of the points of interest in the City 2 dataset is the same as that of the City 1 dataset. In addition, since the location of the user's decision in this dataset is unknown, the distance factor is not considered. MovieLens 1M (ml1m) is generated based on the MovieLens dataset, which contains records of user rating behavior. Specifically, user-related factors are constructed based on the user's age, gender, occupation, and the most frequently watched movie type. The factors related to movies include movie types and movie popularity, where popularity is calculated based on the movie's rating frequency, and the processing method is similar to that of the popularity of points of interest. Finally, each user rating behavior is regarded as a positive decision instance, and negative decision instances are generated by randomly replacing movies that the user has not rated and their related factors. For the SH, NYC, and ml1m datasets, the Adam optimizer with a learning rate of r = 0.01 / 0.005 / 0.001 is used to optimize the model parameters. The present invention adopts a small batch model training method to train FCE-UTD, and the batch size B is set to 512. For all comparison methods, the model hidden layer dimension d is set to 64, and τ = 0.5, γ = 1.0, and δ = 1.2 are set. The default setting is that the number of augmented counterfactual decisions m = 100.In addition, the parameter of the Dropout layer is set to 0.2. For the counterfactual representation generator, both its encoder and decoder parts are implemented using two-layer MLP. The encoder and decoder hidden dimensions are set to 32, and the dimension of the latent representation z is set to 48. In addition, for the three datasets, if the F1 on the validation set does not increase within 5 / 10 / 5 epochs, the training is stopped early. For the AR model, it is sorted by its support value by default to generate factor-level explanations, and the optimal parameters are set: support = 0.001 for finding frequent item sets, min threshold = 0.001 for extracting association rules, and length = 2 for filtering. Finally, all rules extracted based on the support value are used as explanations. Precision (abbreviated as Pre), recall (abbreviated as Rec), F1 and AUC are used to evaluate the performance of the check-in rate prediction task, and model fidelity is used to evaluate the model's ability to generate causal explanations.
[0148] This embodiment selects different popular check-in rate prediction methods as comparison methods to conduct comparative experiments: Bayesian personalized ranking (BPR), multi-type item set embedding (Learnsuc), simplified graph convolution paradigm for recommendation (SVD-GCN), recommendation model based on ultra-simplified graph convolution network (UltraGCN), hypergraph contrastive collaborative filtering (HCCF), recommendation method using causal representation to distinguish user interests and consistency (DICE), urban knowledge graph enhanced point of interest recommendation (UKGC), decision analysis of user point of interest selection (PROUD) and association rules (AR). The method of the present invention is recorded as FCE-UTD.
[0149] Tables 1 and 2 show the results of different methods on the check-in rate prediction task.
[0150] Table 1 Check-in rate prediction performance (SH and NYC)
[0151]
[0152] Table 2 Check-in rate prediction performance (ml1m)
[0153]
[0154] As can be seen from the table, the FCE-UTD framework of the present invention is significantly better than all the comparison methods in all datasets and four evaluation indicators, especially in terms of precision, which reflects that the model of the present invention can effectively distinguish the real decision instances without sacrificing the recall rate, proving the effectiveness and generalization of FCE-UTD. For the experimental results of other baseline methods, the following findings are made: 1) UKGC, HCCF, UltraGCN and SVDGCN are all recommendation methods based on graph neural networks (GNN) and collaborative filtering. Specifically, UKGC and HCCF show similar performance in the SH dataset, mainly because they both perform information propagation on multiple graphs, enabling them to learn sufficient neighbor information. However, the serious data scarcity problem still affects their overall performance. In addition, in the NYC dataset, the performance of HCCF is better than UKGC overall, mainly because UKGC is affected by the richness of the context, while HCCF can effectively integrate the explicit and implicit user-POI relationships to alleviate data sparsity and obtain more accurate user and POI representations through the contrastive learning paradigm. UltraGCN performs better than the above two methods in SH, mainly because it filters out user-POI and POI-POI relationships with less information, thereby avoiding introducing too much noise. Compared with UltraGCN, SVDGCN filters out items with smaller singular values from the perspective of singular value decomposition to reduce noise. However, UltraGCN performs poorly on the NYC and ml1m datasets, which is mainly due to the small scale of these two datasets, which limits the information extraction process of UltraGCN; 2) Secondly, DICE performs well because it learns a representation of POIs that eliminates consistency bias and can better learn the user's true preferences; 3) Learnsuc performs poorly on all datasets, which is mainly because the positive and negative decision instances only differ in a small number of factors related to POIs, which increases the difficulty of modeling user behavior; 4) Due to the relatively low data scarcity of NYC and ml1m datasets, BPR performs better on these two datasets than SH dataset; 5) Finally, the comparison between FCE-UTD and PROUD can be regarded as an ablation experiment of the factor correlation learning module, which shows the effectiveness of the counterfactual contrastive learning module proposed in this invention in factor representation learning.
[0155] To show the percentage of decisions that the proposed FCE-UTD framework can explain, we report the results of model fidelity. Specifically, we set the number of causal factors constituting explanations to 1 (i.e., k 2 =1), and define FCE-UTD-c as a variant that does not consider counterfactual contrastive learning. The final experimental results are as follows Figure 2As shown. It can be clearly seen that FCE-UTD achieves the highest fidelity in all datasets, which demonstrates the superiority of the counterfactual representation generator in the causal explanation framework of the present invention. Through the counterfactual representation generator, many counterfactual decisions can be generated, and the influence between factors and decisions can be fully explored, and more potential causal relationships can be extracted, thereby generating causal explanations for user decisions. In addition, the performance of association rules (AR) is the worst, which shows that AR cannot mine enough association rules when the user does not interact enough with the points of interest. If the user has only visited a point of interest once or rated a movie once, it is difficult to match the global association rules with the current decision, so AR can only generate explanations for a few decisions. Finally, FCE-UTD-c only obtained suboptimal results, indicating that counterfactual transformation of the original user decision helps to learn more generative factor representations.
[0156] In order to explore the impact of hyperparameters on the sign-in rate prediction task, the present invention uses the two indicators of F1 and AUC to evaluate the hyperparameter γ that controls the contribution of the counterfactual contrastive learning optimization function and the hyperparameter τ that controls the factor replacement ratio in counterfactual contrastive learning. It is worth noting that F1 and AUC are used because they consider both the precision and recall indicators and provide a more comprehensive evaluation. The experimental results are shown in Figure 2. Figure 3 shown.
[0157] Figure 3 (a) and Figure 3 (b) in Figure 1 shows the change in the check-in rate prediction performance when γ changes. It can be seen that for the SH dataset, the best results are achieved when γ = 0.3; for the NYC dataset, the best results are achieved when γ = 0.4 or 0.5; for the ml1m dataset, the best results are achieved when γ ∈ [0.2, 0.5]. The above results show that too small γ will limit the effectiveness of counterfactual contrastive learning, while too large γ will reduce the model's ability to maintain the decision structure and introduce more noise.
[0158] Figure 3 (c) and Figure 3 (d) in the figure shows the change of the hyperparameter τ, which controls the factor replacement ratio in counterfactual contrastive learning, on the performance of sign-in rate prediction. As can be seen from the figure, the best result is achieved when τ = 0.3 for the SH dataset, and the best result is achieved when τ = 0.5 for the NYC and ml1m datasets. This shows that when τ is relatively small, the counterfactual contrastive learning objective will be affected, and too large τ will introduce too much noise from the random factor replacement process, thereby affecting the accuracy of representation learning.
[0159] In addition, the present invention also evaluates the impact of the number of counterfactual decisions m on the model fidelity. The results are as follows: Figure 4shown.
[0160] As can be seen from the figure, when m increases, the model fidelity also increases; when m is relatively small, the random noise generated by the counterfactual representation generator increases the probability that the model extracts factors other than the original factors as causal explanations, thereby reducing the model fidelity. However, when m becomes larger, rich counterfactual decisions can help the model better explore the causal relationship between each factor and the decision, and the number of counterfactual decisions containing the original factors will also increase, thereby offsetting this noise from a statistical perspective and improving the model fidelity.
[0161] In addition, in order to prove that the factor-level causal explanations mined by FCE-UTD can help the execution of downstream tasks, the present invention constructs a corresponding Out-Of-Distribution (OOD) dataset based on the three original datasets, and conducts additional experiments on the recommendation task on the original dataset and the OOD dataset respectively. In order to construct the OOD dataset, for the two user check-in datasets SH and NYC, all decisions are divided according to the categories of points of interest visited; for the ml1m dataset, all decisions are divided according to the user's occupation. In addition, the divided user decisions are divided into a training set and a test set, and then a small part is divided from the training set as a validation set. Specifically, causal factors are first mined for each decision in the test set. Then, for each user-item pair (u i ,v j ), extract the identifier factors of users and items, and then simply sum these factors with the mined causal factors to form the representations of users and items. It is worth noting that in order to ensure fairness and universality, only causal factors related to users or items are used. Finally, the inner product between the user and item representations is calculated to calculate (u i ,v j ) score:
[0162]
[0163] In the formula, and They represent the causal factors related to users and items, respectively. Finally, the recall rate Recall@k and the normalized discounted cumulative gain NDCG@k are used to test the recommendation performance of the causal factors. It is worth noting that by default, only one causal factor is generated for each user decision. FCE-UTD-E is a variant that replaces the correlation factor with the causal factor.
[0164] Tables 3, 4, and 5 show the results on the original dataset and the OOD dataset, respectively.
[0165] Table 3 Recommendation performance on the original SH dataset and the OOD SH dataset (Rec@k and N@k are the abbreviations of Recall@k and NDCG@k, respectively)
[0166]
[0167] Table 4 Recommendation performance on the original NYC dataset and OOD NYC dataset
[0168]
[0169]
[0170] Table 5 Recommendation performance on the original ml1m dataset and OOD ml1m dataset
[0171]
[0172] As can be seen from the table, for the small-scale original datasets (i.e., NYC and ml1m), SVDGCN can achieve good results, which shows that the truncated SVD decomposition can extract effective features and reduce the noise from small singular value vectors. In addition, NGCF performs well on NDCG@5, indicating that NGCF can effectively learn multi-hop (3-hop) neighbor information, thereby having better ranking quality in a longer range. In the large-scale dataset SH, UltraGCN can filter out user-item relationships with limited information due to the simplified model structure, and achieves good results. In OOD SH, WRMF is more effective than other more complex models in the case of unbalanced data distribution, which may be because its simple structure helps to avoid overfitting. For OOD NYC and OOD ml1m, NGCF also achieves good results, which highlights the strong ranking ability in terms of NDCG@5. Finally, the method of the present invention achieves the best performance on both the original dataset and the OOD dataset, which proves the superiority of the mined causal factors and can effectively help the execution of downstream tasks. Compared with the representation using correlation factors (i.e., FCE-UTD-E), FCE-UTD uses causal factors, which can effectively avoid being misled by false explanations and make user and item representations contain some causal orientations. Finally, the generalization of the proposed method is further verified through experiments on ml1m and OOD ml1m.
[0173] In summary, the causal analysis method of user travel decisions based on counterfactual data augmentation proposed in the present invention can deeply explore the causal factors that really affect user decisions, effectively avoid being misled by false explanations, improve the effectiveness and reliability of the model, and help the execution of downstream tasks. By designing a factor correlation learner based on maximizing scalar projection, combined with an effective counterfactual contrastive learning paradigm, the representation of all factors is optimized in a pre-training manner, and the correlation score of each factor is mined. By designing a causal explanation learner based on counterfactual data augmentation, causal factors are explored from correlation factors, and finally explanations are generated for user travel decisions. Finally, through a large number of experiments on three real-world datasets, the effectiveness of the proposed method in terms of check-in rate, model fidelity, and downstream recommendation tasks in different behavioral scenarios was verified.
[0174] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.
Claims
1. A causal analysis method for user travel decision-making based on counterfactual data augmentation, characterized in that: The method comprises the following steps: Step 1: Define three types of factors: user-related, interest point-related, and time-space related, and construct a factor representation of user behavior decision-making; Step 2, using the self-projection attention mechanism and sparse likelihood estimation method to calculate the mutual contribution between the factors and learn the possibility of the current factor becoming a correlation factor; Step 3, construct a decision structure learner to maintain the user's decision structure by maximizing the scalar projection objective; Step 4: construct a counterfactual contrast learner, construct counterfactual distribution decision samples, and learn factor representation; Step 5, constructing and training a sign-in rate prediction model R based on the decision structure learner and the counterfactual contrast learner to predict the probability of a decision; Step 6: construct a counterfactual representation generator to generate counterfactual decisions; Step 7: construct a causal dependency learner to learn the causal dependency score of each factor based on augmented counterfactual decisions; Step 8: Sort the causal dependencies of each factor in the decision and output the intersection of the k factors with the highest causal dependencies and the correlation factor to generate a causal explanation at the factor level.
2. The method for causal analysis of user travel decisions based on counterfactual data augmentation according to claim 1, characterized in that: The three types of factors described in step 1 are: User-related factors, including user ID and the frequency with which users visit different POI categories; POI related factors, including POI ID, POI category, POI brand and POI popularity; where POI popularity needs to be logarithmically normalized to be divided into 6 levels: (i) when z1≤-1, it means that the popularity of the POI is very low; (ii) when z1∈(-1,-0.5], it means that the POI is not popular; (iii) when z1∈(-0.5,0], it means that the POI is relatively unpopular; (iv) when z1∈(0,0.5], it means that the POI is relatively popular; (v) when z1∈(0.5,1], it means that the POI is popular; (vi) when z1>1, it means that the POI is very popular; where z1 is the value of the POI popularity after logarithmically normalized processing; The time-space related factors include the user's check-in time, day of the week, map query behavior time period, and the spatial distance between the query point of interest and the check-in point of interest. The spatial distance is divided into five levels: (i) less than or equal to 1 km; (ii) 1 km to 3 km; (iii) 3 km to 7 km; (iv) 7 km to 15 km; and (v) greater than or equal to 15 km.
3. The method for causal analysis of user travel decisions based on counterfactual data augmentation according to claim 2, characterized in that: In step 2, the self-projection attention mechanism and sparse likelihood estimation method are used to calculate the mutual contribution between the factors, specifically including: Step 2-1, given a decision D = {f1,…,f n } and its factor representation matrix F = [f1,…,f n ] T ; where f i and f i They represent the i-th factor constituting the decision and its corresponding representation, i = 1, 2, ..., n, where n is the number of factors constituting the decision; Step 2-2, calculate the representation f of other factors j In the current factor representation f i Scalar projection on the scalar projection matrix P∈R between the two factors n×n : Where P ij is the element in the i-th row and j-th column of the scalar projection matrix P, T represents the transpose, R n×n represents an n×n matrix; Step 2-3, use the softmax function to normalize each row of P: For each factor f i , indicating the effect of other factors on f i The sum of the effects of attention The calculation formula is: The corresponding self-projection attention representation matrix is Where P i: represents the data of the i-th row in P, is the element of the i-th row and j-th column of the normalized scalar projection matrix P; R n×d represents a matrix of n×d dimensions, where d is the dimension of the latent space; Step 2-4, concatenate the original representation of the factor with the self-projected attention representation, expressed as: Step 2-5: Input the concatenated result in step 2-4 into the multi-layer perceptron MLP with Dropout layer and ReLU activation function to obtain a dense likelihood vector l∈R n : Step 2-6, calculate the sparse probability of each factor becoming a correlation factor: In the formula, Δ n-1 = {p∈R n |1 T p=1,p≥0} represents the n-dimensional probability simplex, is a sparse normalized vector indicating the relevance factors and their contribution to the decision.
4. The method for causal analysis of user travel decisions based on counterfactual data augmentation according to claim 3 is characterized in that: In steps 2-5, a three-layer MLP is used, and the corresponding learnable matrix parameters are W1∈R 2d×d , W2∈R d×d and W3∈R d×1 .
5. The method for causal analysis of user travel decisions based on counterfactual data augmentation according to claim 3 is characterized in that: The decision structure learner described in step 3 is constructed to maintain the user's decision structure by maximizing the scalar projection objective, specifically including: The correlation decision representation d obtained by weighted aggregation of correlation factors is calculated as: In the formula, F represents the factor representation matrix corresponding to the current decision, express The i-th element in ; The optimization goal of maximizing the scalar projection is: Define the predicted check-in rate r(D) of user decision as: r(D)=σ(f' T d / |d|) Where, σ(·) represents the sigmoid function; The binary cross entropy loss function is used to make the predicted distribution close to the empirical distribution, thereby optimizing the factor representation and the optimization function L d for: In the formula, Defined as the experience check-in rate of user decision D. For the user's historical check-in decision, i.e., positive decision, its experience check-in rate is defined as 1, and for negative decision, its experience check-in rate is defined as 0; Represents the set of positive decision instances That is, the original user check-in data and the set of negative decision instances The union of .
6. The method for causal analysis of user travel decisions based on counterfactual data augmentation according to claim 5, characterized in that: Constructing a counterfactual contrastive learner as described in step 4 is as follows: L c =max{d(F,F p )-d(F,F n )+δ,0} In the formula, F p represents the positive and counterfactual samples obtained by replacing the correlation factor in the original decision factor representation F, F n represents the negative counterfactual sample obtained by replacing the supporting factor in F, d(·,·) represents the Euclidean distance between the factor representation F of the original decision and the counterfactual sample, and δ is the control d(F,F p ) and d(F,F n ) is a boundary hyperparameter for the maximum distance between 7. The method for causal analysis of user travel decisions based on counterfactual data augmentation according to claim 6, characterized in that: The overall optimization goal O of the sign-in rate prediction model R in step 5 R for: THE R =L d +γL c Where γ represents the contribution of controlling the counterfactual contrastive learning optimization function.
8. The method for causal analysis of user travel decisions based on counterfactual data augmentation according to claim 7, characterized in that: Constructing a counterfactual representation generator as described in step 6 to generate counterfactual decisions specifically includes: Step 6-1, the training objective of the counterfactual representation generator is: In the formula, p(z) represents the prior distribution, Q θ (z|F) represents the inference network with input F, i.e., the encoder, p φ (F|z) represents the generator network with input z, i.e. the decoder. represents the expectation of the latent representation z sampled from the encoder, F c represents the counterfactual representation generated by the decoder, λ is a hyperparameter that balances the reconstruction loss and the model generation ability, KL represents the Kullback-Leibler divergence, and MSE represents the mean square error; Step 6-2, pre-training the counterfactual representation generator based on the training objective; Step 6-3, for each original decision D, its factor representation F is input into the encoder of the counterfactual representation generator pre-trained by step 6-2, and the latent representation z is sampled m times with different noises, and then generated by the decoder of the counterfactual representation generator. Step 6-4, mapping the m counterfactual representations into factors with realistic meanings, defined as is a counterfactual decision, and each counterfactual decision The factors and their representations are expressed as and 9. The method for causal analysis of user travel decisions based on counterfactual data augmentation according to claim 8, characterized in that: Step 7 describes the construction of a causal dependency learner, which learns the causal dependency score of each factor based on augmented counterfactual decisions, including: Step 7-1: For each original user decision D, its counterfactual decision Input into the check-in rate prediction model R trained in step 5 to predict the label of each counterfactual decision; for a user decision D, its label indicates whether the decision will occur; Label Set It is expressed as: in, In the formula, R(·) represents the check-in rate prediction model; Step 7-2: For each original decision D, further obtain the augmented decision-label pair set S D : Where m represents the number of counterfactual decisions, F D Denotes the original decision D, Y D Represents the label of the original decision D, with a value of 1; Step 7-3, uniformly define S D Each decision-label pair in For each decision-label pair Extract Each factor in With label Pairing is done to construct factor-label pairs And perform deduplication processing, j = 1, 2, ..., n; For each and Extracted factor-label pairs First, use one-hot encoding to represent it: H={0,1} T Then, the logistic regression model Model the probability of: Where, σ(*)=1 / (1+e -* ), θ represents a trainable causal dependency score.
10. The method for causal analysis of user travel decisions based on counterfactual data augmentation according to claim 9, characterized in that: Step 8 sorts the causal dependency of each factor in the decision, outputs the intersection of the k factors with the highest causal dependency and the correlation factor, and generates a factor-level causal explanation, including: Step 8-1, in the decision-label pair set S D Select the factor-label pair with the same label as the original user decision, that is, Then they are sorted in descending order according to the causal dependency score; Step 8-2: Select the top k2 factor-label pairs with causal dependency scores And extract their factor parts Step 8-3, take the set of correlation factors between C and the original user decision The intersection of and is denoted as ε; Step 8-4: If there are one or more factors in ε, consider these factors as causal factors of the original user decision D and construct As a causal explanation of D.
Citation Information
Patent Citations
Meta learning interpretation method based on causal relationship
CN114897181A
Verifiable calibration method for causal decision task
CN118333165A
Cited By
Method and device for training result prediction model, storage medium and electronic equipment
CN119884761A
Multi-dimensional feature driven B2B2C collaborative recommendation method and system
CN121030102A
