Giter Club home page Giter Club logo

latent_domains_da's Introduction

NEWS: a PyTorch version of the Weighted Batch Norm layers is available here!


This is the official Caffe implementation of Boosting Domain Adaptation by Discovering Latent Domains.

This code is forked from BVLC/caffe. For any issue not directly related to our additional layers, please refer to the upstream repository.

Additional layers

In this Caffe version, two additional layers are provided:

MultiModalBatchNormLayer

Allows to perform a weighted normalization with respect to one domain. Differently form standard BatchNormLayer it takes one more input, which is a weight vector of dimension equal to the batch size. This vector represents the probability that each sample belongs to the domain represented by this MultiModalBatchNormLayer. As an example, the syntax is the following:

layer{
    name: "wbn"
    type: "MultiModalBatchNorm"
    bottom: "input"
    bottom: "weights"
    top: "output"
}

In case we have 2 latent domains, the full mDA layer would be:

layer{
    name: "wbn1"
    type: "MultiModalBatchNorm"
    bottom: "input_1"
    bottom: "weights_1"
    top: "output_1"
}

layer{
    name: "wbn2"
    type: "MultiModalBatchNorm"
    bottom: "input_2"
    bottom: "weights_2"
    top: "output_2"
}

layer{
    name: "wbn"
    type: "Eltwise"
    bottom: "output_1"
    bottom: "output_2"
    top: "output"
    eltwise_param{
        operation: SUM
    }
}

Since the output of a MultiModalBatchNormLayer for each sample is already scaled for its probability, the final layer is a simple element-wise sum.

EntropyLossLayer

A simple entropy loss implementation with integrated softmax computation. We used the implementation of AutoDIAL.

Networks and solvers

Under models/latentDA we provide prototxts and solvers for the experiments reported in the paper. In particular the folder contains:

  • resnet18_k3.prototxt : the ResNet architecture used for the PACS experiments, with 3 latent domains.
  • alexnet_k2.prototxt : the AlexNet architecture used for the Office31 experiments, with 2 latent domains.
  • alexnet_sourcek2_targetk2.prototxt : the AlexNet architecture used for the Office-Caltech experiments in the multi-target scenario, with 2 latent domains for both source and target.
  • alexnet_k3.prototxt : the AlexNet architecture used for the Office-Caltech experiments in the multi-target scenario, with 3 latent domains.
  • solver_pacs.prototxt : the solver used for the PACS experiments.
  • solver_alexnet.prototxt : the solver used for both the Office31 and Office-Caltech experiments.

Notice that each of these files have some fields delimited by % which must be specified before their usage.

Abstract and citation

Current Domain Adaptation (DA) methods based on deep architectures assume that the source samples arise from a single distribution. However, in practice most datasets can be regarded as mixtures of multiple domains. In these cases exploiting single-source DA methods for learning target classifiers may lead to sub-optimal, if not poor, results. In addition, in many applications it is difficult to manually provide the domain labels for all source data points, i.e. latent domains should be automatically discovered. This paper introduces a novel Convolutional Neural Network (CNN) architecture which (i) automatically discovers latent domains in visual datasets and (ii) exploits this information to learn robust target classifiers. Our approach is based on the introduction of two main components, which can be embedded into any existing CNN architecture: (i) a side branch that automatically computes the assignment of a source sample to a latent domain and (ii) novel layers that exploit domain membership information to appropriately align the distribution of the CNN internal feature representations to a reference distribution. We test our approach on publicly-available datasets, showing that it outperforms state-of-the-art multi-source DA methods by a large margin.

@inProceedings{mancini2018boosting,
author = {Mancini, Massimilano and Porzi, Lorenzo and Rota Bul\`o, Samuel and Caputo, Barbara and Ricci, Elisa},
title  = {Boosting Domain Adaptation by Discovering Latent Domains},
booktitle = {Computer Vision and Pattern Recognition (CVPR)},
year      = {2018},
month     = {June}
}

latent_domains_da's People

Contributors

blgene avatar cdluminate avatar cypof avatar dgolden1 avatar eelstork avatar erictzeng avatar flx42 avatar intelfx avatar jamt9000 avatar jeffdonahue avatar jyegerlehner avatar kloudkl avatar longjon avatar lukeyeager avatar mancinimassimiliano avatar mavenlin avatar mohomran avatar mtamburrano avatar nitnelave avatar philkr avatar qipeng avatar rbgirshick avatar ronghanghu avatar sergeyk avatar sguada avatar shelhamer avatar tnarihi avatar willyd avatar yangqing avatar yosinski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

latent_domains_da's Issues

Missing file resnet18_k2.prototxt for PACS dataset with 2 latent domains.

Please use the caffe-users list for usage, installation, or modeling questions, or other requests for help.
Do not post such requests to Issues. Doing so interferes with the development of Caffe.

Please read the guidelines for contributing before submitting this issue.

Issue summary

Steps to reproduce

If you are having difficulty building Caffe or training a model, please ask the caffe-users mailing list. If you are reporting a build error that seems to be due to a bug in Caffe, please attach your build configuration (either Makefile.config or CMakeCache.txt) and the output of the make (or cmake) command.

Your system configuration

Operating system:
Compiler:
CUDA version (if applicable):
CUDNN version (if applicable):
BLAS:
Python or MATLAB version (for pycaffe and matcaffe respectively):

MultiModalBatchNorm

Can you provide your "MultiModalBatchNorm" layer please? I am getting the following error:

0710 03:13:25.977479 9991 layer_factory.hpp:81] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: MultiModalBatchNorm (known types: AbsVal, Accuracy, ArgMax, BNLL, BatchNorm, BatchReindex, Bias, Concat, ContrastiveLoss, Convolution, Crop, Data, Deconvolution, Dropout, DummyData, ELU, Eltwise, Embed, EntropyLoss, EuclideanLoss, Exp, Filter, Flatten, HDF5Data, HDF5Output, HingeLoss, Im2col, ImageData, InfogainLoss, InnerProduct, Input, LRN, LSTM, LSTMUnit, Log, MVN, MemoryData, MultinomialLogisticLoss, PReLU, Parameter, Pooling, Power, Python, RNN, ReLU, Reduction, Reshape, SPP, Scale, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice, Softmax, SoftmaxWithLoss, Split, TanH, Threshold, Tile, WindowData)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.