Short Video Recommendation Algorithm Incorporating Temporal Contextual Information and User Context

2023-03-12 09:00WeihuaLiuHaoyangWanandBoyuanYan

Weihua Liu,Haoyang Wanand Boyuan Yan

1Network Security and Information Management Center,Jining University,Jining,272000,China

2School of Computer Science,Qufu Normal University,Rizhao,276800,China

ABSTRACT With the popularity of 5G and the rapid development of mobile terminals, an endless stream of short video software exists.Browsing short-form mobile video in fragmented time has become the mainstream of user’s life.Hence, designing an efficient short video recommendation method has become important for major network platforms to attract users and satisfy their requirements.Nevertheless, the explosive growth of data leads to the low efficiency of the algorithm, which fails to distill users’points of interest on one hand effectively.On the other hand,integrating user preferences and the content of items urgently intensify the requirements for platform recommendation.In this paper,we propose a collaborative filtering algorithm,integrating time context information and user context,which pours attention into expanding and discovering user interest.In the first place,we introduce the temporal context information into the typical collaborative filtering algorithm, and leverage the popularity penalty function to weight the similarity between recommended short videos and the historical short videos.There remains one more point.We also introduce the user situation into the traditional collaborative filtering recommendation algorithm,considering the context information of users in the generation recommendation stage,and weight the recommended short-form videos of candidates.At last,a diverse approach is used to generate a Top-K recommendation list for users.And through a case study,we illustrate the accuracy and diversity of the proposed method.

KEYWORDS Recommendation algorithm;user contexts;short video;temporal contextual information

1 Introduction

With the popularity of smartphones and the advent of the era of unlimited traffic,short videos with fragmented content are more accessible to win the favor of the public than the traditional way of browsing pictures and texts.Consequently, short videos quickly occupy every aspect of people’s life.Taking TikTok as an example,it has quickly taken over every aspect of people’s lives because it integrated music,content,and ideas within a relatively short video length,which quickly meets users’needs.Based on the “2020 China Network Audiovisual Development Research Report”, the scale of Chinese network audiovisual users has exceeded 900 million, short video users have reached 820 million and they spend an average of nearly 2 h a day watching short videos.The usage rate of short video software increases year by year,becoming the most widely used video media by Internet users.We can see the growth frequency in Fig.1[1].

Figure 1:User size and usage rate growth frequency

In short video software,users who share and enjoy the moment of life customarily play the roles of viewer and producer simultaneously.However,the ensuing information overload makes it arduous to exert a tremendous fascination on users without an efficient recommendation algorithm.Hence,the recommendation system came into being.In contrast, much of the research in recommendation systems is based on collaborative filtering and content-based recommendation [2,3].The idea of recommendation based on collaborative filtering is to find some similarity in the group’s behavior.Consequently,the system makes decisions and recommendations for users in this way.

The above algorithms are divided into two categories:User-based collaborative filtering and itembased collaborative filtering.Unfortunately, the strategy also has some downsides: (1) The sparse interaction data and imprecise similarity method lead to limited recommendation effect.In addition,when faced with frequently updated data [4–7], the prediction efficiency of collaborative filtering is relatively low.(2)Content-based similarity measurement relies on a host of annotation data and does not necessarily reflect the similarity perceived by users,which greatly reduces the personalized effect of video recommendation.

This paper proposes a collaborative filtering algorithm which integrates time context information and user context.Similarly,it combines the specific context of user life and meets the requirements of personalized recommendation.Thus, the high-quality videos which receive little attention can enter the public view and achieve personalized and diversified recommendations.

Therefore,we propose an idea that is a collaborative filtering algorithm integrating time context information and user context.It has the characteristics of focusing on exploring and expanding of users’interests so that niche but high-quality videos can enter the public view and complete diversified personalized recommendations.

2 Related Work

2.1 Content-Based Recommendations

