Movie Recommendation systems, like other recommendation systems, can primarily be built using two approaches: collaborative filtering and content-based filtering. When knowledge graphs are used alongside user ratings, the system is designed as a hybrid recommender system. We use a pre-constructed knowledge graph [1] that includes relationships for movies, such as country of production, soundtrack, and director. We design a movie recommendation system based on the aforementioned knowledge graph and the MovieLens dataset [2], which provides user information, using the Graph Attention Network (GAT) neural architecture.
In the MovieLens-1M dataset, the numbers of users, movies, and user ratings for movies are 6,040, 3,952, and 1,000,210, respectively. User attributes include gender, age, occupation, and ZIP code. We use all of these attributes except the ZIP code for training the models.
The figures below present the distributions of user ratings for movies, as well as the distributions of users' ages and occupations. The rating distribution for men is similar to that for women, except that the number of female users is smaller. The age group 18–35 years constitutes the largest proportion of users who provide ratings.
The occupation identifiers are defined as follows:
- 0: "other" or not specified
- 1: "academic/educator"
- 2: "artist"
- 3: "clerical/admin"
- 4: "college/grad student"
- 5: "customer service"
- 6: "doctor/health care"
- 7: "executive/managerial"
- 8: "farmer"
- 9: "homemaker"
- 10: "K-12 student"
- 11: "lawyer"
- 12: "programmer"
- 13: "retired"
- 14: "sales/marketing"
- 15: "scientist"
- 16: "self-employed"
- 17: "technician/engineer"
- 18: "tradesman/craftsman"
- 19: "unemployed"
- 20: "writer"
Farmers, merchants, and unemployed individuals had the lowest participation in the surveys, while students, managers, and engineers had the highest participation.
The knowlege graph items are provided in the form of (movie_id, relation, movie_id). Here are a few examples:
11904 film.film.producer 16954
348 film.film.actor 16955
13598 film.film.costume_designer 16956
9098 film.film.actor 16957
Among previous works on the MovieLens-1M dataset, matrix completion methods have achieved strong performance [3,4,5]. In [5], graph neural networks were used for matrix completion. Another category of models relies only on graph neural networks and attempts to design a hybrid recommendation system [1,6]. According to my study, the error of the model proposed in [6] is higher than that of the proposed model in [1], called KGCN. Therefore, We use KGCN for our contribution to make an improvement. They trained the KGCN model on a knowledge graph provided for the MovieLens-20M dataset. So, We filtered the knowledge graph to be compatible with the MovieLens-1M dataset. We make two contributions:
-
We design KGAT based on Graph Attention Networks (GAT) instead of Graph Convolutional Networks (GCN) for learning from the knowledge graph. In attention-based graph neural networks, the model is able to learn the relative importance of neighboring nodes by assigning different weights to them.
-
The KGCN model is allowed to learn the initial user features and construct a representation for each user from random input embeddings [2]. Instead, we utilize user metadata and construct initial feature vectors for each user based on the available user information.
We use the RMSE criterion for evaluation. The results are shown in the table below. Some of the movies in the MovieLens-1M dataset were removed because any corresponding nodes to them are not available in the knowledge graph. Therefore, for the models we trained, the number of user–movie rating samples decreased from 1,000,210 to 664,225. The RMSE of KGCN and KGAT are 1.002 and 0.9786, indicating our model outperforms KCGN.
[1] Wang, Hongwei, et al. "Knowledge graph convolutional networks for recommender systems." The world wide web conference. 2019. The knowledge graph is available at https://github.com/zzaebok/KGCN-pytorch
[2] Harper, F. Maxwell, and Joseph A. Konstan. "The movielens datasets: History and context." Acm transactions on interactive intelligent systems. 2015.
[3] Han, Soyeon Caren, et al. "Glocal-k: Global and local kernels for recommender systems." Proceedings of the 30th ACM International Conference on Information & Knowledge Management. 2021.
[4] Shen, Wei, et al. "Inductive matrix completion using graph autoencoder." Proceedings of the 30th ACM International Conference on Information & Knowledge Management. 2021.
[5] Zhang, Muhan, and Yixin Chen. "Inductive matrix completion based on graph neural networks." arXiv preprint arXiv:1904.12058 (2019).
[6] Darban, Zahra Zamanzadeh, and Mohammad Hadi Valipour. "GHRS: Graph-based hybrid recommendation system with application to movie recommendation." Expert Systems with Applications. 2022.