DOI: 10.5281/zenodo.10472493
title: Domain Adaptation via Feature Disentanglement (DAFD)

description: This dataset is available at doi:10.5281/zenodo.10472493.

Abstract

In many real-world scenarios, image classifiers are applied to domains that differ from the original training data. This poses the challenging problem of domain shift, which significantly reduces the classification accuracy. To tackle this issue, unsupervised domain adaptation (UDA) techniques have been developed to bridge the gap between source and target domains by transferring knowledge from a labeled source domain to an unlabeled target domain. We propose a novel and effective coarse-to-fine domain adaptation method called Domain Adaptation via Feature Disentanglement (DAFD). This approach incorporates two key components: first, our Class-Relevant Feature Selection module CRFS disentangles the features that are relevant for determining the correct class from the class-irrelevant features. As a result, the CRFS module prevents the network from overfitting to irrelevant data and enhances its focus on crucial information for accurate classification. This reduces the complexity of domain alignment, leading to an improved classification accuracy on the target domain. Second, our Dynamic Local Maximum Mean Discrepancy module DLMMD achieves a fine-grained feature alignment by minimizing the discrepancy among class-relevant features from different domains. The alignment process now becomes more adaptive and contextually sensitive, enhancing ability of the model to recognize domain-specific patterns and characteristics. The combination of the CRFS and DLMMD modules results in an effective alignment of class-relevant features. The knowledge is successfully transferred from the source to the target domain. We conduct comprehensive experiments on four standard datasets. Our results demonstrate that DAFD is very robust and effective in domain adaptive image classification tasks and superior compared to the state-of-the-art.

Key Features

DAFD has two key components:





Class-relevant Feature Selection (CRFS): This module distills the discriminative features essential for accurate classification. It focuses on foreground features while excluding irrelevant background features that may hinder the domain adaptation process.




Dynamic Local Maximum Mean Discrepancy (DLMMD): This module reduces the discrepancy between different domains at a fine-grained level. It aligns the identified features, allowing the model to adapt to diverse contexts and domain-specific characteristics.



Folder Structure

In this archive, you can find the implementation and the trained model parameters of our Domain Adaptation via Feature Disentanglement (DAFD). While all the code is contained in the single archive dafd_code.tar.xz, the model parameters for different situations have been split into several separate archives due to their size (namely into dafd_modelparameters_a2d.tar.xz, dafd_modelparameters_a2w.tar.xz, dafd_modelparameters_d2a.tar.xz, dafd_modelparameters_d2w.tar.xz, dafd_modelparameters_w2a.tar.xz, and dafd_modelparameters_w2d.tar.xz — each containing one set of trained model parameters). If you unpack all the archives into the same folder, then everything will be in the right place. The top-level directory DAFD will be created. In this directory, you find all the code. The model parameters will be located in the directory DAFD/modelparameters.

If you download the datasets used for training from their separate locations (see "Datasets Used" below), these should be placed into a folder data.

Side note: Each archive also includes this README file. When unpacking all the archives, it is totally save to overwrite duplicate files, as only the README is duplicate.

Functions of the Python Files



main.py: Project entry

transfer_losses.py: choose loss funtions (see folder DAFT/loss_funcs).

utils.py: some utilities

models.py: create the model

data_loader.py: load data

backbones.py: create backbone

folder loss_funcs: implementations of the loss functions

sh: start-up the project


Installation

This dataset is available at doi:10.5281/zenodo.10472493. You can download and unpack the code from archive dafd_code.tar.xz. Then, you will find the Python implementation of our method in folder DAFD/code. To install the required libraries, go into this filder and type pip install -r requirements.txt.

Datasets Used



Office-31: available via Azure (supports wget)

Office-Home: available via Azure (Supports wget)

ImageCLEF: available via Azure (Supports wget)

VisDA-17: available via Download the VisDA-classification dataset


License

Our source code and model parameters are released under the Creative Commons Attribution 4.0 International License. This dataset is available at doi:10.5281/zenodo.10472493.

Authors

The authors of this dataset remain anonymous for now, as this work is the basis for a paper which is submitted for review. We will enter the actual author information into the metadata of our zenodo archive once the paper is published.