Content-based recommendations mainly use the meta information of items to make recommendations.After obtaining item tags through content analysis, we recommend items similar to those items that users have enjoyed in the past through their hobby records[8,9].The implementation flow of the algorithm is shown in Fig.2.The main operation process of this recommendation algorithm is divided into three parts:Firstly,all the items are extracted and recorded.Secondly,the interest model is constructed based on the analysis of user behavior data.Finally,the new items are sorted after the similarity calculation, and the items with higher similarity are recommended for the users.Whereas there remain critical limitations in content-based recommendation algorithm,and it mainly utilizes the information of items to make recommendations.Here is an example:In the video field,this algorithm only recommends videos with similar content for users(the content-based recommendation algorithm is invariably used in the“Guess Your Favorite”section on the home page of IQIYI.).

Figure 2:The main process of content-based recommendation

The idea of content-based recommendation is shown in Fig.3 below.However, for short video recommendation, it is formidable to extract interest tags from content-based recommendations.Consequently,the emergence of collaborative filtering can not only meet the“point”recommendation to users,but also meet the situation that the range of user interests is still unchanged.

2.2 Collaborative Filtering Recommendation

The interactive information of users and the items for recommendation are usually used by the collaborative filtering algorithms[10–13].It seems to be a recommendation algorithm under collective wisdom, which is widely used in the field of recommendation systems.Generally, collaborative filtering-based recommendations can be mainly divided into three categories:User-based collaborative filtering, item-based collaborative filtering, and model-based collaborative filter [14].User-based collaborative filtering algorithm is mainly based on the idea that “the target user will like the items that similar users like.”Accordingly,three steps are given in algorithm:(1)We leverage the similarity between users to find out the items similar to the target user’s preference items.(2)Target users’score is predicated on the corresponding items.(3)Items with the highest prediction score are recommended to target users.So,the principle is shown in Fig.4.

Figure 3:Content-based recommendation

Figure 4:User-based collaborative filtering

Item-based collaborative filtering algorithm needs to calculate the similarity between similar items,and then recommend Top-N items with high similarity ranking to users.The implementation principle is shown in Fig.5.In order to avoid the influence of sparse data on the accuracy of recommendation algorithm, a model-based collaborative filtering recommendation algorithm is proposed in [15].This algorithm mainly distills neural network, cluster analysis, hidden semantic model, and matrix decomposition[16]to predict the score and recommendation of blank data.

Figure 5:Item-based collaborative filtering

Whereas, dynamic changes in user preferences and practical problems of cold start [17–23] are arduous to figure out,resulting in certain deficiencies in the existing methods.Therefore,the recommendation system can not provide users with accurate personalized services (Cold start condition is a new form of problem [24–26], which is reflected between users and projects.).To update the recommended videos in real-time and solve the cold start problem,we adopt a collaborative filtering recommendation algorithm that incorporates temporal contextual information and user contexts.

2.3 User Situation

The concept of temporal contextual information has been incorporated into collaborative filtering recommendation algorithms, which made it capture more individuals’attention [27–30].Moreover,users may expect various recommendation results in divergent contexts[31–34].In recommendation,take the user’s living habits as an example.Before going to bed,most users may prefer to watch a short video as sleep assistance.Similarly,we infer that users prefer to browse videos reflecting national pride during the national day.Therefore,incorporating the conception of user context into algorithm makes it reap huge fruits,so as to realize the diversity of recommendations.

2.4 Hybrid Recommendation

Various conditions often constrain users’decision-making process[35–40].Similarly,in the field of recommendation systems, none of the recommendation algorithms can be perfectly compatible with all scenarios.Hence,according to the report of studying,targeted recommendations are made in diverse scenarios.For example,item-based collaborative filtering recommendations are more suitable for situations where the number of items is extensive, and users’preferences are similar and stable over time.At the same time, user-based collaborative filtering recommendations are more socially interactive and explanatory, which are suitable for tracking hot spots and over-filtering trends.The conventional method is organically combined with different recommendation algorithms to improve the accuracy of recommendations and users’satisfaction, so as to overcome the shortcomings of algorithms.

Much of the research shows that the hybrid recommendation algorithm mainly includes a singlechip hybrid recommendation algorithm, parallel hybrid recommendation algorithm, and pipeline hybrid recommendation algorithm.

The monolithic hybrid paradigm is an end-to-end solution.That is, multiple recommendation algorithms are integrated into the same algorithm system,meanwhile,the integrated recommendation algorithm provides recommendation services uniformly.And the specific implementation logic is shown in Fig.6.

Figure 6:Monolithic hybrid paradigm implementation logic

