Federal event sequence prediction method and system based on time sequence point process

Through the federated event sequence prediction method based on the time series point process, the scattered event information is integrated, and gradient average update and privacy encryption technology are used to solve the problem of impact between events in multiple scenarios and improve the accuracy and privacy protection of user behavior prediction. Implemented an efficient federated learning framework.

CN118760960AActive Publication Date: 2024-10-11ZHEJIANG UNIV

Patent Information

Application Number
CN202410752939.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-10-11
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

When the existing technology predicts users' future behavior, due to the interaction between events in different scenarios, the prediction accuracy is reduced due to the reliance on local data analysis, and due to the sensitivity of user event data, it cannot be centralized or shared, resulting in poor prediction results.

Method used

Adopting a federated event sequence prediction method based on time series point process, the client initializes the local local model, extracts event features, encrypts user identity and event time, sorts event embedding vectors, and performs gradient average updates to achieve global sharing of event sequence models to ensure Protect privacy while improving prediction accuracy.

Benefits of technology

It significantly improves the accuracy of user behavior prediction, ensures the security of user privacy data, avoids the risk of privacy leakage, and realizes joint learning of event sequences in multiple scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760960A_ABST
    Figure CN118760960A_ABST
Patent Text Reader

Abstract

The invention discloses a federated event sequence prediction method and system based on a time sequence point process, and the method comprises the steps: selecting a user and an interaction scene (client), and collecting and processing event data; the client initializes a local model which comprises a feature extraction model and an event sequence model; encrypting the user identity identifier, and performing member alignment; extracting event features of the aligned local users to obtain event embedding vectors; performing order-preserving encryption on event occurrence time, and forming a two-tuple with event embedding; according to the time-event embedding two-tuple, restoring an original sequence of user event embedding data; extracting and returning an extension vector required by training of each client from the original event embedding sequence; training an event sequence model by a client, and back-propagating a gradient required by parameter updating; updating the local feature extraction model, and carrying out gradient averaging on the global event sequence model; and returning the extension vector corresponding to the current time from the original event embedding, and predicting the next event.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field:

[0001] The invention relates to a method and system for predicting a federal event sequence based on a time sequence point process, and belongs to the field of computer artificial intelligence. Background technology:

[0002] From e-commerce systems, financial transactions to medical diagnosis, the interaction between users and (virtual) scenarios generates a large number of multivariate event sequences. They consist of a series of discrete events, each of which is presented in the form of a binary tuple of occurrence time and event type. For example, a large amount of patient diagnosis information in a hospital can naturally be regarded as different event sequences, each of which records the disease diagnosis of a single patient over time.

[0003] With the rapid development of mobile network technology and wearable mobile devices, users can interact with various scenarios at different time points, forming event subsequences distributed in different scenarios. These scenarios can be real-life places visited by users or third-party applications provided by enterprises on mobile devices. Researchers can predict the future status of users by analyzing their historical behavior patterns. These predictions can be of great value in real applications such as auxiliary medical diagnosis and business system traffic coordination. The event sequence modeling method based on time-series point processes has become the mainstream technical route in this research field.

[0004] However, due to the mutual influence between events in different scenarios, if institutions and enterprises only rely on the analysis of local data, the accuracy of user behavior prediction will be greatly reduced. In addition, user event data from different institutions is highly sensitive privacy data and cannot be centralized or shared.

[0005] Therefore, in order to solve the above problems, an efficient federated event sequence prediction scheme is needed, which can integrate the scattered event information of all parties and accurately predict the future behavior of users without leaking privacy. Summary of the invention:

[0006] In view of the above problems and difficulties in the prior art, the present invention proposes a federal event sequence prediction method based on time-series point process, which can integrate scattered event information and accurately predict the future behavior of users.

[0007] In a first aspect, the present invention provides a method for predicting a federal event sequence based on a time sequence point process, comprising the following steps:

[0008] S1: Select users and interaction scenarios (clients), collect and process event data;

[0009] S2: The client initializes the local model, including the feature extraction model and the event sequence model;

[0010] S3: encrypts user identifiers and performs member alignment;

[0011] S4: extract the event features of the aligned local users and obtain the event embedding vector;

[0012] S5: The time of event occurrence is encrypted in order and embedded with the event to form a tuple;

