Master's Thesis
Using contrastive learning to learn representations from texts and images
— 2024
Key information
Authors:
Supervisors:
Published in
June 28, 2024
Abstract
”Contrastive Language-Image Pre-training” (pre-treino contrastivo de linguagem-imagem) é um modelo multimodal que aprende simultaneamente representações de texto e imagens. Treinado num corpus vasto de dados não rotulados, Contrastive Language-Image Pre-training (CLIP) ultrapassa o desempenho de modelos anteriores que usavam dados manualmente rotulados. Com o sucesso de CLIP surgiram modelos de visão-linguagem de grande escala, motivando a criação de um enorme dataset de imagem-texto multilingue, chamado LAION-5B, e o desenvolvimento de OpenCLIP, um repositório de modelos CLIP “open-source”. O desempenho de CLIP em contextos específicos ou em outras línguas pode ser melhorado com “fine-tuning”, como foi demonstrado em CLIP-Italian. Neste trabalho, um modelo CLIP pré-treinado é “fine-tuned” num dataset português e avaliado em tarefas como classificação de imagens zero-shot, busca de imagens e geração condicional de imagens. Expandindo o dataset de treino com LAION-5B e empregando os modelos maiores do OpenCLIP, este modelo pretende melhorar o trabalho de CLIP-Italian, levando ao aumento da precisão em classificação de imagens “zero-shot” com “prompts” em português. Uma estrutura para adaptar modelos CLIP para geração condicional de imagens é criada, usando as suas capacidades de representação imagem-texto em conjunto com um gerador StyleGAN, num processo baseado em StyleCLIP. Os resultados mostram que os modelos “fine-tuned” em português obtiveram piores resultados que os modelos multilingues na maioria dos casos nas três tarefas de avaliação, mas em algumas experiências conseguem ultrapassá-los. Algumas melhorias ao “fine-tuning” dos modelos são sugeridas e podem ser implementadas em trabalhos futuros. Contrastive Language-Image Pre-training (CLIP) is a multi-modal model that simultaneously learns representations of both text and images. Trained extensively on a vast corpus of unlabeled data, the model surpasses the performance of earlier models that used expensive manually labeled data. The success of CLIP has resulted in the emergence of large-scale vision-language models, motivating the creation of a massive multilingual image-text dataset in LAION-5B, and the development of a repository of open-source CLIP models in OpenCLIP. CLIP's performance in specific contexts or with prompts in other languages can be enhanced through fine-tuning, as demonstrated in CLIP-Italian. In this work, a pre-trained CLIP model is fine-tuned on a Portuguese-specific dataset and evaluated in tasks such as zero-shot image classification, image retrieval and conditional image generation. By expanding the training dataset with LAION-5B and employing larger models from OpenCLIP, this model seeks to enhance the work from CLIP-Italian, leading to improved accuracy in zero-shot classification tasks with Portuguese prompts. A framework to adapt the CLIP models to conditional image generation task is created, leveraging its image-text representation capabilities with a StyleGAN generator, in a process based on StyleCLIP. The results show that the Portuguese fine-tuned models perform worse than the multilingual ones in the majority of cases in the three evaluation tasks, but in some experiments manage to surpass them. Several improvements to the fine-tuning of the models are suggested and can be implemented in future work.
Publication details
Authors in the community:
Supervisors of this institution:
RENATES TID
203844165
Degree Name
Mestrado em Engenharia Eletrotécnica e de Computadores
Fields of Science and Technology (FOS)
electrical-engineering-electronic-engineering-information-engineering - Electrical engineering, electronic engineering, information engineering
Keywords
- Pré-treino Contrastivo de Linguagem-Imagem
- Fine-tuning
- Modelos de Linguagem Portugueses
- Modelos de Linguagem Multilingues
- Transformadores
- Redes Adversárias Generativas
- Contrastive Language-Image Pre-Training
- Portuguese Language Models
- Multilingual Language Models
- Transformers
- Generative Adversarial Networks
Publication language (ISO code)
eng - English
Rights type:
Embargo lifted
Date available:
May 26, 2025
Institution name
Instituto Superior Técnico