The parallel hybrid paradigm uses multiple recommendation systems for all project data.Moreover,results generated by each recommendation system are aggregated by weighted average and other methods to generate the user’s recommendation list.The specific implementation logic is shown in following Fig.7.

Figure 7:Parallel hybrid paradigm implementation logic

The pipeline hybrid paradigm is essentially shared in large e-commerce and social media.The YouTube platform invariably uses this hybrid scheme as an example.After promptly generating user preferences and item scores, the algorithm sorts the Top-K videos according to a more accurate recommendation method to generate a user recommendation list.The specific implementation logic is shown in Fig.8.In the short video recommendation software, we can get better recommendation results in each context and improve user perception by mixing different recommendation algorithms.

Figure 8:Pipeline hybrid paradigm implementation logic

3 Collaborative Filtering Contextual Information and User Context

3.1 Recommended Algorithm for Integrating Temporal Context Information(TI-CF Algorithm)

Collaborative filtering algorithm needs to calculate the similarity of items based on user’s behavior offline.Then, according to the user’s historical behavior, the calculated similarity is leveraged to recommend items for users.In TikTok, as an example, this algorithm leads to the recommendation of short video topics reflecting on head bloggers.It makes users easily “held hostage”by the trend.Such self-satisfied“happiness”that users are indulged in is quintessentially acknowledged as information cocoons.Recommendation algorithms,incorporated with temporal contextual information,are reflected in two separate temporal effects:

Variability:The recent video topics users like are more efficient than the topics with distant historical records.Consequently,different weights can describe different behaviors in recommendation.

Time interval:Video topics with a short time interval preferred by users are more important than the ones with a high time interval.

When calculating the similarity using the contextual information,the value of cosine similarity is calculated in Eq.(1):

Because the long-tail effect affects the recommended results,to prevent user from following the heat blindly, we give weight to the punishing parameters to reduce the influence of popular head products in Eq.(2):

Considering the variability,users’preferences in the near period should have higher weight than their preferences in the distant period[17].Consequently,we introduce a time decay function in Eq.(3):

Tis a time decay function,and the calculation formula is shown in Eq.(4):

Tis the time decay parameter which uses different values to indicate the adjustment inspired by user preferences.Its value is directly proportional to the change speed of user preferences and has a more robust real-time performance.

3.2 Recommended Algorithm for Integrating the User Context(UF-CF Algorithm)

Incorporating temporal contextual information in recommendation algorithm improves diversity and accuracy.To achieve effects of personalized and diversified further,we expect to exactly predict user preferences, fit user satisfaction, and use optimization algorithms to expand recommendation styles.So users can expand their horizons of the world and jump out of the virtual environment provided via short videos.We propose a recommendation algorithm that incorporates the user context.The item score matrix is established through historical data statistics,and each item is given different scores under different situations.This matrix is shown in Table 1.

Table 1: User context matrix

Here,i1,i2,...,imrepresent the short videos in software,V1,V2,...,Vmrepresent the considered user context, such as time, place, etc.V11,V12,...,V1prepresent the classification of different user contexts, such as V represents a holiday, thenv11,v12,...v1mcan represent Dragon Boat Festival,Tanabata,national.

We get the recommendation candidate set generated for each user.And then,we use item-context matrix to calculate the rating of each item with the user’s current context in the candidate set.It can be described in Eq.(5).

ri,Vis the score of the itemiin contextV,Vis the set of external contexts which the target user is currently in.ri,vis the score of item i in each specific context inV.The candidate set is rearranged based on the value ofri,v,and the topNitems with the highest ratings are selected to form the final recommendation list.

3.3 Generates a Recommendation List

The final recommendation list is generated in three steps:First,the recommendation list uses the recommendation algorithm incorporating temporal context information(TI-CF)to predict the scores.Second,the recommendation algorithm combined with user Context(UF-CF)is used to predict the score and generate the recommendation listK2.At last, the predicted scores ofK1andK2are given different weights to generate a new Top-N recommendation list for the user.To prevent the situation of information cocooning, randomness is added to the algorithm by using the two-eight principle,i.e.,furthermore,the algorithm recommends 80%of the videos,and the system randomly assigns the remaining 20%.We introduced the specific flow of this recommendation algorithm in Fig.9.