[0013] S6: Obtain the event time-embedded tuple data scattered on each client, and sort the event embedding vectors according to the encrypted event timestamps to restore the original order of the user event data;

[0014] S7: According to the design of the event sequence model, extract and return the extended vector required for each client training from the original event embedding sequence;

[0015] S8: The client uses the extended vector and local event data to continue training the event sequence model, outputs the probability of the occurrence of the local event subsequence, and back-propagates the gradients required for parameter updates;

[0016] S9: Update the local model, where the feature extraction model is directly updated through the optimizer, and the event sequence model needs to be updated after the gradient averaging operation;

[0017] S10: Repeat S4-S9 until the joint model converges;

[0018] S11: Prediction stage, execute S4-S6, return the extended vector corresponding to the current time from the original event embedding, and make a prediction for the next event;

[0019] Preferably, the data described in S1 is a data set collected from real scenes, which can be collected through smart watches or mobile phone background records, or pre-processed real public data sets can be considered;

[0020] Preferably, the local model structure described in S2 is specifically:

[0021] The Transformer-based sequence feature extraction model includes an event embedding layer, an attention calculation layer, a normalization layer, and a feedforward neural network layer. It mainly uses the self-attention mechanism to encode the features of the event sequence, compressing the original data while retaining the event information required for training;

[0022] An event sequence model based on a time-series point process, which includes a conditional intensity calculation layer, a log-likelihood calculation layer, and a Monte Carlo sampling prediction layer;

[0023] Preferably, RSA asymmetric encryption algorithm is used in S3, and the user identity identifier must be unique;

[0024] Preferably, the event embedding vector in S4 is obtained by extracting the sequence features from the local event data of each client, and each local event has a corresponding event embedding;

[0025] Preferably, the OPE order-preserving encryption algorithm is used in S5 to ensure that the original time order of event embedding can be restored and specific user time-sensitive information is not leaked;

[0026] Preferably, a new extended (hidden) vector calculation method is adopted in S7, which extracts scattered event information and captures low-order information of the sequence by aggregating neighbor events of the most recently embedded and predicted events on each client;

[0027] Preferably, the specific process of training in S8 is:

[0028] The event sequence modeling adopts a probability model based on the time-series point process, the conditional intensity function selects the form of a self-correcting random process, and the (conditional) logarithmic probability likelihood of the event sequence is trained;

[0029] The training process uses a static embedding update strategy to implement gradient backpropagation, that is, the training process only updates the local embedding, and the event embedding gradients of other clients are truncated to 0;

[0030] Preferably, the traditional federated averaging method is used in S9 to update the parameters of the event sequence model, so as to realize the global sharing of the client event sequence model, while the feature extraction model is local and the parameters are directly updated;

[0031] Preferably, the specific process of prediction in S11 is:

[0032] Repeat steps S4-S6 to obtain the original event embedding sequence, then extract only the last event embedding of each client and the neighbor embedding of the event to be predicted, and return the obtained extended vector to each client;

[0033] Since the event sequence model remains globally shared, the client can obtain the same prediction based on the extended vector, mainly using the Monte Carlo algorithm and maximum likelihood estimation to predict the time and type of future events, respectively.

[0034] In a second aspect, the present invention also provides a system for implementing a method for predicting a federated event sequence based on a time point process of the present invention, the system comprising a local client deployed in each scene, a matcher for member alignment, a third-party encryption server for encrypting private information, a third-party reconstruction server for restoring the event embedding sequence, and a global server for performing federated averaging;

[0035] The client is responsible for deploying the aforementioned feature extraction model and event sequence model, encrypting the user identity and passing it to the matcher, calculating event embedding through the aligned user's event data, encrypting the event timestamp in order and passing it to the reconstruction server, and receiving the extended vector and training the event sequence model;

[0036] The matcher is responsible for receiving the encrypted identity identifiers of all users for member alignment, and returning the aligned user identity identifiers to the client during the training phase;

[0037] The encryption server is responsible for generating a public key of the encryption algorithm and transmitting it to the client, and the client encrypts the timestamp and user identity identifier according to the public key;

[0038] The reconstruction server includes a comparator, a memory, a selector and an accumulator, wherein the memory and the comparator are used to store event embedding vectors and sorted encrypted timestamps respectively, and the selector and the accumulator generate event embedding according to a method for generating an extended vector;

