A POI recommendation method based on self-attention mechanism integrating multiple views

Through the multi-view POI recommendation method based on self-attention mechanism, the check-in location and type information are effectively integrated, and the problem of insufficient information fusion in the existing model is solved, and more accurate user travel prediction and decision support is achieved.

CN113886451BActive Publication Date: 2024-11-22WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111069321.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-13
Publication Date
2024-11-22
Estimated Expiration
2041-09-13

AI Technical Summary

Technical Problem

The existing POI recommendation model lacks effective integration of check-in location and type information, resulting in inadequate scientific and accurate recommendation results.

Method used

Using a multi-view self-attention mechanism-based POI recommendation method, the POI and POI type sequence is updated through the self-attention model, and cross-fused attention network is used to perform cross-view fusion, and candidate POIs are pre-filtered based on the user's travel range. , and finally generate recommendation information.

Benefits of technology

It realizes more scientific and effective POI recommendations, which can more accurately predict the user's travel location at the next moment, and helps to support decision-making such as development planning and building site selection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113886451B_ABST
    Figure CN113886451B_ABST
Patent Text Reader

Abstract

The present invention relates to a POI recommendation method based on a self-attention mechanism integrated into multiple views. The present invention pre-processes the acquired user data, and uses the self-attention mechanism to update the features of POI and POI category respectively, and then uses the cross-fusion attention network to learn the mutual dependence between the two, and mines the POI features under the premise of integrating POI type information, and pre-screens the candidate POI according to the user's travel range, so as to more scientifically, effectively and realistically recommend the next travel location for the user, which is helpful for further analysis to provide decision support for development planning, building site selection, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of travel recommendation, and in particular relates to a POI recommendation method based on a self-attention mechanism integrated into multiple views. Background Art

[0002] With the rapid development of the data era, online car-hailing platforms and other travel recommendation platforms have accumulated a large amount of check-in data. These data include user information, check-in POI information, check-in time information, check-in location type information, etc. With the continuous development of the field of data mining, intelligent recommendation systems based on check-in data have emerged and are constantly developing. The main POI of check-in information can be a train station, a restaurant, a school, etc. By learning the time series features of the user's past POIs and mining the user's travel characteristics, it is helpful for travel platforms to better recommend points of interest to users and further provide decision support for development planning, building site selection, etc. At present, POI recommendation generally uses convolutional neural networks and graph neural networks to learn users' long-term and short-term feature preferences. However, these models often simply consider the check-in location and check-in time information, and lack contextual information about the check-in location type. In the few models that consider the check-in location type, the fusion of POI type information is also simply weighted addition or splicing, lacking effective fusion of the two. Summary of the invention

[0003] In view of the shortcomings of the prior art, the present invention provides a POI recommendation method based on a self-attention mechanism that integrates multiple views. First, the acquired user data is preprocessed, and the sequences of POI and POI type are updated respectively based on the encoder of the self-attention model. Then, the cross-fusion attention network for POI and POI category information is used to fuse POI and POI category information across views to obtain the user's behavior preference, and the candidate POI is pre-screened according to the user's travel range. Finally, the user's behavior preference and the screened POI are matched to obtain the recommendation information.

[0004] In order to achieve the above object, the technical solution provided by the present invention is a POI recommendation method based on a self-attention mechanism integrating multiple views, comprising the following steps:

[0005] Step 1, obtain the check-in data of all users;

[0006] Step 2: pre-process the user's check-in data;

[0007] Step 2.1, process each user's check-in data into sequences of the same length;

[0008] Step 2.2, periodize the user's check-in time;

[0009] Step 2.3, vectorizing the periodized data;

[0010] Step 3: Cross-view fusion of POI and POI category information to obtain user behavior preferences;

[0011] Step 3.1, the encoder based on the self-attention model updates the sequences of POI and POI type respectively;

