MMGCF: Multimodal Graph Collaborative Filtering for Recommendation with Graph Convolutional Networks
The growing interest of the research community in multimodal recommendation models has introduced significant challenges, most notably: how to effectively process multimodal features and how to integrate them into traditional approaches like collaborative filtering. Despite the efforts, many existing methods achieve only marginal performance gains at the cost of increased model complexity and longer training time.
The main contribution of this paper is MultiModal Graph Collaborative Filtering (MMGCF), a recommendation model that integrates an efficient collaborative filtering backbone with pre-trained multimodal item features, introducing only a negligible increase in model complexity.
In this repo we provide instructions to set up an environment to run and reproduce our experiments. We run our experiment on a machine running Ubuntu 22.04, an Intel(R) Xeon(R) Silver 4309Y CPU, and an NVIDIA A16 GPU. We develop our model in Pytorch 2.9 with CUDA drivers v12.8.
First, we set un a Python environment and activate it with the following commands:
python -m venv _env
source _env/bin/activate
Then, move to the mmgcf directory and install the requirements (they can be found in mmgcf/requirements.txt):
pip install -r requirements.txt
Alternatively, it is possible to install the packages through this instruction:
pip install torch==2.9.0 torch-geometric==2.8.0 torch-scatter torch-sparse numpy>=2.1.0 toml>=0.10.2 tqdm>=4.67.1 tabulate>=0.9.0 gputil>=1.4.0
To run the exeperiments, we set common parameters in the src/config.toml file (e.g., seed, epochs, embedding_size, top_k). This file has the parameters we set to run our experiments.
In addition, in src/grid_search.py we set the hyperparameters to run our extensive experiments.
These include:
CONFIG.multimodal in [True, False] # False: LightGCN; True: MMGCF
CONFIG.dataset in ["ml1m", "dbbook", "sports"] # dataset
CONFIG.n_layers in [3,2,1] # GCN depth (num_layers)
CONFIG.weighting in ["alpha", "normalized", "equal"] # weighting mechanism
CONFIG.fusion_modalities in ["concat", "mean", "sum"] # fusion strategy
Once they are set, to run our experiments, you can run
python grid_search.py
The script will use utils functions in utils.py and the model implemented in mmgcf.py to run the code in main.py, for each configuration. A log directory will be created, containing the results of each run.
To run the baseline models, we consider the MMRec framework. We suggest to refer to the original instruction to set up a proper environment to tune the baseline models.
In this repo, we discuss the models we consider and the hyperparameters.
First, we bring our data into the MMRec format. These can be found in the MMRec/data/ directory.
To run the baseline models, once the environment has been set up, move to MMRec/src/ directory and run the command:
python main.py
This script can be edited by setting the dataset and the baseline model. Both are reported in the script.
In addition, in MMRec/src/config/model we found the model configuraton files. For our paper, we consider the following models with hyperparameters:
embedding_size: 512
reg_weight: [1e-01, 1e-02, 1e-03]
hyper_parameters: ["reg_weight"]
embedding_size: 512
n_layers: [1,2,3]
reg_weight: [1e-01, 1e-02, 1e-03]
hyper_parameters: ["reg_weight", "n_layers"]
embedding_size: 512
latent_embedding: 64
n_layers: [1,2,3]
reg_weight: [1e-01, 1e-02, 1e-03]
hyper_parameters: ["reg_weight", "n_layers"]
embedding_size: 512
feat_embed_dim: 512
weight_size: [64, 64]
learning_rate_scheduler: [0.96, 50]
lambda_coeff: 0.9
reg_weight: [1e-01, 1e-02, 1e-03]
cf_model: lightgcn
mess_dropout: [0.1, 0.1]
n_layers: [1,2,3]
knn_k: 10
hyper_parameters: ["reg_weight", "n_layers"]
embedding_size: 512
feat_embed_dim: 512
weight_size: [64, 64]
lambda_coeff: 0.9
reg_weight: [1e-01, 1e-02, 1e-03]
n_mm_layers: 1
n_ui_layers: [1,2,3]
knn_k: 10
dropout: 0.2
mm_image_weight: 0.1
hyper_parameters: ["reg_weight", "n_ui_layers"]