Giter Club home page Giter Club logo

unsupervised-domain-adaptation-in-computer-vision's Introduction

Topic: Domain-Adaptation

  • In this thesis, the development of a discrepancy based domain adaptation models named MBM (Modified Baseline Network - an extension of Deep CORAL) & CDAN (Custom Domain Adaptive Network) are discussed. The models are trained on popular benchmarked visual recognition domain datasets like Office-31, GTSRB and Synthetic Signs for image classification tasks, and their performances are evaluated compared to other available domain adaptation methods.
  • The "Magnitude based weight pruning" with Constant Sparsity approach is used to perform target feature extractor optimization.

Description about the code:

  1. models.py module defines the source & target models. Xception Network & Top layers
  2. config.py module defines various parameters like set paths, domain adaptation scenarios, backbone model selection, etc.
  3. loss.py defines the domain alignment loss functions. Deep CORAL loss, KL Divergence, etc.
  4. preprocessing.py module defines data preprocessing pipeline with various experimental scenarios including Data augmentation methods.
  5. train_test.py is a helper module which defines training and evaluation methods, including Evaluatiion metrics like Confusion Matrix, etc.
  6. utlis.py defines various plotting, helper methods and various logging paths like tensorboard, csv, model checkpoint, etc.
  7. main.py is the runnable script which defines various command line arguments of the experiment. In progress mode = "eval", script is running for mode="train_test"
  8. requirements.txt defines the libraries dependency of the experiments.
  9. Use shell script run.sh to run multiple experiments.
  10. evaluation folder shows the loss/accuracy plots, also can be viewed in Tensorboards.
  11. model_data folder stores the intermediate and final weights of the model.
  12. logs folder saves the logs for a particular run and create experiments.log file.
  13. data folder contains the datasets.
  14. Monitor experiments.log for log paths and script progress.
  15. Check the tensorboard logs by: tensorboard --lodir "path to tb logs"
  16. Check training_logs.csv for model training logs.
  17. Log paths: logs/CombinationID_BackboneModel_DomainLossUsed_LambdaWeight_Original/DateTimeStampValue) -> MBM logs/CombinationID_BackboneModel_DomainLossUsed_LambdaWeight/DateTimeStampValue) -> CDAN
  18. For Pruning: logs/CombinationID_BackboneModel_DomainLossUsed_LambdaWeight_PrunedValue/DateTimeStampValue) -> CDAN logs/CombinationID_BackboneModel_DomainLossUsed_LambdaWeight_Original_PrunedValue/DateTimeStampValue) -> MBM

Steps to execute the code:

  1. Create conda environment (tf): Install all the required dependencies using both pip and conda as mentioned in the requirements.txt file.
  2. Activate conda environment by: conda activate tf.
  3. You may launch the program by executing the main.py script directly from an IDE or via terminal.
  4. Also, one can run the shell command sh run.sh in order to run the series of python experiments.

Script parameters:

python main.py --combination="Amazon_to_Webcam" --architecture="Xception" --batch_size=16 resize=299
--learning_rate=0.0001 --mode="train_test" --lambda_loss=0.5 --epochs=50
--input_shape=(299,299,3) --output_classes=31 --loss_function="CORAL" --augment --prune --prune_val=0.30 --technique --save_weights --save_model --use_multiGPU

unsupervised-domain-adaptation-in-computer-vision's People

Contributors

rajatsharma07 avatar

Stargazers

 avatar

Watchers

 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.