[0012] Step 3.2, using the cross-fusion attention network for POI and POI category information, cross-view fusion of POI and POI category information is performed to obtain the user's behavior preference;

[0013] Step 4, using the candidate set filter to narrow down the candidate POI range;

[0014] Step 4.1, obtain the appropriate number of clusters for the user through K-means clustering, generate the maximum convex hull for all POIs in each cluster, and generate a center point for each cluster;

[0015] Step 4.2, generate a buffer zone with a distance of 5 km for the maximum convex hull or a single POI as the user's activity range, and filter out POIs that are not within the user's activity range;

[0016] Step 5: Match the user's behavior preference obtained in step 3 with the candidate set screened in step 4 to generate recommendation information.

[0017] Moreover, in step 1, the user set is set to be U = {u1,u2,...,u |U|}, the POI set is L = {l1,l2,...,l |L|}, the category set of all POIs is C = {c1, c2, ..., c |C|}, |U|, |L|, |C| are the number of users, POIs and POI categories respectively; for user u∈U, the sequence of its historical check-ins can be expressed as in is the POI that the user checked in to, is the POI category that the user checked in to, is the check-in timestamp, and the ultimate goal is to predict the user u at POI points visited at any time.

[0018] Moreover, in step 2.1, the sign-in sequences of all users are unified to a fixed length of 5, where 5 is the maximum sequence length that the module can handle. If the number of sign-ins in the user's original sequence is greater than 5, the 5 most recent sign-ins are selected to generate a new sequence. If the user's original sign-in sequence is less than 5, zeros are padded on the left side of the sequence until the sequence length is equal to 5.

[0019] Moreover, in step 2.2, since the user check-in time will not repeat and is sparse, the time is periodized and each week is divided into 7×24=168 hours. Then the index size of the time embedding is 168, and the time embedding vector e of each check-in is t ∈R d , t is determined by the hour corresponding to its timestamp, and d is the vector feature dimension.

[0020] Moreover, the feature vectors of POI and POI type are randomly initialized in step 2.3 and are defined as e poi ∈R d and e category ∈R d , the feature vectors of POI and POI type in the definition sequence are represented as e l =e poi +e t and e c =e category +e t .

[0021] Moreover, the input of the POI encoder in step 3.1 is the user's check-in feature vector Based on the principle of self-attention mechanism, E l New feature vectors are generated by linear transformation, denoted as Q, K and V respectively:

[0022] Q=E l W Q (1)

[0023] K=E l W K (2)

[0024] V=E l W V (3)

[0025] Where W Q ,W K ,W V ∈R d×d is a learnable parameter.

[0026] The multi-head self-attention mechanism MHA(·) is used to calculate new sequence features:

[0027] E l′ =MHA(E l )=Concat(h1,h2,...,h k )W M (4)

[0028] h i =SA(Q,K,V) (5)

[0029] In the formula, Concat(·) represents the concatenation of all self-attention modules, and the output h of SA(·) is i ∈R m×d ,h i is the calculation result of the i-th head in the multi-head attention mechanism, k is the number of self-attention heads, and W M ∈R k*d×d is the self-learning projection vector, and SA(·) is calculated as follows:

[0030]

[0031] In the formula, is the activation function, and d is the vector feature dimension.

[0032] Then, the output E of the multi-head self-attention mechanism l′ Adding it to the double-layer feedforward network FFN(·) increases the nonlinearity of the model:

[0033] O l =FFN(E l′ )=ReLU((E l′ W1+b1)W2+b2) (7)

[0034] Where W1,W2∈R d×d is a learnable matrix, ReLU(·) is a linear rectification function, b1 and b2 are bias values ​​of the ReLU function fitting, O l is the updated POI feature.

[0035] The method for updating the POI type sequence is the same as the method for updating the POI features. The updated POI type sequence is obtained using the encoder. It is worth noting that two masks are required during the model calculation process to shield the sequence positions that affect the attention calculation. The first mask is used to adapt to user login sequences of different lengths, and its size is the zero-padding length on the left side of the sequence; the other mask shields the future check-in behavior relative to the predicted POI, and the sequence information after the predicted position needs to be covered by the mask.