Figure 9:Specific algorithm flow

To describe this algorithm exhaustively,the symbols mentioned in this paper and their meanings are shown in Table 2.

Table 2: Symbols and their meanings

The pseudo-code of this algorithm can be described by Algorithm 1.

Algorithm 1:Short Video Recommendation Algorithm Incorporating Temporal Contextual Information and User Context Input:User-item table Item-context rating matrix K:the number of recommended items Output:a final recommendation list 1: for each i ∈[1, M]do 2: for each j ∈[1, N]do 3: for each k ∈[j, N]do 4: if j !=k 5: Then C[j][k]=C[k][j]=1 6: else C[j][k]=0 7: end if 8: end for 9: end for 10: update the co-occurrence matrix Ci for user i 11: C =C+Ci 12: end for 13: for Vj in■V -Vj■14: calculate S according to Eq.(2)15: update S according to Eqs.(3),(4)16: end for 17: Generate TOP-K video recommendation list Ki in ascending order of S 18: for Vj in■V -Vj■19: update ω according to Eq.(5)20: calculate S*ω 21: end for(Continued)

Algorithm 1:(Continued)22: Generate TOP-K video recommendation list L2 in ascending order of S*ω 23: update L=intersect(K1, K2)24: K * 0.2 videos were randomly selected from the video library to generate the final recommendation list L

4 Case Study

To further illustrate the proposed algorithm in this paper,the operational steps of the algorithm are explained in this section with a case study.

Step 1:Construct the co-occurrence matrix

As shown in Table 3, the User-item table records the information of each user’s favorite videos.The essential thing is to construct the short video similarity matrixWwhen using the recommendation algorithm.Therefore, it integrates temporal context information to itemize video recommendations for different users.In this paper, we use cosine similarity to solve the similarity degree between two videos.And the co-occurrence matrix of all users is constructed before constructing the short video similarity matrixW.

Table 3: User-item table

The co-occurrence matrix can be constructed for each user based on the above data.In practice,the number of users’preferences will vary from person to person.In this case,we extend the co-occurrence matrix of each user toN*N,where N is the number of the connection sets of all users’preferred videos.AndN= 5 holds in this example.Taking userU1as an example, Table 4 shows the co-occurrence matrix of userU1.We construct the co-occurrence matrix of each user and then sum it to obtain the co-occurrence matrix of all items.The co-occurrence matrix of all videos is shown in Table 5.

Table 4: The co-occurrence matrix of user U1

Table 5: Co-occurrence matrix

Step 2:Similarity calculation

Once obtain co-occurrence matrix,the video similarity matrix can be calculated.Hence,we take the calculated similarity of video a and video b as an example.It is known through the co-occurrence matrix N(a)= 2, that means two users like item a and item b at the same time.According to the User-Item table,we can count N(a)= 2 and N(b)= 3.And according to the improved Eq.(2),the similarity of item a and item b can be calculated in Eq.(6).

Similarly, the video similarity matrixWcan be obtained after finding the similarity of any two videos.The specific values of the video similarity matrix are shown in Table 6.To ensure the accuracy of the recommendation,we normalize the video similarity matrix.The final video similarity matrixWis shown in Table 7.

Table 6: Video similarity matrix

Table 7: Video similarity matrix

Step 3:Generate recommended list K1

After finding the video similarity matrixW, we can make video recommendations for users accordingly.Here,we take the recommendation forU3as an example:UserU3preference in the list of videos is{c,d},and the video similarity matrix shows that the videos similar to videodare{a,b,c}.The videos similar to videocare{b,d,e}.Hence,the upcoming list of recommended videos for userU3is{a,b,e}.Considering the variability of user preferences,the time decay function is introduced in this step according to Eqs.(3)and(4).Then we assume that the interval time(unit/day)for userU3to watch different videos in Table 8.

Table 8: Interval time

The result of solving using the improved similarity Eq.(3)is:

We calculate the similarity between all the videos in the recommended sequence and the videos liked byU3.Then the recommended list can be sorted according to the value of similarityP(U3,i).Therefore,the recommended list forU3is{a,b,e}and the results are shown in Table 9.

Table 9: Video similarity matrix

Step 4:Constructing an item-context scoring matrix