[0039] The global server receives the parameter gradients of the event sequence models of each client, averages the gradients, and returns them to the client for update.

[0040] As can be seen from the above, when applying the solution of the present invention to jointly learn event sequences in multiple scenarios, the event subsequences are first encoded into embedding vectors through the local models of each party. Then, the embedding sequence reconstructor restores the order of these embeddings by sorting the encrypted timestamps from different parties and returns the extended vectors for further training. Finally, through the specially designed global event sequence model, the parties can calculate the log-likelihood probability and make a joint prediction for the next event.

[0041] The advantages of the present invention can be summarized as follows: by solving the challenge of temporal correlation of multi-scenario events, a new federated learning framework for event sequence prediction is proposed, which significantly improves the accuracy of user behavior prediction and strictly protects user privacy data to avoid the risk of privacy leakage. Description of the drawings:

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 It is a flowchart of a method for predicting a federal event sequence based on a time point process provided by an embodiment of the present invention.

[0044] Figure 2 It is a structural diagram of a federal event sequence prediction system based on a time sequence point process provided by an embodiment of the present invention. Specific implementation method:

[0045] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field based on the present invention belong to the scope of protection of the present invention.

[0046] See also Figure 1 , Figure 1 The user disease prediction method provided by the embodiment of the present invention using a federal event sequence prediction method based on a time point process of the present invention comprises the following steps S101-S107:

[0047] Step S101: Collect and process event data.

[0048] Event prediction has a wide range of real-world application scenarios. Taking user disease prediction as an example, the task of federated learning is to infer the user's possible future medical behavior and potential disease type based on the user's independent medical data in different hospitals or departments. This embodiment uses a public data set collected in real scenarios - the Mimic medical data set, which is developed based on an electronic medical record system and contains seven years of clinical visits by anonymous patients. Each patient represents a separate sequence, and the events in the sequence consist of visit time and medical diagnosis.

[0049] This embodiment randomly divides events into different scenarios according to event categories to simulate the distribution of real multi-scenario event sequence data.

[0050] Step S102: aligning encryption members.

[0051] In this embodiment, the sequence number in the real data set is used as the user identity identifier. The event subsequences obtained by random splitting belong to the same user and share the identity identifier. Each client encrypts the user identity using the RSA asymmetric encryption algorithm. The ciphertext is then compared through a third-party matcher to screen out user sequence samples that can be trained collaboratively. Finally, the client performs federated learning based on the aligned samples.

[0052] Step S103: The client encodes the event sequence.

[0053] The Transformer-based sequence feature extraction module consists of an event embedding layer, an attention calculation layer, a normalization layer, and a feedforward neural network layer, as follows:

[0054] First, based on the time when the local event data occurred, the location embedding is calculated as follows:

[0055]

[0056] Then according to the embedding table Retrieve type embed The final event is encoded as the sum of the position embedding and the type embedding Where D represents the dimension of the model, i represents the aligned customer number, n represents the event sequence number, and k represents the client number;

[0057] For encoded event data First, it is mapped to It is then fed into a feed-forward neural network layer and layer normalized as follows:

[0058]

[0059] H i,k =Feed-forward(H i,k ), (4)

[0060] Where Q, represents the query, key, and value in the self-attention computation process, Represents the parameter matrix of the linear projection in the self-attention mechanism.

[0061] Step S104: Embedding sequence reconstruction.

[0062] Through the local feature extraction model, each event generates a corresponding event embedding. OPE order-preserving encryption technology can encrypt the time when the event embedding occurs, so that the reconstruction server can restore the original event embedding order of each user, which is specifically expressed as:

[0063]

[0064] in Represents a reordering operation, embedding the events of user i on different clients into H i,1 ,…,H i,K , rearrange according to the timestamps of their occurrence to obtain the final embedding matrix H i .

[0065] Step S105: generating an extended (hidden) vector.

[0066] In order to reduce the amount of communication in the back propagation, this embodiment adopts a novel extended vector calculation method, which can be expressed as the accumulation of neighbor items and aggregation items:

[0067]

[0068] Where C is the number of neighbors, l(t) represents the index of the predecessor closest to time t in the current sequence, and H i is the embedding matrix obtained by the rearrangement operation, is the expanded embedding (hidden representation) matrix required by client k. Local Embedding is dynamically updated by client k, while the rest of the embeddings remain static.

