An automated training method for a creative model based on user behavior preference data
By constructing a multi-level preprocessing and dynamic interest model, combined with time series analysis and contextual association, the creation model is optimized in real time, solving the problem of insufficient capture of changes in user interests and achieving high efficiency and accuracy in personalized content recommendation.
Patent Information
- Application Number
- CN202411450328.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-10-17
AI Technical Summary
Existing methods for training content creation models based on user behavior preference data cannot accurately capture the dynamic changes in user interests, resulting in a disconnect between recommendation results and the user's current interests, which negatively impacts user experience, especially in content recommendation scenarios.
By acquiring multi-dimensional user behavior data, combining it with contextual information for multi-level preprocessing, performing time-series analysis and contextual correlation analysis, processing interest states in segments, constructing a dynamic interest model, and monitoring user behavior in real time for local and global optimization, incremental training and transfer learning, the creation model is optimized.
It improves the model's ability to capture changes in user interests, ensures the personalization and accuracy of recommendation results, adapts to complex and ever-changing user behaviors, reduces resource waste, and enhances the response speed and accuracy of the recommendation system.
Smart Images

Figure CN118965037B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of model training technology, and in particular to an automatic training method for a creation model based on user behavior preference data. Background Art
[0002] Existing creation model training methods based on user behavior preference data usually extract user interest tags or preference portraits by analyzing user clicks, browsing, collections and other behaviors, and use them to train content generation models. However, these methods may not be able to accurately capture the dynamic changes in user interests. Current technologies often use static data processing methods, that is, preference annotation based on user behavior over a period of time, which may ignore the timeliness and changing trends of user interests. For example, a user may show a high frequency of attention to a certain type of content within a certain period of time, but over time, his interest will gradually shift or change. If the model training fails to update the user behavior data in a timely manner, the generated content will not reflect the user's latest interests, reducing the relevance and accuracy of the recommendation results.
[0003] This static data processing method is particularly prominent in high-frequency content recommendation scenarios. For example, on short video platforms, users' content preferences often change rapidly due to hot topics and current news. If the system cannot dynamically adjust the model's training data to reflect these changes in a timely manner, the recommended content will be out of touch with the user's current interests, affecting the user experience. Therefore, there is a lot of room for improvement in existing technologies in capturing dynamic changes in user preferences. Summary of the invention
[0004] The purpose of the present invention is to provide an automatic training method for a creation model based on user behavior preference data, aiming to solve the problems mentioned in the background technology.
[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:
[0006] A method for automatically training a creation model based on user behavior preference data, the method comprising:
[0007] Obtain the user's behavior data and combine it with the context-related information when the data occurs to obtain a multi-dimensional initial behavior data set;
[0008] Perform multi-level preprocessing on the multi-dimensional initial behavior data set to obtain a behavior data set;
[0009] Perform time series analysis and situational association analysis on the behavior data set, extract time series features and situational features, and obtain time series situational feature data;
[0010] The time series context feature data is segmented according to the time sequence, and each segment of data is mapped to multiple interest states of the user in the corresponding time period to obtain multiple interest state segments;
[0011] Perform multi-level clustering analysis on interest status fragments, divide them into short-term interest groups and long-term interest groups, and obtain the user's dynamic interest group dataset;
[0012] Based on the dynamic interest group dataset, a dynamic interest model of users is constructed;
[0013] Monitor the user's new behavior data in real time, and perform local updates and global optimization on the dynamic interest model. Local updates are used to adjust short-term interest groups, while global optimization is used to adjust long-term interest groups.
[0014] Generate a training data set according to the dynamic interest model, wherein the training data set includes a user's short-term interest feature vector, a long-term interest feature vector, and a context weight vector;
[0015] The creative model is incrementally trained and transferred through the training data set to optimize the model parameters and obtain the creative model.
[0016] Preferably, the multi-dimensional initial behavior data set is subjected to multi-level preprocessing to obtain a behavior data set, including:
[0017] According to the preset behavior frequency or preset duration, the click, browse and favorite data in the multi-dimensional initial behavior data set are screened to obtain the first pre-processed data set, and the time decay factor is assigned to the data of different behavior types in the first pre-processed data set according to the context information. ;
[0018] Performing multi-level noise removal on the first preprocessed data to obtain second preprocessed data;
[0019] Each type of behavior data in the second preprocessed data is weighted to obtain a weight coefficient. The calculation formula of the weight coefficient is:
[0020] ,
[0021] in, is the weight coefficient of the i-th behavior type, is the behavior frequency or duration of the ith behavior type, is the priority coefficient of the i-th behavior type, is the regulatory factor for the ith behavior type, is the time interval, j is the index of the behavior type, n is the total number of behavior types, is the time decay factor of the ith behavior type, is the smoothing parameter, is the bias term of the ith behavior type, and e is the base of the natural logarithm;
[0022] The second preprocessed data is normalized according to the weight coefficient to obtain a behavior data set.
[0023] Preferably, time series analysis and situational association analysis are performed on the behavior data set to extract time series features and situational features to obtain time series situational feature data, including:
[0024] Slice the behavior data set according to the time window to obtain multiple time window segments;
[0025] The calculation formula for the time window segment length is:
[0026] ,
[0027] in, is the time difference of adjacent behavior data, is the number of behavior data in the window, is the adjustment coefficient of the time window, is the index of the behavior data, To adjust the parameters, is the average value of the time difference, v is the index of the time difference, and y is the number of time differences;
[0028] Count the behavior data in each time window segment and extract the time series feature values of click count, browsing time and collection frequency;
[0029] The context information of each time window is correlated and analyzed to extract the corresponding situational features. The time series feature values and situational features are concatenated to obtain the time series situational feature vector.
[0030] Preferably, the time series context feature data is segmented in chronological order, and each segment of data is mapped to multiple interest states of the user in a corresponding time period, to obtain multiple interest state segments, including:
[0031] Calculate the temporal context feature vector of adjacent time windows and The similarity between , similarity The calculation formula is:
[0032] ,
[0033] in, is the weight of the b-th dimension feature, m is the dimension of the feature vector, b is the dimension index of the feature vector, For the The feature value of the time window on the b-th dimension feature, For the The feature value of the time window on the b-th dimension feature;
[0034] When similarity When it is greater than the preset threshold, the time series context feature vector and Merge them into merged interest state fragments, otherwise mark them as different interest state fragments;
[0035] The merged state segments of interest are smoothed to obtain state segments of interest.
[0036] Preferably, a multi-level clustering analysis is performed on the interest status segments to divide them into short-term interest groups and long-term interest groups, and a dynamic interest group data set of the user is obtained, including:
[0037] Calculate the short-term interest similarity for each interest state segment to obtain the similarity matrix , similarity matrix The calculation formula is:
[0038] ,
[0039] in, and The cth and dth interest state segments are in the The eigenvalue of dimension, f is the characteristic dimension, is the weight of the e-th dimension feature, is the regularization coefficient, is the scaling parameter;
[0040] Perform density clustering on the similarity matrix to obtain short-term interest groups;
[0041] The center points of short-term interest groups are re-clustered and merged into long-term interest groups to obtain a dynamic interest group dataset.
[0042] Preferably, constructing a dynamic interest model of a user according to the dynamic interest group data set includes:
[0043] Extract features from the dynamic interest group dataset to obtain a short-term interest feature dataset and a long-term interest feature dataset;
[0044] The short-term interest feature dataset is obtained by the following formula:
[0045] ,
[0046] in, is the short-term interest feature vector, is the weight matrix of the input features, is the input feature matrix, is the bias vector, is the adjustment coefficient, s is the input feature matrix The index of the attention head, q is the index of the attention head, h is the number of attention heads, ,in, is the query matrix, is the key matrix, is the value matrix, is the dimension of the key, The function is used to convert the dot product result into a probability distribution. is ReLU or Swish function;
[0047] The long-term interest feature dataset is obtained by the following formula:
[0048] ,
[0049] in, is the long-term interest feature vector, is the index of the attention head, r is the number of attention heads, It means concatenating the outputs of the multi-head self-attention mechanism. , is the output transformation matrix, is the weight parameter;
[0050] The short-term interest feature dataset and the long-term interest feature dataset are weightedly fused to obtain a dynamic interest model.
[0051] Preferably, the user's newly added behavior data is monitored in real time, and the dynamic interest model is locally updated and globally optimized, including:
[0052] Monitor the user's new behavior data in real time, calculate the difference between it and the historical behavior data, and calculate the difference vector ;
[0053] The short-term interest group is locally updated, and the long-term interest group is globally optimized. The calculation formulas for local update and global optimization are:
[0054] ,
[0055] in, is the first learning rate, is the difference vector, t is the time interval, is the attenuation coefficient.
[0056] Preferably, generating a training data set according to the dynamic interest model includes:
[0057] The feature vectors in the short-term interest feature data set and the long-term interest feature data set are merged to obtain a multi-dimensional feature data set;
[0058] The multidimensional feature data set is reduced in dimension to obtain a feature data set. The calculation formula for reducing the dimension of the feature data set is:
[0059] ,
[0060] in, is the output feature matrix, is the identity matrix, is the regularization parameter, is the graph Laplacian matrix, is the input feature matrix;
[0061] Label the feature data set, generate user behavior labels, and obtain the training data set.
[0062] Preferably, incremental training and transfer learning are performed on the creation model through the training data set to optimize the parameters of the model to obtain the creation model, including:
[0063] Obtaining a preliminary creation model, and adjusting the weight of the input layer of the preliminary creation model through a training data set to obtain an input layer optimization model;
[0064] The hidden layer parameters of the input layer optimization model are optimized to obtain the hidden layer optimization model, where the calculation formula for hidden layer parameter optimization is:
[0065] ,
[0066] in, is the updated parameter, is the original parameter, is the fourth learning rate, is the first objective function;
[0067] Freezing the feature extraction layer of the hidden layer optimization model to obtain a frozen feature model;
[0068] The feature extraction layer of the frozen feature model that meets the preset conditions is unfrozen, and its parameters are fine-tuned to obtain a fine-tuned feature model, wherein the calculation formula for fine-tuning the feature extraction layer parameters is:
[0069] ,
[0070] in, The new parameters for the unfrozen feature extraction layer, is the original parameters of the unfrozen feature extraction layer, is the second learning rate, is the second objective function;
[0071] The unfrozen layer and the frozen layer of the fine-tuned feature model are fused to obtain a fused model;
[0072] The creation model is obtained by weighting the tasks of the fusion model and performing global adjustments.
[0073] Preferably, the weight of the input layer of the preliminary creation model is adjusted by the training data set to obtain an input layer optimization model, including:
[0074] Get the input layer weight matrix of the preliminary creation model , and calculate the loss function of the training data set ;
[0075] Through the back propagation algorithm, the input layer weights are updated according to the gradient information to obtain the input layer adjustment weight matrix, where the calculation formula of the input layer adjustment weight matrix is:
[0076] ,
[0077] in, Adjust the weight matrix for the input layer, is the third learning rate, E is the loss function;
[0078] Use the input layer to adjust the weight matrix The training data set is re-evaluated. If the loss function does not meet the preset convergence condition, the step of updating the input layer weights is repeated until the convergence condition is met to obtain the input layer optimization model.
[0079] The above solution of the present invention includes at least the following beneficial effects:
[0080] First, the present invention constructs a complete initial behavior data set by acquiring multi-dimensional behavior data of users and combining it with contextual information. Traditional methods usually only process single-dimensional behavior data, ignoring the contextual information of user behavior, resulting in large deviations in model prediction results. However, the present invention can more comprehensively capture user behavior motivations and interest changes through contextual association, thereby improving the accuracy of model prediction.
[0081] Secondly, through multi-level preprocessing steps, the present invention can not only clean the noise in the data, but also improve the representativeness of the data through dynamic weighting and normalization. Compared with traditional models that only rely on simple screening mechanisms, the present invention can assign different weights to behavioral data based on factors such as behavior frequency, duration, priority, etc., and combine time decay factors to ensure that the impact of data over time is reasonably distributed. This dynamic adjustment method avoids the defects of the static weight mechanism, allowing the model to maintain accurate prediction capabilities in scenarios where user behavior changes rapidly.
[0082] In addition, the present invention extracts the time series characteristics and situational characteristics of user behavior through time series analysis and situational association analysis, so as to accurately capture the changes in user behavior patterns. Traditional models are often insufficient in capturing users' dynamic interests and are difficult to reflect the changing trends of users' behavior in real time. By segmenting the time series data, the present invention can identify multiple interest states and form multiple interest state segments based on the user's behavioral characteristics in different time periods. This mechanism ensures that the creation model can adjust the model in time when the user's interests change, and no longer relies on static interest state modeling.
[0083] The present invention further introduces the division of short-term interest groups and long-term interest groups, so that the creation model can simultaneously handle users' short-term interest fluctuations and long-term focus points. This dynamic interest model can be locally updated according to the user's new behavior to respond to the user's immediate needs, while maintaining the stability of the long-term interest group and ensuring the accuracy of long-term interest prediction through global optimization.
[0084] Finally, the present invention also optimizes multiple submodules of the creation model through incremental training and transfer learning. Incremental training can effectively avoid the waste of resources of retraining the entire model, which is particularly suitable for large-scale user data scenarios. The introduction of transfer learning enables the creation model to quickly adapt to new tasks or new data, further improving the generalization ability and scalability of the creation model. By optimizing the creation model parameters in real time, it can always maintain a high degree of consistency with user interests, ensuring the personalization and accuracy of the recommendation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] Figure 1 It is a flowchart of an automatic training method for a creation model based on user behavior preference data provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0086] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0087] like Figure 1 As shown, an embodiment of the present invention proposes an automatic training method for a creation model based on user behavior preference data, the method comprising the following steps:
[0088] Obtain the user's behavior data and combine it with the context-related information when the data occurs to obtain a multi-dimensional initial behavior data set;
[0089] Perform multi-level preprocessing on the multi-dimensional initial behavior data set to obtain a behavior data set;
[0090] Perform time series analysis and situational association analysis on the behavior data set, extract time series features and situational features, and obtain time series situational feature data;
[0091] The time series context feature data is segmented according to the time sequence, and each segment of data is mapped to multiple interest states of the user in the corresponding time period to obtain multiple interest state segments;
[0092] Perform multi-level clustering analysis on interest status fragments, divide them into short-term interest groups and long-term interest groups, and obtain the user's dynamic interest group dataset;
[0093] Based on the dynamic interest group dataset, a dynamic interest model of users is constructed;
[0094] Monitor the user's new behavior data in real time, and perform local updates and global optimization on the dynamic interest model. Local updates are used to adjust short-term interest groups, while global optimization is used to adjust long-term interest groups.
[0095] Generate a training data set according to the dynamic interest model, wherein the training data set includes a user's short-term interest feature vector, a long-term interest feature vector, and a context weight vector;
[0096] The creative model is incrementally trained and transferred through the training data set to optimize the model parameters and obtain the creative model.
[0097] In an embodiment of the present invention, the method includes acquiring user behavior data and generating a multi-dimensional initial behavior data set in combination with context-related information. By performing multi-level preprocessing on the multi-dimensional data set, unrepresentative low-frequency behavior or noise data can be effectively removed to form a more accurate behavior data set. Next, the data set is subjected to time series analysis and context association analysis to extract the time series characteristics and context characteristics of the user behavior. In this way, the dynamic changes of user behavior and the context in which it is located can be deeply understood, so that the creation model can more accurately predict user interests.
[0098] The temporal context feature data is segmented and processed in chronological order and mapped into multiple interest state segments. This process provides a basis for subsequent interest state modeling by distinguishing the changes in user interests in different time periods. Multiple interest state segments are further analyzed through multi-level clustering to form short-term and long-term interest groups. Short-term interest groups reflect users' immediate interest preferences, while long-term interest groups capture users' long-term focus. The user dynamic interest model constructed in this way can update users' interest preferences in real time, and perform global optimization while locally adjusting short-term interest groups to ensure the stability of long-term interest groups.
[0099] Compared with the prior art, the method of the present invention can monitor the changes in user behavior in real time and quickly adjust the model to improve the recommendation effect of personalized content for users. This method can adapt to complex and changeable user behaviors and avoid the limitations of traditional static models. For example, when a user suddenly shows a strong interest in a certain type of content in a short period of time, the recommendation strategy can be adjusted in time through a local update mechanism, while retaining the stability of the user's long-term interest group and not affecting the long-term prediction effect of the overall creation model. This dynamic update mechanism greatly improves the response speed of the creation model to user behavior, and is particularly suitable for scenarios with large-scale user data, such as e-commerce and content recommendation systems.
[0100] In a preferred embodiment of the present invention, a multi-dimensional initial behavior data set is subjected to multi-level preprocessing to obtain a behavior data set, including:
[0101] According to the preset behavior frequency or preset duration, the click, browse and favorite data in the multi-dimensional initial behavior data set are screened to obtain the first pre-processed data set, and the time decay factor is assigned to the data of different behavior types in the first pre-processed data set according to the context information. ;
[0102] Perform multi-level noise removal on the first preprocessed data, first remove low-variance behavior data by using a variance screening method, and then eliminate abnormal data points by using a bilateral filtering algorithm to obtain second preprocessed data;
[0103] Each type of behavior data in the second preprocessed data is weighted to obtain a weight coefficient. The calculation formula of the weight coefficient is:
[0104] ,
[0105] in, is the weight coefficient of the i-th behavior type, is the behavior frequency or duration of the ith behavior type, is the priority coefficient of the i-th behavior type, is the regulatory factor for the ith behavior type, is the time interval, j is the index of the behavior type, n is the total number of behavior types, is the time decay factor of the ith behavior type, is the smoothing parameter, is the bias term of the ith behavior type, and e is the base of the natural logarithm;
[0106] The second preprocessed data is normalized according to the weight coefficient to obtain a behavior data set.
[0107] In the embodiment of the present invention, when processing the multi-dimensional initial behavior data set, the click, browse and favorite data are first filtered by the preset behavior frequency or duration, and the unrepresentative low-frequency behavior data is eliminated. This step effectively reduces the interference of noise on the creation model training, ensuring that the data processed subsequently is more representative. The filtered data is also combined with contextual information and assigned a time decay factor, thereby realizing dynamic weighted processing of user behavior data.
[0108] The multi-level noise removal step uses variance screening and bilateral filtering algorithms to effectively remove low-variance behavioral data and abnormal data points. This process enhances the accuracy and reliability of the data, especially for behavioral data with strong noise interference, which can significantly improve the training effect of the creation model. After noise removal, the behavioral data is weighted according to its frequency and priority to obtain the weight coefficient. The calculation formula of the weight coefficient is further dynamically adjusted through the time decay factor to ensure that the weight coefficient matches the actual influence of the behavioral data.
[0109] Compared with the prior art, the present invention can ensure the quality and representativeness of data through a more complex and sophisticated multi-level preprocessing process. For example, when a user browses a large amount of irrelevant content, the preprocessing process can identify noise data and remove it in time, avoiding the interference of invalid data on the creation model, making the subsequent creation model training more accurate and efficient.
[0110] Among them, a time decay factor is assigned to data of different behavior types in the first preprocessed data set according to context information, and its purpose is to reflect the change in importance of user behavior over time by introducing a time decay mechanism.
[0111] The time decay factor is a parameter used to describe how the importance of a behavior changes over time. It is usually used to reduce the impact of past behaviors so that the model pays more attention to recent behaviors. By assigning time decay factors to different types of behaviors, the weight of each behavior can be dynamically adjusted to reflect the degree of influence of the behavior at different time points.
[0112] Contextual information includes the time, location, device, user status, and other background information when the user behavior occurs. This information can help better determine the importance of a certain behavior. For example, the behavior of a user in a specific time period (such as browsing content at night) may have a different decay pattern than the behavior during the day.
[0113] Based on the context information, the time decay factor can be adjusted for specific scenarios. For example, behaviors in high-frequency access time periods can be assigned a smaller time decay factor to keep their higher weight.
[0114] According to the interval between the time point when the behavior occurs and the current time, the attenuation factor is calculated by an exponential function, or a linear function can be used for attenuation so that the behavior weight decreases linearly over time.
[0115] Different types of user behaviors (such as clicks, browsing, and collections) have different degrees of influence on the model. For example, collection behavior may better reflect the depth of user interest than click behavior, so a smaller attenuation factor can be given to collection behavior.
[0116] For different users or situations, the attenuation factors of different behavior types can be personalized according to the user's behavioral habits to improve the model's ability to capture user preferences.
[0117] In summary, the purpose of assigning time decay factors to data of different behavior types according to contextual situations is to enable the model to adaptively adjust the weight of the behavior data, thereby more accurately reflecting the changing trend of users' interests.
[0118] In a preferred embodiment of the present invention, time series analysis and context association analysis are performed on the behavior data set to extract time series features and context features to obtain time series context feature data, including:
[0119] Slice the behavior data set according to the time window to obtain multiple time window segments;
[0120] The calculation formula for the time window segment length is:
[0121] ,
[0122] in, is the time difference of adjacent behavior data, is the number of behavior data in the window, is the adjustment coefficient of the time window, is the index of the behavior data, To adjust the parameters, is the average value of the time difference, v is the index of the time difference, and y is the number of time differences;
[0123] Count the behavior data in each time window segment and extract the time series feature values of click count, browsing time and collection frequency;
[0124] The context information of each time window is correlated and analyzed to extract the corresponding situational features. The time series feature values and situational features are concatenated to obtain the time series situational feature vector.
[0125] In the embodiment of the present invention, when performing time series analysis on the behavior data set, a time window slicing method is used to dynamically divide the user behavior data by setting the time window length. The length of the time window is calculated based on the time difference of the user behavior to ensure that the window length can be adaptively adjusted in different scenarios to adapt to the diversity of behavior. The behavior data in each time window segment is extracted to obtain time series features such as the number of clicks, browsing time, and collection frequency, and is combined with the corresponding context for correlation analysis to form a time series context feature vector.
[0126] By extracting the time series features of user behavior, we can capture the changing trend of behavior over time. By combining context, we can not only understand the user's behavior at a certain moment, but also analyze the motivation behind the behavior. This makes the creation model more intelligent and accurate in predicting user behavior. For example, if a user frequently browses a certain type of content at a specific time and place, we can combine time and geographic information to predict the user's potential needs, thereby providing more targeted recommendation services.
[0127] Compared with existing methods, the present invention takes context information into consideration when processing behavioral data, thus improving the ability to analyze complex behavioral patterns. For complex application scenarios such as e-commerce platforms or social media, customized services can be provided based on user behavior and context, further improving user experience.
[0128] Among them, the context information of each time window is correlated and analyzed, the corresponding situational features are extracted, and the time series feature value and the situational features are concatenated to obtain the time series situational feature vector, including:
[0129] In time series analysis, contextual information can include additional information related to the environment, device, location, time, etc. when the user behavior occurs. Association analysis is to link this contextual information with the user's behavior data to better understand the context of the user's behavior. For example, the user's browsing behavior may have different intentions in different time periods (such as working hours and rest time) or different locations (home, office), and this contextual information can be used to adjust the model's predictions.
[0130] Based on the association analysis, features related to user behavior are extracted from the context information. For example, time information can be processed into features such as hours and days of the week, location information can be converted into category features, and device type can be added to the model as a feature. These features reflect the context in which the behavior occurs.
[0131] The temporal features extracted from the behavioral data (such as the number of clicks, browsing time, etc.) are combined with the contextual features to form a more comprehensive feature vector. This concatenation process combines the temporal features and contextual features into a temporal contextual feature vector, which represents the user's behavior and its contextual information in a specific time window.
[0132] In a preferred embodiment of the present invention, the temporal context feature data is segmented in chronological order, and each segment of data is mapped to multiple interest states of the user in the corresponding time period, thereby obtaining multiple interest state segments, including:
[0133] Calculate the temporal context feature vector of adjacent time windows and The similarity between , similarity The calculation formula is:
[0134] ,
[0135] in, is the weight of the b-th dimension feature, m is the dimension of the feature vector, b is the dimension index of the feature vector, For the The feature value of the time window on the b-th dimension feature, For the The feature value of the time window on the b-th dimension feature;
[0136] When similarity When it is greater than the preset threshold, the time series context feature vector and Merge them into merged interest state fragments, otherwise mark them as different interest state fragments;
[0137] The merged state segments of interest are smoothed to obtain state segments of interest.
[0138] In the embodiment of the present invention, after obtaining the time series context feature data, it will be segmented in chronological order and mapped into the user's multiple interest states. By calculating the similarity between adjacent time windows, it is possible to accurately determine the user's interest change trend in adjacent time periods and merge similar time segments, thereby reducing unnecessary data splitting.
[0139] The calculation of similarity combines multi-dimensional feature weights, allowing the creation model to comprehensively evaluate interest states in multiple dimensions. In order to prevent excessive data fragmentation, a smoothing method is introduced to further ensure the continuity and stability of interest state segments. Smoothing avoids excessive adjustments caused by short-term behavioral fluctuations and ensures smoother generation of interest segments.
[0140] Compared with the prior art, the present invention can reduce data redundancy while maintaining sensitivity to changes in user interests. For example, a user may show interest in multiple contents alternately over a period of time, and similarity calculation can identify the relevance of these interests, avoid over-segmentation of user interest states, and ensure the consistency of recommended content.
[0141] In a preferred embodiment of the present invention, a multi-level clustering analysis is performed on the interest state segments to divide them into short-term interest groups and long-term interest groups, and a dynamic interest group data set of the user is obtained, including:
[0142] Calculate the short-term interest similarity for each interest state segment to obtain the similarity matrix , similarity matrix The calculation formula is:
[0143] ,
[0144] in, and The cth and dth interest state segments are in the The eigenvalue of dimension, f is the characteristic dimension, is the weight of the e-th dimension feature, is the regularization coefficient, is the scaling parameter;
[0145] Perform density clustering on the similarity matrix to obtain short-term interest groups;
[0146] The center points of short-term interest groups are re-clustered and merged into long-term interest groups to obtain a dynamic interest group dataset.
[0147] In the embodiment of the present invention, the user's interest state segments are divided into short-term interest groups and long-term interest groups through multi-level clustering analysis. The clustering analysis first performs density clustering on the user's interest state in the short term to capture the user's immediate needs. Then, by re-clustering the center points of the short-term interest group, a long-term interest group is further formed to describe the user's long-term interest trend.
[0148] The multi-level clustering approach ensures that the creation model can capture both the short-term behavior changes and long-term interests of users. This hierarchical processing method is particularly useful in the creation model. For example, when a user shows interest in a certain type of product in the short term, it can be quickly identified and responded to, while at the same time, the user's long-term interest areas will not be lost due to short-term changes.
[0149] Through hierarchical clustering processing, short-term and long-term interests are captured more comprehensively, avoiding the reliance on a single interest group in existing technologies and improving the accuracy and durability of recommendations.
[0150] Among them, the similarity matrix is density clustered to obtain short-term interest groups, including:
[0151] The similarity matrix represents the similarity values between each interest state segment, and each matrix element corresponds to the similarity between two segments. For example, the element in the matrix It can represent the similarity between the cth and dth segments.
[0152] Density clustering is a clustering method based on the density of data points. It is used to find high-density areas in the similarity matrix (i.e., clusters with similar interest segments). For example, commonly used density clustering algorithms include DBSCAN and OPTICS. By finding areas with higher density, similar segments are clustered together.
[0153] After clustering, segments with high similarity will be assigned to the same short-term interest group, indicating that users’ interest states have high similarity within a short time frame. The division of short-term interest groups helps to further analyze the changing trend of users’ short-term interests.
[0154] In a preferred embodiment of the present invention, a dynamic interest model of a user is constructed according to a dynamic interest group data set, including:
[0155] Extract features from the dynamic interest group dataset to obtain a short-term interest feature dataset and a long-term interest feature dataset;
[0156] The short-term interest feature dataset is obtained by the following formula:
[0157] ,
[0158] in, is the short-term interest feature vector, is the weight matrix of the input features, is the input feature matrix, is the bias vector, is the adjustment coefficient, s is the input feature matrix The index of the attention head, q is the index of the attention head, h is the number of attention heads, ,in, is the query matrix, is the key matrix, is the value matrix, is the dimension of the key, The function is used to convert the dot product result into a probability distribution. is ReLU or Swish function;
[0159] The long-term interest feature dataset is obtained by the following formula:
[0160] ,
[0161] in, is the long-term interest feature vector, is the index of the attention head, r is the number of attention heads, It means concatenating the outputs of the multi-head self-attention mechanism. , is the output transformation matrix, is the weight parameter;
[0162] The short-term interest feature dataset and the long-term interest feature dataset are weightedly fused to obtain a dynamic interest model.
[0163] In the embodiment of the present invention, a dynamic interest model of a user is constructed by extracting features from a dynamic interest group data set. Short-term interest feature vectors are extracted by calculating a weight matrix, while long-term interest features are generated by splicing a multi-head self-attention mechanism. The two interest feature vectors are weighted and fused to generate the final dynamic interest model.
[0164] By balancing short-term and long-term interests, the model enables the creation model to respond to the user's latest needs in the short term while maintaining a grasp of the user's overall interests in the long term. In particular, the introduction of the multi-head self-attention mechanism makes the extraction of long-term interest features more flexible and able to adapt to the user's complex long-term behavior patterns. For example, in a news recommendation system, a user may show short-term interest in a hot event while maintaining a long-term focus on the field of science and technology. By balancing short-term and long-term interests, accurate content recommendations can be achieved.
[0165] Among them, the matrix of query, key and value is the input feature matrix are linearly transformed with their respective weight matrices, and the size of these matrices depends on the dimensions of the input features and the target dimensions of the query, key, and value. For example, the input feature matrix The dimension is , the target dimensions for query, key, and value are , then the corresponding weight matrix size is .
[0166] Among them, the short-term interest feature data set and the long-term interest feature data set are weightedly fused to obtain a dynamic interest model, including:
[0167] Short-term interest features and long-term interest features may show different effects at different time scales. By assigning different weights to short-term and long-term interest features, their contribution to the final dynamic interest model can be flexibly adjusted. For example, when the user's recent behavior changes greatly, the weight of short-term interest features can be increased; when the user's long-term interest is stable, the weight of long-term interest features can be increased.
[0168] The calculation formula of weighted fusion is:
[0169] ,
[0170] in:
[0171] is the short-term interest feature vector.
[0172] is the long-term interest feature vector.
[0173] is a weighting coefficient ranging from 0 to 1, which is used to control the importance ratio of short-term and long-term features.
[0174] when When is larger, the influence of short-term interest features is greater, and the dynamic interest model is more inclined to reflect the user’s current interests.
[0175] when When is smaller, the influence of long-term interest features is greater, and the dynamic interest model is more inclined to describe the long-term preferences of users.
[0176] The present invention significantly improves the adaptability and accuracy of the creation model by constructing a dynamic interest model, and can better handle dynamic interest changes of users compared to the prior art.
[0177] In a preferred embodiment of the present invention, the user's newly added behavior data is monitored in real time, and the dynamic interest model is locally updated and globally optimized, including:
[0178] Monitor the user's new behavior data in real time, calculate the difference between it and the historical behavior data, and calculate the difference vector ;
[0179] The short-term interest group is locally updated, and the long-term interest group is globally optimized. The calculation formulas for local update and global optimization are:
[0180] ,
[0181] in, is the first learning rate, is the difference vector, t is the time interval, is the attenuation coefficient.
[0182] In the embodiment of the present invention, when monitoring the user's newly added behavior data in real time, the dynamic interest model can be adjusted according to the user's newly added behavior. Specifically, by calculating the differential vector of the user's behavior data, the short-term interest group is locally updated, while the long-term interest group is adjusted through global optimization. The combination of local update and global optimization enables the creation model to quickly respond to the user's immediate behavior changes while maintaining the prediction of the user's long-term interests.
[0183] This hierarchical update method can reduce the resource consumption of retraining the creation model when facing large-scale user behavior data. Compared with the existing global update method, the present invention can dynamically adjust the short-term interest group without affecting the long-term prediction. For example, when a user frequently browses a certain category of goods in a short period of time, the recommendation strategy can be updated immediately, while the long-term interest group remains unchanged, ensuring the accuracy of long-term recommendations.
[0184] In a preferred embodiment of the present invention, generating a training data set according to the dynamic interest model includes:
[0185] The feature vectors in the short-term interest feature data set and the long-term interest feature data set are merged to obtain a multi-dimensional feature data set;
[0186] The multidimensional feature data set is reduced in dimension to obtain a feature data set. The calculation formula for reducing the dimension of the feature data set is:
[0187] ,
[0188] in, is the output feature matrix, is the identity matrix, is the regularization parameter, is the graph Laplacian matrix, is the input feature matrix;
[0189] Label the feature data set, generate user behavior labels, and obtain the training data set.
[0190] In the embodiment of the present invention, by generating the latest training data set, the present invention combines the short-term and long-term interest feature vectors to generate a multi-dimensional feature data set, and further performs dimensionality reduction processing on the data. Through this dimensionality reduction processing step, the data dimension can be reduced, the data redundancy can be reduced, and the training efficiency can be improved.
[0191] Compared with existing technologies, dimensionality reduction ensures that the creative model can retain key information during the training process, while reducing the impact of redundant data on model training time. For example, in scenarios where the scale of user behavior data is huge, dimensionality reduction can accelerate model training and ensure the accuracy and stability of training results.
[0192] Among them, the feature data set is annotated to generate user behavior labels to obtain the training data set, including:
[0193] Assign labels to feature datasets based on the user's historical behavior or business rules. These labels are often used for supervised learning model training. For example, if you want to predict the user's interest in a certain content, you can use the user's actual click behavior as a label.
[0194] User behavior labels can be in various forms, such as binary labels (interested or not interested), multi-category labels (different interest categories), or continuous values (user ratings or behavior frequencies). The labeling process can be automatically generated by algorithms or enhanced with manually labeled data.
[0195] By combining the feature dataset with the corresponding user behavior labels, a complete training dataset is formed. This training dataset is used to train the model so that it can predict or classify future user behaviors.
[0196] In a preferred embodiment of the present invention, incremental training and transfer learning are performed on the creation model through a training data set to optimize the parameters of the model to obtain the creation model, including:
[0197] Obtaining a preliminary creation model, and adjusting the weight of the input layer of the preliminary creation model through a training data set to obtain an input layer optimization model;
[0198] The hidden layer parameters of the input layer optimization model are optimized to obtain the hidden layer optimization model, where the calculation formula for hidden layer parameter optimization is:
[0199] ,
[0200] in, is the updated parameter, is the original parameter, is the fourth learning rate, is the first objective function;
[0201] Freezing the feature extraction layer of the hidden layer optimization model to obtain a frozen feature model;
[0202] The feature extraction layer of the frozen feature model that meets the preset conditions is unfrozen, and its parameters are fine-tuned to obtain a fine-tuned feature model, wherein the calculation formula for fine-tuning the feature extraction layer parameters is:
[0203] ,
[0204] in, The new parameters for the unfrozen feature extraction layer, is the original parameters of the unfrozen feature extraction layer, is the second learning rate, is the second objective function;
[0205] The unfrozen layer and the frozen layer of the fine-tuned feature model are fused to obtain a fused model;
[0206] The creation model is obtained by weighting the tasks of the fusion model and performing global adjustments.
[0207] In the embodiment of the present invention, multiple submodules of the preliminary creation model are optimized through incremental training and transfer learning. First, by adjusting the input layer weights and hidden layer parameters, the model can be gradually optimized. Partial freezing and unfreezing of the feature extraction layer further ensures that the global adjustment of the model can be completed efficiently with limited computing resources.
[0208] Compared with the traditional global retraining method, the present invention can adapt to new data and tasks while retaining the original creation model capabilities through incremental training. The application of transfer learning further improves the adaptability of the creation model, enabling the creation model to quickly respond to new content generation tasks.
[0209] Among them, the first objective function And the second objective function It depends on the task type and actual application requirements of the model.
[0210] The first objective function It is used to measure the error between the model output and the target value when optimizing the input layer weights and hidden layer parameters. It is usually used to adjust the hidden layer parameters to make the middle layer of the model perform better than expected.
[0211] If the model task is a regression problem, the first objective function can use the mean square error to calculate the error between the predicted value and the true value.
[0212] If the model task is a classification task, the cross entropy loss is used as the objective function to calculate the difference between the predicted probability distribution and the true label.
[0213] The second objective function Used to optimize parameters when fine-tuning the unfreezing layer to improve the model's adaptability to specific features. When fine-tuning the feature extraction layer, the second objective function is used to measure the error between the output of the unfreezing layer and the expected output.
[0214] The second objective function A matching loss in feature space, such as Laplace loss, can be used to measure the difference between the distribution of the output features of the fine-tuning layer and the target distribution.
[0215] The second objective function During fine-tuning, you can also add regularization terms, such as L2 regularization, to avoid overfitting.
[0216] The preset conditions for unfreezing the feature extraction layer of the frozen feature model that meets the preset conditions can be determined according to specific strategies or conditions. For example:
[0217] Layer-by-layer thawing strategy:
[0218] Unfreeze the feature extraction layers gradually from high to low (or from low to high) according to their levels. For example, you can first unfreeze the high-level feature extraction layers close to the output layer, because these layers tend to learn more specific task features and are more adaptable. Then gradually unfreeze the low-level feature extraction layers closer to the input layer.
[0219] The thawing order can be based on the position of the layer or its distance from the output layer.
[0220] Gradient change strategy:
[0221] The unfrozen layers are determined by monitoring the gradient changes of each layer. If the gradients of some layers are large, it means that these layers are less adaptable to the target task, and these layers can be unfrozen first for fine-tuning optimization.
[0222] This strategy is suitable for situations where the thawing layer needs to be determined dynamically.
[0223] Specific threshold policies:
[0224] The range of unfreezing layers is determined based on the model's performance indicators (such as the value of the loss function) and a specific threshold. If the optimization effect of the model's loss function at a specific layer reaches the set threshold, the layer or more layers are unfrozen.
[0225] The threshold can be adjusted dynamically according to the progress of optimization to improve training efficiency.
[0226] Importance measurement strategy:
[0227] The unfreezing order is determined by calculating the impact of each layer on the overall model (such as weight importance or feature contribution). Layers that have a greater impact on model output are unfrozen first to speed up the model's adaptation to new tasks.
[0228] This strategy can measure the importance of layers through regularization techniques or feature attribution methods.
[0229] In a preferred embodiment of the present invention, the weight of the input layer of the preliminary creation model is adjusted by the training data set to obtain an input layer optimization model, including:
[0230] Get the input layer weight matrix of the preliminary creation model , and calculate the loss function of the training data set ;
[0231] Through the back propagation algorithm, the input layer weights are updated according to the gradient information to obtain the input layer adjustment weight matrix, where the calculation formula of the input layer adjustment weight matrix is:
[0232] ,
[0233] in, Adjust the weight matrix for the input layer, is the third learning rate, E is the loss function;
[0234] Use the input layer to adjust the weight matrix The training data set is re-evaluated. If the loss function does not meet the preset convergence condition, the step of updating the input layer weights is repeated until the convergence condition is met to obtain the input layer optimization model.
[0235] In an embodiment of the present invention, the present invention optimizes the input layer weights of the preliminary creation model through the back propagation algorithm. By obtaining the preliminary input layer weight matrix, the input layer weights are gradually updated according to the gradient information of the loss function, and finally an optimized input layer weight matrix is generated.
[0236] The optimized input layer can effectively improve the model's feature extraction capability, making subsequent creative model training more efficient. Compared with existing input layer optimization methods, the present invention can reduce the impact of invalid data on the creative model and improve the overall prediction capability by accurately adjusting the input layer weights when processing large-scale data.
[0237] Among them, the loss function E depends on the task type of the model and the actual application requirements. The loss function E is used to measure the adjustment effect of the input layer to improve the overall performance of the model. The mean square error or cross entropy loss can be used. A combined loss function can also be used to optimize multiple tasks at the same time.
[0238] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for automatically training a creative model based on user behavior preference data, characterized in that: The method comprises: Obtain the user's behavior data and combine it with the context information when the data occurs to obtain a multi-dimensional initial behavior data set; Perform multi-level preprocessing on the multi-dimensional initial behavior data set to obtain a behavior data set; Perform time series analysis and situational association analysis on the behavior data set, extract time series features and situational features, and obtain time series situational feature data; The time series context feature data is segmented according to the time sequence, and each segment of data is mapped to multiple interest states of the user in the corresponding time period to obtain multiple interest state segments; Perform multi-level clustering analysis on interest status fragments, divide them into short-term interest groups and long-term interest groups, and obtain the user's dynamic interest group dataset; Based on the dynamic interest group dataset, a dynamic interest model of users is constructed; Monitor the user's new behavior data in real time, and perform local updates and global optimization on the dynamic interest model. Local updates are used to adjust short-term interest groups, while global optimization is used to adjust long-term interest groups. Generate a training data set according to the dynamic interest model, wherein the training data set includes a user's short-term interest feature vector, a long-term interest feature vector, and a context weight vector; Perform incremental training and transfer learning on the creation model through the training data set, optimize the model parameters, and obtain the creation model; Among them, real-time monitoring of users' new behavior data, local update and global optimization of dynamic interest models, including: Monitor the user's new behavior data in real time, calculate the difference between it and the historical behavior data, and calculate the difference vector ; The short-term interest group is locally updated, and the long-term interest group is globally optimized; the calculation formula for the local update is: , in, is the updated short-term interest feature vector, is the short-term interest feature vector before updating, is the first learning rate, is the difference vector, t is the time interval, is the attenuation coefficient.
2. According to claim 1, the method for automatically training a creative model based on user behavior preference data is characterized in that: The multi-dimensional initial behavior data set is preprocessed at multiple levels to obtain a behavior data set, including: According to the preset behavior frequency or preset duration, the click, browse and favorite data in the multi-dimensional initial behavior data set are screened to obtain the first pre-processed data set, and the time decay factor is assigned to the data of different behavior types in the first pre-processed data set according to the context information. ; Performing multi-level noise removal on the first preprocessed data to obtain second preprocessed data; Each type of behavior data in the second preprocessed data is weighted to obtain a weight coefficient. The calculation formula of the weight coefficient is: , in, is the weight coefficient of the i-th behavior type, is the behavior frequency or duration of the ith behavior type, is the priority coefficient of the i-th behavior type, is the regulatory factor for the ith behavior type, is the time interval, j is the index of the behavior type, n is the total number of behavior types, is the time decay factor of the ith behavior type, is the smoothing parameter, is the bias term of the ith behavior type, and e is the base of the natural logarithm; The second preprocessed data is normalized according to the weight coefficient to obtain a behavior data set.
3. The method for automatically training a creative model based on user behavior preference data according to claim 2, characterized in that: Perform time series analysis and situational association analysis on the behavior data set, extract time series features and situational features, and obtain time series situational feature data, including: Slice the behavior data set according to the time window to obtain multiple time window segments; The calculation formula for the time window segment length is: , in, is the time difference of adjacent behavior data, is the number of behavior data in the window, is the adjustment coefficient of the time window, is the index of the behavior data, To adjust the parameters, is the average value of the time difference, v is the index of the time difference, and y is the number of time differences; Count the behavior data in each time window segment and extract the time series feature values of click count, browsing time and collection frequency; The context information of each time window is correlated and analyzed to extract the corresponding situational features. The time series feature values and situational features are concatenated to obtain the time series situational feature vector.
4. The method for automatically training a creative model based on user behavior preference data according to claim 3, characterized in that: The time series context feature data is segmented in chronological order, and each segment of data is mapped to multiple interest states of the user in the corresponding time period, thereby obtaining multiple interest state segments, including: Calculate the temporal context feature vector of adjacent time windows and The similarity between , similarity The calculation formula is: , in, is the weight of the b-th dimension feature, m is the dimension of the feature vector, b is the dimension index of the feature vector, For the The feature value of the time window on the b-th dimension feature, For the The feature value of the time window on the b-th dimension feature; When similarity When it is greater than the preset threshold, the time series context feature vector and Merge them into merged interest state fragments, otherwise mark them as different interest state fragments; The merged state segments of interest are smoothed to obtain state segments of interest.
5. The method for automatic training of a creation model based on user behavior preference data according to claim 4, characterized in that: Multi-level clustering analysis is performed on the interest status fragments to divide them into short-term interest groups and long-term interest groups, and the user's dynamic interest group dataset is obtained, including: Calculate the short-term interest similarity for each interest state segment to obtain the similarity matrix , similarity matrix The calculation formula is: , in, and The cth and dth interest state segments are in the The eigenvalue of dimension, f is the characteristic dimension, is the weight of the e-th dimension feature, is the regularization coefficient, is the scaling parameter; Perform density clustering on the similarity matrix to obtain short-term interest groups; The center points of short-term interest groups are re-clustered and merged into long-term interest groups to obtain a dynamic interest group dataset.
6. The method for automatic training of a creation model based on user behavior preference data according to claim 5, characterized in that: According to the dynamic interest group dataset, a dynamic interest model of users is constructed, including: Extract features from the dynamic interest group dataset to obtain a short-term interest feature dataset and a long-term interest feature dataset; The short-term interest feature dataset is obtained by the following formula: , in, is the short-term interest feature vector, is the weight matrix of the input features, is the input feature matrix, is the bias vector, is the adjustment coefficient, s is the input feature matrix The index of the attention head, q is the index of the attention head, h is the number of attention heads, ,in, is the query matrix, is the key matrix, is the value matrix, is the dimension of the key, The function is used to convert the dot product result into a probability distribution. is ReLU or Swish function; The long-term interest feature dataset is obtained by the following formula: , in, is the long-term interest feature vector, is the index of the attention head, r is the number of attention heads, It means concatenating the outputs of the multi-head self-attention mechanism. , is the output transformation matrix, is the weight parameter; The short-term interest feature dataset and the long-term interest feature dataset are weightedly fused to obtain a dynamic interest model.
7. The method for automatically training a creative model based on user behavior preference data according to claim 6, characterized in that: According to the dynamic interest model, a training data set is generated, including: The feature vectors in the short-term interest feature data set and the long-term interest feature data set are merged to obtain a multi-dimensional feature data set; The multidimensional feature data set is reduced in dimension to obtain a feature data set. The calculation formula for reducing the dimension of the feature data set is: , in, is the output feature matrix, is the identity matrix, is the regularization parameter, is the graph Laplacian matrix, is the input feature matrix; Label the feature data set, generate user behavior labels, and obtain the training data set.
8. The method for automatically training a creative model based on user behavior preference data according to claim 7, characterized in that: The creation model is incrementally trained and transferred through the training data set to optimize the model parameters and obtain the creation model, including: Obtaining a preliminary creation model, and adjusting the weight of the input layer of the preliminary creation model through a training data set to obtain an input layer optimization model; The hidden layer parameters of the input layer optimization model are optimized to obtain the hidden layer optimization model, where the calculation formula for hidden layer parameter optimization is: , in, is the updated parameter, is the original parameter, is the fourth learning rate, is the first objective function; Freezing the feature extraction layer of the hidden layer optimization model to obtain a frozen feature model; The feature extraction layer of the frozen feature model that meets the preset conditions is unfrozen, and its parameters are fine-tuned to obtain a fine-tuned feature model, wherein the calculation formula for fine-tuning the feature extraction layer parameters is: , in, The new parameters for the unfrozen feature extraction layer, is the original parameters of the unfrozen feature extraction layer, is the second learning rate, is the second objective function; The unfrozen layer and the frozen layer of the fine-tuned feature model are fused to obtain a fused model; The creation model is obtained by weighting the tasks of the fusion model and performing global adjustments.
9. The method for automatic training of a creation model based on user behavior preference data according to claim 8, characterized in that: The weight of the input layer of the preliminary creation model is adjusted through the training data set to obtain the input layer optimization model, including: Get the input layer weight matrix of the preliminary creation model , and calculate the loss function of the training data set ; Through the back propagation algorithm, the input layer weights are updated according to the gradient information to obtain the input layer adjustment weight matrix, where the calculation formula of the input layer adjustment weight matrix is: , in, Adjust the weight matrix for the input layer, is the third learning rate, E is the loss function; Use the input layer to adjust the weight matrix The training data set is re-evaluated. If the loss function does not meet the preset convergence condition, the step of updating the input layer weights is repeated until the convergence condition is met to obtain the input layer optimization model.
Citation Information
Patent Citations
Privacy protection recommendation method and system for next interest point, electronic equipment and medium
CN117272370A
Satellite inversion cloud classification method and device, electronic equipment and computer storage medium
CN118279671A