In order to consider the timeliness and diversity of the recommendation,we adopt the recommendation algorithm which incorporates the user content.Making the recommendations forU3:Through historical data statistics forU3,we assign different ratings to each item in different contexts.We use the number of times thatU3watches different videos in different contexts as the basis for rating.Then we get the item-context rating matrix as shown in Table 10.

Table 10: Item-context rating matrix

Step 5:Generate recommendation list K2

Adding the scoring attributes for items in different contexts, we calculate the weights for users’historical data and candidate lists dynamically.In this way, we can recommend different videos for users in different contexts and improve the temporal diversity in recommendations.This section only considers the influence of time and location factors on the recommendation results.Taking advantage of the item-context scoring matrix, the scoring and normalized result for different videos in the list can be obtained according to Eq.(6).And the rating list is shown in Table 11.We can select the first two videos with the highest score in the list,and recommend them to user.The recommendation list for userU3is{e,c}.

Table 11: Rating list of short videos

Step 6:Generate final recommended list

By mixing the recommendations of the two algorithms,we can see that the final recommendation result is {a,b,e,c}.In order to increase the randomness of the algorithm and expand the overall diversity of the recommended videos, we randomly introduce videos that are not in the candidate recommendation list.Therefore, assuming a situation where we need to recommend five videos for userU3.Then we can randomly recommend 20%videos for the user,i.e.,The final recommendation result maybe{a,b,e,c,a′}.

Step 7:Comparison experiment

We add comparison into the case study,for example,by modifying temporal context information or user context information to reflect the role of the algorithm in this respect.

Modifying the interval time of userU3can reflect the different recommendation results of the same user.The interval time(unit/day)of userU3watching different videos is shown in Table 12.Moreover,the ranking results of the value of the value of similarityP(U3, i)are shown in Table 13.

Table 12: Interval time

Table 13: Video similarity matrix

Judging from the above operation,the recommended result for userU3after modifying the time context information is{a,e,b}.

Similarly,by modifying item context rating matrix of userU3,the influence of different context information on recommendation results can be illustrated.The modified item-context rating matrix isshown in Table 14.Rating list of short videos for userU3is shown in Table 15.

Table 14: Item-context rating matrix

Table 15: Rating list of short videos

Judging from the above operation, the recommended result for userU3after modifying item context information is{d,b}.

Consequently,we can get the final recommendation result forU3is{a,e,b,d,b′}.

Through a comparison experiment,we comprehend that diverse recommendation results can be obtained for the same user according to the distinct temporal context information and user context information.At last,it embodies the personalized diversity of the proposed algorithm from the above mentioned.

5 Conclusion and Further Discussions

To address the current situation of information cocoons in short video recommendations, we propose a collaborative filtering algorithm that integrates temporal context information and user context.Initially, by an algorithm that integrates temporal context information, we optimize the similarity of items and recommend varied items which are similar to users’preference.Additionally,the user context(such as time,location,mood,etc.)is used to obtain the recommendation list.In the end,the results of the two recommendation lists are mixed in different proportions to generate the final recommendation list.We validate the feasibility of our work through a case study from the real world.Nevertheless, the effectiveness of this method has not been specifically measured.Therefore, in the future,we will verify the accuracy and diversity of our proposed method through more comparative experiments.

There still exist several limitations in our research work.First, the paramount problem that restricts the development of short video platforms is storage, in the case of drastic growth for users and videos.Therefore,we will introduce cost-efficient edge computing technologies with energy-saving[41–44] into video recommendations to overcome existing difficulties.Second, exploiting the rich story expressed in a short video will maximize the understanding of user’s preference to improve the accuracy of recommendations.So more useful content understanding technologies are necessary to be introduced into our recommendation scenario to pursue higher recommendation performances.Third,privacy concern often exists in user-related decision systems[45–49].And how to secure sensitive user information during recommendations is another research direction in our future study.At last,network structure[50–53]and routine selection[54–57]are two main components that form a typical social network and influence the performance of short video recommendation network.Therefore,we will continue to refine our work by introducing more social network elements in the future;this way,cold start issues in short video recommendations would be alleviated.

Funding Statement:The authors received no specific funding for this study.

Conflicts of Interest:The authors declare that they have no conflicts of interest to report regarding the present study.