[0036] Moreover, in step 3.2, the outputs O of the two encoders are l and O c At the same time, it is input into the cross-fusion attention network, and the calculation formula is as follows:

[0037]

[0038] In the formula, O l′ The POI feature vector that incorporates POI type features can also be expressed as the user's behavioral preference.

[0039] Moreover, the final candidate set in step 4.2 is as follows:

[0040] Set u =filter(Set) (9)

[0041] Where filter(·) represents the candidate set filter, Set={l1,l2,...,l |L|} is the original candidate set, Set u = {l k ,l t ,...,l |L′|} represents the set of POIs (|L′|<|L|) after the candidate set is filtered.

[0042] Moreover, in step 5, the ranking score of the i-th POI in the candidate set is calculated using the dot product as follows:

[0043]

[0044] In the formula, E i is the feature vector of candidate location i, is the predicted next position feature vector.

[0045] After the above calculation, the POI with a higher score in the candidate set is more likely to be visited by the user at the next moment.

[0046] Compared with the prior art, the present invention has the following advantages: the present invention updates the features of POI and POI category respectively through the self-attention mechanism, and then uses the cross-fusion attention network to learn the interdependence between the two, mines the POI features on the premise of integrating POI type information, and pre-screens the candidate POI according to the user's travel range, so as to more scientifically, effectively and realistically recommend the next travel location for the user, which is helpful for further analysis to provide decision support for development planning, building site selection, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 This is a technical flow chart of an embodiment of the present invention.

[0048] Figure 2 Schematic diagram of raw data components according to an embodiment of the present invention.

[0049] Figure 3 Schematic diagram of a model of an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The present invention provides a POI recommendation method based on a self-attention mechanism integrated into multiple views. Firstly, the acquired user data is preprocessed, and the sequences of POI and POI type are updated respectively based on the encoder of the self-attention model. Then, a cross-fusion attention network for POI and POI category information is used to fuse POI and POI category information across views to obtain the user's behavior preference, and candidate POIs are pre-screened according to the user's travel range. Finally, the user's behavior preference and the screened POI are matched to obtain recommendation information.

[0051] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0052] like Figure 1 As shown, the process of the embodiment of the present invention includes the following steps:

[0053] Step 1: Get the check-in data of all users.

[0054] Let the user set be U = {u1,u2,...,u |U|}, the POI set is L = {l1,l2,...,l |L|}, the category set of all POIs is C = {c1, c2, ..., c |C|}, |U|, |L|, |C| are the number of users, POIs and POI categories respectively. For user u∈U, the sequence of its historical check-ins can be expressed as in is the POI that the user checked in to, is the POI category that the user checked in to, is the check-in timestamp, and the ultimate goal is to predict the user u at The POI points visited at any time are shown in Table 1, which is part of the sample data of user check-in.

[0055] Table 1

[0056] user Check in POI POI Type Sign-in time POI geographic coordinates <![CDATA[u1]]> <![CDATA[l1]]> <![CDATA[c1]]> <![CDATA[t1]]> Lat1, Lon1 <![CDATA[u1]]> <![CDATA[l2]]> <![CDATA[c1]]> <![CDATA[t2]]> Lat2, Lon2 <![CDATA[u1]]> <![CDATA[l1]]> <![CDATA[c1]]> <![CDATA[t3]]> Lat1, Lon1 <![CDATA[u2]]> <![CDATA[l3]]> <![CDATA[c2]]> <![CDATA[t4]]> Lat3, Lon3 <![CDATA[u2]]> <![CDATA[l3]]> <![CDATA[c2]]> <![CDATA[t5]]> Lat3, Lon3 <![CDATA[u2]]> <![CDATA[l4]]> <![CDATA[c3]]> <![CDATA[t6]]> Lat4, Lon4 <![CDATA[u2]]> <![CDATA[l3]]> <![CDATA[c2]]> <![CDATA[t7]]> Lat3, Lon3