[0069] Step S106: Model training.

[0070] Event modeling adopts a probability model based on the time sequence process, and its objective function is the product of the conditional probabilities of the event, which can be expressed as:

[0071]

[0072] The log likelihood of the event is log Pr(S i ) is the sum of the local log-likelihoods of K clients. Each client can calculate the probability of its local event occurrence based on its extension vector:

[0073]

[0074] in β and μ are scalars, and is a parameter matrix. Finally, the gradient of the model parameters is back-propagated according to the calculation results to train and update the model. At this stage, there is no need for each client to communicate information, and they only need to update their own local model parameters.

[0075] The federated model is trained, and steps S103-S106 are repeated until a preset number of iterations is reached, or a stop condition set to prevent overfitting is reached.

[0076] Step S107: Joint prediction of user diseases.

[0077] When a new user has medical needs, the user's historical events are input into the trained joint model to obtain the disease prediction results of the user, and then provide auxiliary medical advice to the user. This embodiment specifically verifies the effectiveness of the federated model on the test user set. Given a historical event sequence S of user i i , Nth i +1 The time and type of the (predicted) event can be expressed as:

[0078]

[0079] Where Pr(Δt|S i),Pr(e|S i ) is the same as described in step S106. The generation of the extended vector only requires the use of the previous index of the current time That's it.

[0080] Corresponding to the above-mentioned method for predicting a federal event sequence based on a time sequence point process, an embodiment of the present invention further provides a system for predicting a federal event sequence based on a time sequence point process.

[0081] In one embodiment of the present invention, see Figure 2 , a structural diagram of a federated event sequence prediction system based on a time point process is provided, wherein the system includes an encryption server 201, a member alignment matcher 202, a local model 203, a reconstructor 204 and a gradient aggregation server 205.

[0082] The encryption server 201 is composed of an RSA encryption port and an OPE encryption port; each encryption port is responsible for distributing the public key of the corresponding encryption algorithm and only performs simple communication with the client.

[0083] The member alignment matcher 202 is composed of a receiver and a comparator; the receiver receives the encrypted user identity sent by the client, and the comparator is responsible for matching and aligning the same user information and returning the aligned user to the client.

[0084] The local model 203 is composed of a feature extraction model, user event sequence data and an event sequence model; the feature extraction model is responsible for encoding event embedding vectors, and the event sequence model is responsible for probabilistic reconstruction of event sequences according to extended vectors.

[0085] The reconstructor 204 is composed of a memory, a comparator, a selector and an accumulator; the memory receives the encrypted event embedding vector, the comparator restores the original time sequence of the event embedding, and the selector and the accumulator implement the generation operation of the extended vector.

[0086] The gradient aggregation server 205 receives the event sequence model parameter gradients uploaded by each client, averages the gradients and returns them to each terminal, thereby achieving the purpose of global sharing of the event sequence model.

[0087] As can be seen from the above, the present invention implements a method and system for predicting a federal event sequence based on a time sequence process. By integrating scattered event information from various parties, the present invention can effectively improve the accuracy and security of event prediction.

[0088] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for predicting a federated event sequence based on a time-series point process, comprising the following steps: S1: Select users and interaction scenarios (clients), collect and process event data; S2: The client initializes the local model, including the feature extraction model and the event sequence model; S3: encrypts user identifiers and performs member alignment; S4: extract the event features of the aligned local users and obtain the event embedding vector; S5: The time of event occurrence is encrypted in order and embedded with the event to form a tuple; S6: Obtain the event time-embedded tuple data scattered on each client, and sort the event embedding vectors according to the encrypted event timestamps to restore the original order of the user event data; S7: According to the design of the event sequence model, extract and return the extended vector required for each client training from the original event embedding sequence; S8: The client uses the extended vector and local event data to continue training the event sequence model, outputs the probability of the occurrence of the local event subsequence, and back-propagates the gradients required for parameter updates; S9: Update the local model, where the feature extraction model is directly updated through the optimizer, and the event sequence model needs to be updated after the gradient averaging operation; S10: Repeat S4-S9 until the joint model converges; S11: Prediction stage, execute S4-S6, return the extended vector corresponding to the current time from the original event embedding, and make a prediction for the next event.

