Adaptive weighted short video recommendation method, electronic device and storage medium
By using an adaptive weighted short video recommendation method, a dual-tower deep neural network model is employed to assign higher weights to niche users, thus solving the problem of unsatisfactory recommendation accuracy for niche users in existing technologies and achieving higher recommendation accuracy and user retention rates.
Patent Information
- Application Number
- CN202211728766.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-12-30
AI Technical Summary
Existing short video platforms have unsatisfactory recommendation accuracy for niche users, leading to a decline in active users and user churn.
An adaptive weighted short video recommendation method is adopted, which adaptively assigns different weights to samples from general users and niche users, and uses a dual-tower deep neural network model and gradient descent to optimize model parameters and construct a weighted loss function to improve recommendation accuracy.
Without affecting overall recommendation performance, it significantly improved recommendation accuracy for niche users, enhanced user experience, and increased user retention and activity.
Smart Images

Figure CN116049485B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of short video recommendation, and particularly relates to a short video recommendation method with adaptive weighting, an electronic device and a storage medium. BACKGROUND
[0002] In recent years, short videos have attracted widespread attention due to the fragmentation of user time, the rapid popularization of mobile Internet and smart phones, and the low production threshold. The key to short videos' ability to seize user attention and traffic is that short video platforms can make accurate video recommendations according to user preferences. However, the recommendation accuracy of the recommendation system for niche users is not ideal, which leads to problems such as a decrease in the number of active users of short video platforms and user loss. Therefore, improving the recommendation accuracy for niche users has become an important problem for short video platforms. SUMMARY
[0003] The present application is proposed to solve the above-mentioned problems in the prior art, and provides a short video recommendation method with adaptive weighting, an electronic device and a storage medium, so as to improve the recommendation accuracy for niche users without affecting the overall recommendation performance by adaptively giving higher weights to samples that are easily misclassified, thereby effectively improving user retention rate and activity.
[0004] To achieve the above-mentioned purposes, the present application adopts the following technical solutions:
[0005] The short video recommendation method with adaptive weighting has the following steps:
[0006] S1, dividing users into mass users and niche users according to the proportion of users watching popular short videos, and obtaining the historical interaction records of mass users and niche users with short videos and inputting them into a pre-trained fully connected neural network for feature extraction to obtain a sample feature set of mass users and a sample feature set of niche users wherein, u i represents the mass user features in the i-th mass user sample (u i , c i ), c i represents the video features in the i-th mass user sample (u i , c i ); i = 1, 2,..., N, N represents the total number of mass user samples; u' j represents the niche user features in the j-th niche user sample (u' j , c' j ), c' j represents the video features in the j-th niche user sample (u' j , c'j video features in the i-th sample of the mass user, j = 1, 2, …, M, M represents the total number of samples of the mass user;
[0007] S2, a double-tower model composed of two three-layer fully connected neural networks is constructed, and the sample feature set of the mass user and the sample feature set of the mass user are input into the double-tower model respectively, and the high-order feature set of the mass user sample and the high-order feature set of the mass user sample are output correspondingly. i , q i represent the mass user high-order features in the i-th sample (p i , q i ) of the mass user, q i represent the video high-order features in the i-th sample (p i , q j represent the mass user high-order features in the j-th sample (p' j , q' j ) of the mass user, q' j represent the video high-order features in the j-th sample (p' j , q' j ) of the mass user.
[0008] S3, the cross-entropy loss L of the double-tower model is constructed by using formula (1):
[0009]
[0010] In formula (1), represents the transpose of p i , p' j represents the transpose of p' i , y i represents the label of the i-th sample (u i , c j ) of the mass user, and y' i represents the label of the i-th sample (u i , c i ) of the mass user.
[0011] S4, the double-tower model is pre-trained by using the gradient descent method, and the cross-entropy loss L is calculated to update the model parameters until the cross-entropy loss L converges, so as to obtain the pre-trained double-tower model;
[0012] S5, update the pre-trained double-tower model:
[0013] S5.1 Define the current iteration number as t and initialize t = 1; use the pre-trained dual-tower model as the dual-tower model for the t-th iteration;
[0014] Using equation (2), calculate the sample (u) of the i-th mass user in the t-th iteration. i c i Weights
[0015]
[0016] In equation (2), α is a parameter whose value ranges from [1, 10]. This represents the sample (u) of the i-th general user in the t-th iteration. i c i The cross-entropy loss is calculated from equation (3);
[0017]
[0018] In equation (3), β is a parameter that takes the value [0.1, 0.2]. This represents the sample (p) of the i-th general user in the t-th iteration. i q i Advanced characteristics of mass users in ) This represents the sample (p) of the i-th general user in the t-th iteration. i q i High-order features of the video in ) express The transpose of , when t=1, let the sample of the i-th mass user in the (t-1)-th iteration (u i c i Cross-entropy loss
[0019] Using equation (4), calculate the sample (u′) of the j-th niche user in the t-th iteration. j , c′ j Weights
[0020]
[0021] In equation (4), Let u' represent the sample of the j-th niche user in the t-th iteration. j , c′ j The cross-entropy loss is calculated from equation (5).
[0022]
[0023] In equation (5), represents the high-order feature of the niche user in the sample (p' j , q' j ) of the jth niche user in the tth iteration, represents the video high-order feature in the sample (p' j , q' j ) of the jth niche user in the tth iteration, represents the transpose of , and when t = 1, the cross-entropy loss of the sample (u' j , c' j ) of the jth niche user in the t-1th iteration is
[0024] The weighted loss function L t of the tth iteration is constructed by using formula (7):
[0025]
[0026] S5.4, the gradient descent method is used to train the double-tower model of the tth iteration, and the weighted loss function L t is minimized to update the parameters of the double-tower model of the tth iteration;
[0027] S5.5, after assigning t+1 to t, return to step S5.2 for sequential execution until t reaches the maximum iteration number t max , so as to obtain an updated double-tower model;
[0028] S7, input the high-order feature set of any user and the high-order feature set of all videos into the updated double-tower network for processing, and output the scores of the user to all videos, so as to select the top top videos with the highest scores and recommend them to the corresponding user.
[0029] The electronic device comprises a memory and a processor, and the memory is used to store a program supporting the processor to execute the short video recommendation method, and the processor is configured to execute the program stored in the memory.
[0030] The computer readable storage medium stores a computer program, and the computer program is executed by the processor to execute the steps of the short video recommendation method.
[0031] Compared with the prior art, the beneficial effects of the present application are as follows:
[0032] 1、The present application can adaptively calculate the optimal weight of each sample with the update of model parameters, and the weight obtained by the direct weighting method is more accurate, so that the recommendation accuracy of the model for niche users can be greatly improved.
[0033] 2、The application carries out fine-grained weighting on samples prone to misclassification at the sample level, gives higher weights to samples prone to misclassification, so that the model can pay more attention to the difference in the degree of user interest preference for different videos, thereby more accurately learning the interaction between users and videos, and achieving better recommendation accuracy.
[0034] 3、The application combines the long-term basic attribute characteristics and recent interest characteristics of the user, vectorizes the long-term basic characteristics and recent interest characteristic vectors of the user through the full connection neural network, and splices the two as the hidden characteristics of the user, so as to more truly and comprehensively reflect the personalized preferences of the user, and improve the recommendation accuracy of the model for all users.
[0035] 4、The application is based on a double-tower deep neural network model, and calculates the weight of each sample according to the probability of misclassification of the sample, designs a weighted loss function, and uses stochastic gradient descent to continuously optimize the model parameters, so as to provide more accurate recommendations for niche users while ensuring overall recommendation accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 The flowchart of the short video recommendation method of the application. DETAILED DESCRIPTION
[0037] In this embodiment, a short video recommendation method for improving the experience of niche users through adaptive weighting, as shown in Figure 1 , includes the following steps: 1) dividing users into mass users and niche users according to the proportion of watching popular short videos; 2) extracting vector features of users and short videos and using them to pre-train a double-tower model; 3) adaptively giving higher weights to samples prone to errors in mass users and niche users, and updating model parameters based on the weighted loss function; 4) repeating step 3 until the sample weight and model parameter converge, and obtaining an updated double-tower model; 5) using the updated double-tower model to generate a final short video recommendation list for the user. Specifically, the adaptive weighting short video recommendation method includes the following steps:
[0038] S1, according to the proportion of watching popular short videos, the users are divided into mass users and niche users, wherein the popular short videos are the videos with exposure located in the top 20% of all short videos, the proportion of mass users watching popular short videos is about 50%, and the proportion of niche users watching popular short videos is about 25%. The historical interaction records of mass users and niche users with short videos are obtained and input into a pre-trained full connection neural network for feature extraction, to obtain a sample feature set of mass users and a sample feature set of niche users, wherein, ui represents the user characteristics in the i-th sample of the mass user (u i , c i ), including the identity, age, region, gender and occupation characteristics of the mass user, c i represents the video characteristics in the i-th sample of the mass user (u i , c i ), including the number, category, length, hotness and release time characteristics of the video; i = 1, 2, …, N, N represents the total number of samples of the mass user; u' j represents the user characteristics in the j-th sample of the small user (u' j , c' j ), including the identity, age, region, gender and occupation characteristics of the small user, c' j represents the video characteristics in the j-th sample of the small user (u' j , c' j ), including the number, category, length, hotness and release time characteristics of the video, j = 1, 2, …, M, M represents the total number of samples of the small user;
[0039] S2, a double-tower model composed of two three-layer fully connected neural networks is constructed, and the mass user sample feature set and the small user sample feature set are input into the double-tower model respectively, and the high-order feature set of the mass user sample and the high-order feature set of the small user sample are output correspondingly. i represents the mass user high-order feature in the i-th sample (p i , q i ), the feature dimension is 16, q i represents the video high-order feature in the i-th sample (p i , q i ), the feature dimension is 16, p' j represents the small user high-order feature in the j-th sample (p' j , q' j ), the feature dimension is 16, q' j represents the video high-order feature in the j-th sample (p' j , q' j ), the feature dimension is 16.
[0040] S3, the cross-entropy loss L of the double-tower model is constructed by formula (1):
[0041]
[0042] In equation (1), p i transpose, The value range of is [0, 1]. p′ j transpose, The value range of y is [0, 1]. i Represents the sample of the i-th general user (u) i c i The label y′ has a value range of {0, 1}. j Represents the sample of the i-th general user (u) i c i The label for ) has a value range of {0, 1};
[0043] S4. Pre-train the dual-tower model using gradient descent and calculate the cross-entropy loss L to update the model parameters until the cross-entropy loss L converges, thereby obtaining the pre-trained dual-tower model.
[0044] S5. Update the pre-trained dual-tower model:
[0045] S5.1 Define the current iteration number as t and initialize t = 1; use the pre-trained dual-tower model as the dual-tower model for the t-th iteration;
[0046] The idea behind this step is to assign higher weights to samples that are prone to misclassification in both the general population and the niche population. The objective function for updating the sample weights of general users is shown in equation (2):
[0047]
[0048] stw T 1 = N, w ≥ 0.
[0049] The closed-form solution to this optimization problem can be obtained using the Lagrange multiplier method.
[0050]
[0051] Therefore, using equation (4), the sample (u) of the i-th mass user in the t-th iteration is calculated. i c i Weights
[0052]
[0053] In equation (4), α is a parameter that takes values between [1, 10]. This represents the sample (u) of the i-th general user in the t-th iteration.i , c i ) and is obtained by equation (5);
[0054]
[0055] In equation (5), β is a parameter with value in [0.1, 0.2]; represents the sample (p i , q i ) of the i-th mass user in the t-th iteration, and the feature dimension is 16, represents the sample (p i , q i ) of the i-th mass user in the t-th iteration, and the feature dimension is 16, represents the transpose of , and when t = 1, let the cross-entropy loss of the sample (u i , c i ) of the i-th mass user in the t-1-th iteration
[0056] The objective function of the sample weight update of the small user is shown in equation (6):
[0057]
[0058] s.t.w′ T 1 = M, w' ≥ 0.
[0059] The closed solution of this optimization problem can be obtained by using the Lagrange multiplier method as shown in equation (7):
[0060]
[0061] Therefore, the weight of the sample (u' j , c' j ) of the j-th small user in the t-th iteration is calculated by equation (8)
[0062]
[0063] In equation (8), represents the cross-entropy loss of the sample (u' j , c' j ) of the j-th small user in the t-th iteration, and is obtained by equation (9);
[0064]
[0065] In equation (9), Let p' represent the sample of the j-th niche user in the t-th iteration. j ,q′ j The high-order features of niche users in the data are 16-dimensional. Let p' represent the sample of the j-th niche user in the t-th iteration. j ,q′ j The video high-order features in the dataset have a feature dimension of 16. express The transpose of , when t=1, let (u′) be the sample of the j-th niche user in the (t-1)-th iteration. j , c′ j Cross-entropy loss
[0066] The weighted loss function L for the t-th iteration is constructed using equation (10). t :
[0067]
[0068] S5.4. Train the dual-tower model for the t-th iteration using gradient descent and minimize the weighted loss function L. t To update the parameters of the twin-tower model in the t-th iteration;
[0069] S5.5 After assigning t+1 to t, return to step S5.2 and execute sequentially until t reaches the maximum number of iterations t. max Up to, t max The value of is 1000, thus obtaining the updated twin-tower model;
[0070] S7. Input the high-order feature set of any user and the high-order feature set of all videos into the updated dual-tower network for processing, and output the user's rating of all videos, thereby selecting the top 100 videos with the highest ratings to recommend to the corresponding user. The value of top is 100.
[0071] Table 1 shows the recall rates of different methods on the Kuaishou short video dataset for both general and niche users. ERM was used as the baseline model in the experiments. Besides our proposed method, we also compared the inverse probability weighted IPW algorithm, the CB algorithm with a balance term added to the loss function, and the DRO algorithm with iterative weighting for different user groups. Our proposed method not only significantly improves the recall rate for niche users but also achieves the highest recall rate for general users.
[0072] Table 1: Recall rates of different methods on the Kuaishou short video dataset for general and niche users.
[0073] Model Niche users Mass users ERM 0.193 0.457 IPW 0.192 0.460 CB 0.199 0.460 DRO 0.218 0.443 The method 0.214 0.460
[0074] To sum up, the present application adaptively weights the samples that are easily mistaken in the sample of mass users and the sample of small users, improves the recommendation accuracy of the model for small users in the case of ensuring the recommendation accuracy for mass users, improves the use experience of small users, increases the user retention rate and the number of active users, and can be applied to the field of short video recommendation.
Claims
1. A method for adaptive weighted short video recommendation, characterized in that, The method comprises the following steps: S1, divide the users into popular users and non-popular users according to the proportion of the users watching popular short videos, and obtain the historical interaction records of the popular users and the non-popular users with the short videos and input the historical interaction records into a pre-trained fully connected neural network for feature extraction to obtain a sample feature set of the popular users and a sample feature set of the non-popular users wherein, u i represents the popular user feature in the sample (u i , c i ) of the i-th popular user, c i represents the video feature in the sample (u i , c i ) of the i-th popular user; i = 1, 2, …, N, N represents the total number of the samples of the popular users; u′ j represents the non-popular user feature in the sample (u′ j , c′ j ) of the j-th non-popular user, c′ j represents the video feature in the sample (u′ j , c′ j ) of the j-th non-popular user; j = 1, 2, …, M, M represents the total number of the samples of the non-popular users S2, build a double-tower model composed of two three-layer fully connected neural networks, and input the sample feature set of the mass user and the sample feature set of the niche user into the double-tower model respectively, and output the high-order feature set of the mass user sample and the high-order feature set of the niche user sample correspondingly wherein, p i represents the mass user high-order feature in the sample (p i , q i ) of the i-th mass user, q i represents the video high-order feature in the sample (p i , q i ) of the i-th mass user, p' j represents the niche user high-order feature in the sample (p' j , q' j ) of the j-th niche user, q' j represents the video high-order feature in the sample (p' j , q' j ) of the j-th niche user S3, constructing a cross-entropy loss L of a double-tower model by using formula (1): In formula (1), denotes the transpose of p i , denotes the transpose of p' j , i denotes the label of the i-th sample of the mass user (u i , c i ), j denotes the label of the i-th sample of the mass user (u i , c i ). S4, pre-training the double-tower model by using a gradient descent method, and calculating the cross-entropy loss L to update model parameters until the cross-entropy loss L converges, thereby obtaining a pre-trained double-tower model; S5, updating the pre-trained double-tower model: S5.1, defining a current iteration number as t, and initializing t=1; taking the pre-trained double-tower model as the double-tower model of the tth iteration; The weight of the sample (u i , c i ) of the i-th public user in the t-th iteration is calculated using the formula (2) In formula (2), a is a parameter with a value ranging from [1, 10], represents the cross-entropy loss of the i-th public user's sample (u i , c i ) in the t-th iteration, and is obtained by formula (3); In formula (3), β is a parameter with a value in [0.1, 0.2]; represents the public user high-order feature in the sample (p i , q i ) of the i-th public user in the t-th iteration, represents the video high-order feature in the sample (p i , q i ) of the i-th public user in the t-th iteration, represents the transpose of , and when t = 1, the cross-entropy loss of the sample (u i , c i ) of the i-th public user in the t-1-th iteration is The weight of the sample (u'j(t), c'j(t)) of the jth niche user in the tth iteration is calculated using equation (4) j j In formula (4), represents the cross-entropy loss of the sample (u'j(t), c'j(t) ) of the jth niche user in the tth iteration, and is obtained by formula (5); j j j j j j j j j j j j j j <000004 in formula I5) is represents the sample (p'j, q'j) of the jth niche user in the tth iteration, j , q'j) of the jth niche user in the tth iteration, j , q'j) of the jth niche user in the tth iteration, represents the video high-order feature in the sample (p'j, q'j) of the jth niche user in the tth iteration, j , q'j) of the jth niche user in the tth iteration, j , q'j) of the jth niche user in the tth iteration, represents the transpose of , q'j) of the jth niche user in the tth iteration, j , q'j) of the jth niche user in the tth iteration, j , q'j) of the jth niche user in the tth iteration, The weighted loss function L of the tth iteration is constructed using formula (7) t : S5.4, train the dual tower model of the t-th iteration using gradient descent method and minimize the weighted loss function L t update the parameters of the dual tower model of the t-th iteration; S5.5, after assigning t+1 to t, return to step S5.2 to sequentially execute until t reaches a maximum iteration number t max until an updated two-tower model is obtained. S7, inputting the high-order feature set of any user and the high-order feature set of all videos into the updated double-tower network for processing, and outputting scores of the user to all videos, thereby selecting top videos with the highest scores to recommend to the corresponding user.
2. An electronic device comprising a memory and a processor, characterized in that The memory is configured to store a program supporting the processor to execute the short video recommendation method in claim 1, and the processor is configured to execute the program stored in the memory.
3. A computer-readable storage medium having stored thereon a computer program, characterized in that The computer program, when executed by the processor, performs the steps of the short video recommendation method in claim 1.
Citation Information
Patent Citations
Personalized scenic spot recommendation method and device based on knowledge graph and long-term and short-term preferences of user
CN110287335A
Video recommendation method and system based on deep neural network, and storage medium
CN111382307A