[0057] Step 2: Preprocess the user's check-in data, which includes the following steps:

[0058] Each user’s check-in data is processed into sequences of the same length, and the time data is periodized. The preprocessed data is vectorized to better learn the multi-dimensional features of user check-in behavior in the model.

[0059] Step 2.1: Process each user's check-in data into sequences of the same length.

[0060] Unify all users' sign-in sequences to a fixed length of 5, which is the maximum sequence length that the module can handle. If the number of sign-ins in the original sequence of a user is greater than 5, select the 5 most recent sign-ins to generate a new sequence. If the original sign-in sequence of a user is less than 5, pad the sequence with zeros on the left until the sequence length is equal to 5. For example, the user's sign-in sequence becomes

[0061] Step 2.2: Periodize the user's check-in time.

[0062] Since the user check-in time will not repeat and is sparse, the time is periodized and each week is divided into 7×24=168 hours, so the index size of time embedding is 168. The time embedding vector e of each check-in is t ∈R d , t is determined by the hour corresponding to its timestamp, and d is the vector feature dimension.

[0063] Step 2.3, vectorize the periodized data.

[0064] Randomly initialize the feature vectors of POI and POI type, defined as e poi ∈R d and e category ∈R d , the feature vectors of POI and POI type in the definition sequence are represented as e l =e poi +e t and e c =e category +e t .

[0065] Step 3: Cross-view fusion of POI and POI category information to obtain user behavior preferences, which specifically includes the following steps:

[0066] In step 3.1, the encoder based on the self-attention model updates the sequences of POI and POI type respectively.

[0067] Both encoders calculate the attention weights for each position in the historical sequence, thereby effectively learning the dependency features of the long-term check-in sequence. Since the overall architecture of the two encoders is the same, the modeling process is described in detail by taking the modeling of the POI sequence as an example.

[0068] The input of the POI encoder is the user's check-in feature vector Based on the principle of self-attention mechanism, E l New feature vectors are generated by linear transformation, denoted as Q, K and V respectively:

[0069] Q=E l WQ (1)

[0070] K=E l W K (2)

[0071] V=E l W V (3)

[0072] Where W Q ,W K ,W V ∈R d×d is a learnable parameter.

[0073] The multi-head self-attention mechanism MHA(·) is used to calculate new sequence features:

[0074] E l′ =MHA(E l )=Concat(h1,h2,...,h k )W M (4)

[0075] h i =SA(Q,K,V) (5)

[0076] In the formula, Concat(·) represents the concatenation of all self-attention modules, and the output h of SA(·) is i ∈R m×d ,h i is the calculation result of the i-th head in the multi-head attention mechanism, k is the number of self-attention heads, and W M ∈R k*d×d is the self-learning projection vector, and SA(·) is calculated as follows:

[0077]

[0078] In the formula, is the activation function, and d is the vector feature dimension.

[0079] Then, the output E of the multi-head self-attention mechanism l′ Adding it to the double-layer feedforward network FFN(·) increases the nonlinearity of the model:

[0080] O l =FFN(E l′ )=ReLU((E l′ W1+b1)W2+b2) (7)

[0081] Where W1,W2∈R d×d is a learnable matrix, ReLU(·) is a linear rectification function, b1 and b2 are bias values ​​of the ReLU function fitting, Ol is the updated POI feature.

[0082] The method for updating the POI type sequence is the same as the method for updating the POI features. The updated POI type sequence is obtained using the encoder. It is worth noting that two masks are required during the model calculation process to shield the sequence positions that affect the attention calculation. The first mask is used to adapt to user login sequences of different lengths, and its size is the zero-padding length on the left side of the sequence; the other mask shields the future check-in behavior relative to the predicted POI, and the sequence information after the predicted position needs to be covered by the mask.