2. A method for predicting a federated event sequence based on a time-series point process, characterized in that: The data described in step S1 is a data set collected from real scenes, which is collected through background records of smart watches and mobile phones, or uses pre-processed real public data sets.

3. A method for predicting a federal event sequence based on a time-series point process, characterized in that: The local model structure in step S2 is specifically: The Transformer-based sequence feature extraction model includes an event embedding layer, an attention calculation layer, a normalization layer, and a feedforward neural network layer. It uses a self-attention mechanism to encode the features of event sequences, compressing the original data while retaining the event information required for training. An event sequence model based on a time-series point process includes a conditional intensity calculation layer, a log-likelihood calculation layer, and a Monte Carlo sampling prediction layer.

4. A method for predicting a federal event sequence based on a time-series point process, characterized in that: In step S3, the RSA asymmetric encryption algorithm is used, and the user identity identifier must be unique. The event embedding vector in step S4 is obtained by extracting sequence features from the local event data of each client, and each local event has a corresponding event embedding. In step S5, the OPE order-preserving encryption algorithm is used to ensure that the original time order of the embedded events can be restored without leaking specific user time-sensitive information.

5. A method for predicting a federal event sequence based on a time-series point process, characterized in that: In step S7, an extended (hidden) vector calculation method is adopted to extract scattered event information and capture low-order information of the sequence by aggregating the neighbor event embeddings of the most recent embedding and predicted events on each client.

6. A method for predicting a federated event sequence based on a time-series point process, characterized in that: The specific process of training in step S8 is: The event sequence modeling adopts a probability model based on the time-series point process, the conditional intensity function selects the form of a self-correcting random process, and the (conditional) logarithmic probability likelihood of the event sequence is trained; The training process adopts a static embedding update strategy to realize the back propagation of gradients, that is, the training process only updates the local embedding, and the event embedding gradients of other clients are truncated to 0.

7. A method for predicting a federal event sequence based on a time-series point process, characterized in that: In step S9, the traditional federated averaging method is used to update the parameters of the event sequence model to achieve global sharing of the client event sequence model, while the feature extraction model is local and the parameters are directly updated.

8. A method for predicting a federal event sequence based on a time-series point process, characterized in that: The specific process of prediction in step S11 is: Repeat steps S4-S6 to obtain the original event embedding sequence, then extract only the last event embedding of each client and the neighbor embedding of the event to be predicted, and return the obtained extended vector to each client; Since the event sequence model remains globally shared, the client can obtain the same prediction based on the extended vector, mainly using the Monte Carlo algorithm and maximum likelihood estimation to predict the time and type of future events, respectively.

9. A system for implementing a method for predicting a federated event sequence based on a time point process of the present invention, the system comprising a local client deployed in each scene, a matcher for member alignment, a third-party encryption server for encrypting private information, a third-party reconstruction server for restoring the event embedding sequence, and a global server for federated averaging; The client is responsible for deploying the aforementioned feature extraction model and event sequence model, encrypting the user identity and passing it to the matcher, calculating event embedding through the aligned user's event data, encrypting the event timestamp in order and passing it to the reconstruction server, and receiving the extended vector and training the event sequence model; The matcher is responsible for receiving the encrypted identity identifiers of all users for member alignment, and returning the aligned user identity identifiers to the client during the training phase; The encryption server is responsible for generating a public key of the encryption algorithm and transmitting it to the client, and the client encrypts the timestamp and user identity identifier according to the public key; The reconstruction server includes a comparator, a memory, a selector and an accumulator, wherein: The memory and the comparator are used to store the event embedding vector and the sorted encrypted timestamp respectively, and the selector and the accumulator generate the event embedding according to the generation method of the extended vector; The global server receives the parameter gradients of the event sequence models of each client, averages the gradients, and returns them to the client for update.

Citation Information

Patent Citations

  • Event sequence prediction model construction method and device, event sequence prediction method and device and terminal

    CN114417721A

  • Event sequence prediction method based on time sequence convolution and relation modeling

    CN114723003A

  • Modeling behavior in a network using event logs

    US10375095B1

  • System and Method for Predicting and Summarizing Medical Events from Electronic Health Records

    US20190034591A1

  • Method of creating zero-burden digital biomarkers for disorders, and exploiting co-morbidity patterns to drive early intervention

    WO2021061702A1

Cited By

  • AI-based cloud mobile phone abnormal behavior detection method and system

    CN122365487A