Giter Site home page Giter Site logo

sghoshjr / domain-adversarial-neural-network Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 4.0 41 KB

Implementation of Domain Adversarial Neural Network in Tensorflow

License: MIT License

Python 100.00%
tensorflow domain-adaptation adversarial-learning tensorflow-models tensorflow-2

domain-adversarial-neural-network's Introduction

Domain Adversarial Neural Network in Tensorflow

Implementation of Domain Adversarial Neural Network in Tensorflow.

Recreates the MNIST-to-MNIST-M Experiment.

Tested with tensorflow-gpu==2.0.0 and python 3.7.4.

MNIST to MNIST-M Experiment

Generating MNIST-M Dataset

Adapted from @pumpikano

To generate the MNIST-M Dataset, you need to download the BSDS500, and place it in ./Datasets/BSR_bsds500.tgz. Run the create_mnistm.py script.

Alternatively, the script create_mnistm.py will give you the option to download the dataset, if it is not found in the directory.

python create_mnistm.py

This should generate the ./Datasets/MNIST_M/mnistm.h5 file.

The dataset is also available here : mnistm.h5

Training

Run the DANN.py script.

python DANN.py

Uncomment the #train('source', 5) to use Source-only Training

Results

Note: The architecture and hyper-parameters do not match the ones used in the paper

The Testing Accuracy over MNIST-M [Target Dataset] reaches over ~94% over 100 epochs, as compared to the 76.66% mentioned in the paper.

Accuracy Graph

  • Source Accuracy : Self Accuracy Score over MNIST (used for Training)
  • Testing Accuracy : Accuracy Score over Testing Set of MNIST-M [Target Dataset]
  • Target Accuracy : Accuracy Score over Training Set of MNIST-M [Target Dataset]

References

Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., ... & Lempitsky, V. (2016). Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1), 2096-2030.

domain-adversarial-neural-network's People

Contributors

sghoshjr avatar zainulabidin302 avatar

Stargazers

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

Watchers

 avatar  avatar

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.