Using contrastive language-image pre-training for Thai recipe recommendation
摘要
In this study, we utilized CLIP (Contrastive Language-Image Pretraining) as a recommendation model for retrieving images of Thai food recipes relevant to a query ingredient text in the Thai language. We scraped a total of 22,500 food recipes online and used the recipe image and ingredient list as an image-text pair for training. After preprocessing the data, we trained CLIP using four variations of image and text encoders, employing distilbert-base-th-cased and wangchanberta-base-att-spm-uncased as text encoders, and ResNet50 and EfficientNet-B2 as image encoders. The model trained with distilbert-base-th-cased and ResNet50 achieved the best top-10 accuracy of 17.1%. CLIP applications for the Thai language are rare due to the language’s complexity and difficulty in embedding. However, our study demonstrates that CLIP can comprehend the relationship between image and text in the Thai language, particularly for ingredients with unique shapes or colors and popular recipes in the dataset.