Self-Supervision using Style Transfer for Domain Generalization

Document Type



Domain Generalization (DG) algorithms attempt to train a machine learning model based on data from different yet related source domains in such a way that it would generalize well to unseen target domains. Most existing DG algorithms rely on the availability of annotated data from the source domains to train a model in a fully (or semi) supervised manner. This hinders their applicability to real-world scenarios, where unlabeled data is far easier to obtain than costly and inaccessible annotated datasets. Inspired by infants’ intelligence to instinctively transfer their understanding of real-world objects to naturally recognize the same objects in cartoons or sketches, this paper aims to learn domain-invariant features by applying style transfer to unlabeled images and employing the self-supervised Barlow Twins framework. The proposed technique generates stylized images from a single source domain and pre-trains a Convolutional Neural Network (CNN) backbone by minimizing the Barlow loss between pairs of images generated from the same source image (without any access to labels). This approach facilitates implicit learning of a domain-invariant feature space that alleviates the domain gap by semantically aligning the domains to each other. This extends a standard self-supervised framework that mainly focuses on real-world photos (e.g., from ImageNet dataset) to handle large distribution shifts between domains. Through experiments on two standard DG datasets, namely, PACS and DomainNet, we show that the resulting pretrained model is able to generalize well to unseen domains with minimal supervision.

First Page


Last Page


Publication Date



Thesis submitted to the Deanship of Graduate and Postdoctoral Studies

In partial fulfillment of the requirements for the M.Sc degree in Machine Learning

Advisors: Dr. Huan Xiong, Dr. Rao Anwer

Online access for MBZUAI patrons