[0083] In step 3.2, the cross-fusion attention network for POI and POI category information is used to fuse POI and POI category information across views to obtain the user's behavior preference.

[0084] The outputs of the two encoders O l and O c At the same time, it is input into the cross-fusion attention network, and the calculation formula is as follows:

[0085]

[0086] In the formula, O l′ The POI feature vector that incorporates POI type features can also be expressed as the user's behavioral preference.

[0087] Step 4: Use the candidate set filter to narrow down the candidate POI range.

[0088] Since the user's footprints are usually spread out around certain centers, the user's check-in behavior is spatially clustered. The present invention designs a candidate set filter based on the geographic coordinates of the user's access records to narrow the range of candidate POIs, which specifically includes the following steps:

[0089] Step 4.1: Get the appropriate number of clusters for the user through K-means clustering, generate the maximum convex hull for all POIs in each cluster, and generate a center point for each cluster.

[0090] Step 4.2: Generate a buffer zone with a distance of 5 km for the maximum convex hull or a single POI as the user's activity range, and filter out POIs that are not within the user's activity range.

[0091] The final candidate set is as follows:

[0092] Set u =filter(Set) (9)

[0093] Where filter(·) represents the candidate set filter, Set={l1,l2,...,l|L|} is the original candidate set, Set u = {l k ,l t ,...,l |L′|} represents the set of POIs (|L′|<|L|) after the candidate set is filtered.

[0094] Step 5: Match the user's behavior preference obtained in step 3 with the candidate set screened in step 4 to generate recommendation information.

[0095] The dot product is used to calculate the ranking score of the i-th POI in the candidate set as follows:

[0096]

[0097] In the formula, E i is the feature vector of candidate location i, is the predicted next position feature vector.

[0098] After the above calculation, the POI with a higher score in the candidate set is more likely to be visited by the user at the next moment.

[0099] During specific implementation, the above process can be automatically operated using computer software technology.

[0100] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.

Claims

1. A POI recommendation method based on self-attention mechanism integrating multiple views, characterized in that: The steps include: Step 1, obtain the check-in data of all users; Step 2: pre-process the user's check-in data; Step 3: Cross-view fusion of POI and POI category information to obtain user behavior preferences; Step 3.1, the encoder based on the self-attention model updates the sequences of POI and POI type respectively; Step 3.2, using the cross-fusion attention network for POI and POI category information, cross-view fusion of POI and POI category information is performed to obtain the user's behavior preference; Step 4, using the candidate set filter to narrow down the candidate POI range; Step 4.1, obtain the appropriate number of clusters for the user through K-means clustering, generate the maximum convex hull for all POIs in each cluster, and generate a center point for each cluster; Step 4.2, generate a buffer zone with a distance of τ km for the maximum convex hull or a single POI as the user's activity range, and filter out POIs that are not within the user's activity range; Step 5: Match the user's behavior preference obtained in step 3 with the candidate set screened in step 4 to generate recommendation information.

2. The POI recommendation method based on self-attention mechanism integrating multiple views as claimed in claim 1, characterized in that: In step 1, let the user set be U = {u1,u2,...,u |U| }, the POI set is L = {l1,l2,...,l |L| }, the category set of all POIs is C = {c1, c2, ..., c |C| }, |U|, |L|, |C| are the number of users, POIs and POI categories respectively; for user u∈U, the sequence of its historical check-ins can be expressed as in is the POI that the user checked in to, is the POI category that the user checked in to, is the check-in timestamp, and the ultimate goal is to predict the user u at POI points visited at any time.

3. The POI recommendation method based on self-attention mechanism integrating multiple views as claimed in claim 2, characterized in that: The preprocessing of the user's check-in data in step 2 includes the following sub-steps: Step 2.1, process each user's check-in data into sequences of the same length; Step 2.2, periodize the user's check-in time; Step 2.3, vectorizing the periodized data; Randomly initialize the feature vectors of POI and POI type, defined as e poi ∈R d and e category ∈R d , the feature vectors of POI and POI type in the definition sequence are represented as e l =e poi +e t and e c =e category +e t .

4. The POI recommendation method based on self-attention mechanism integrating multiple views as claimed in claim 3, characterized in that: In step 2.1, the check-in sequences of all users are unified to a fixed length of L1, where L1 is the maximum sequence length that the module can handle. If the number of check-ins in the user's original sequence is greater than L1, the L1 most recent check-ins are selected to generate a new sequence. If the user's original check-in sequence is less than L1, zeros are padded on the left side of the sequence until the sequence length is equal to L1.

5. The POI recommendation method based on self-attention mechanism integrating multiple views as claimed in claim 4, characterized in that: In step 2.2, since the user check-in time will not repeat and is sparse, the time is periodized and each week is divided into 7×24=168 hours. The index size of the time embedding is 168, and the time embedding vector e of each check-in is t ∈R d , t is determined by the hour corresponding to its timestamp, and d is the vector feature dimension.

6. A POI recommendation method based on self-attention mechanism integrating multiple views as claimed in claim 5, characterized in that: The input of the POI encoder in step 3.1 is the user's check-in feature vector Based on the principle of self-attention mechanism, E l New feature vectors are generated by linear transformation, denoted as Q, K and V respectively: Q=E l W Q (1) K=E l IN K (2) V. E l W V (3) Where W Q ,W K ,W V ∈R d×d is a learnable parameter; The multi-head self-attention mechanism MHA(·) is used to calculate new sequence features: E l′ =MHA(E l )=Concat(h1,h2,...,h k )W M (4) h i =SA(Q,K,V) (5) In the formula, Concat(·) represents the concatenation of all self-attention modules, and the output h of SA(·) is i ∈R m×d ,h i is the calculation result of the i-th head in the multi-head attention mechanism, k is the number of self-attention heads, and W M ∈R k*d×d is the self-learning projection vector, and SA(·) is calculated as follows: In the formula, is the activation function, d is the vector feature dimension; Then, the output E of the multi-head self-attention mechanism l′ Adding it to the double-layer feedforward network FFN(·) increases the nonlinearity of the model: OH l =FFN(E l′ )=ReLU((E l′ W1+b1)W2+b2) (7) Where W1,W2∈R d×d is a learnable matrix, ReLU(·) is a linear rectification function, b1 and b2 are bias values ​​of the ReLU function fitting, O l is the updated POI feature; The method for updating the POI type sequence is the same as the method for updating the POI features. The updated POI type sequence is obtained using the encoder.

7. The POI recommendation method based on self-attention mechanism integrating multiple views as claimed in claim 6, characterized in that: In step 3.2, the outputs of the two encoders O l and O c At the same time, it is input into the cross-fusion attention network, and the calculation formula is as follows: In the formula, O l′ The POI feature vector that incorporates POI type features can also be expressed as the user's behavioral preference.

8. The POI recommendation method based on self-attention mechanism integrating multiple views as claimed in claim 7, characterized in that: The final candidate set in step 4.2 is as follows: Set u =filter(Set) (9) Where filter(·) represents the candidate set filter, Set={l1,l2,...,l |L| } is the original candidate set, Set u = {l k ,l t ,...,l |L′| } represents the set of POIs (|L′|<|L|) after the candidate set is filtered.

9. The POI recommendation method based on self-attention mechanism integrating multiple views as claimed in claim 8, characterized in that: In step 5, the dot product is used to calculate the ranking score of the i-th POI in the candidate set as follows: In the formula, E i is the feature vector of candidate location i, is the predicted next position feature vector; After the above calculation, the POI with a higher score in the candidate set is more likely to be visited by the user at the next moment.