MatchGAN: A Self-supervised Semi-supervised Conditional Generative Adversarial Network

Related tags

Deep LearningMatchGAN
Overview

MatchGAN: A Self-supervised Semi-supervised Conditional Generative Adversarial Network

This repository is the official implementation of MatchGAN: A Self-supervised Semi-supervised Conditional Generative Adversarial Network.

alt text

This repository is built upon the framework of StarGAN.

1. Cloning the repository

Clone the repository and navigate to it.

$ git clone https://github.com/justin941208/MatchGAN.git
$ cd MatchGAN/

2. Installing requirements

The following libraries should be separately installed. Instructions are available on their respective websites:

Additional requirements can be installed by running:

pip install -r requirements.txt

To evaluate MatchGAN using GAN-train and GAN-test, the following files should be downloaded and unzipped directly under MatchGAN/.

2. Downloading the datasets

To download the CelebA dataset:

$ bash download.sh

In addition, the partition file list_eval_partition.txt should be downloaded from the official CelebA google drive and placed immediately under the directory ./data/celeba/.

To download the RaFD dataset, one must request access to the dataset from the Radboud Faces Database website. Once all the image files are obtained, they need to be placed under the subdirectory ./data/RaFD/data. To preprocess the dataset, run the following command:

$ python preprocess_rafd.py

This will crop all images to 256x256 (centred on face) and split the data into 90% for training and 10% for testing.

3. Training

The command format for training MatchGAN is given by:

$ ./run [dataset] [mode] [labelled percentage] [device]

For example, to train MatchGAN on CelebA with 5% of the training examples labelled on GPU 0, run the following command:

$ ./run celeba train 5 0

To train on RaFD, simply replace "celeba" by "rafd".

4. Testing and evaluating

To test MatchGAN following the above example on CelebA, run the command

$ ./run celeba test 5 0

This will generate synthetic images from the test set and save them to the directory ./matchgan_celeba/results.

To evaluate the model using Frechet Inception Distance (FID), Inception Score (IS), and GAN-test, run the following command:

$ ./run celeba eval 5 0

The following commands trains an external classifier using the synthetic images generated by MatchGAN and then evaluates GAN-train.

$ ./run celeba synth 5 0
$ ./run celeba synth_test 5 0

5. Pretrained model

Pretrained models of MatchGAN (generator only) can be downloaded from this link. To test or evaluate these models, the checkpoint file 200000-G.ckpt should be placed under the directory ./matchgan_celeba/models (for CelebA) or ./matchgan_rafd/models (for RaFD) before running the relevant commands detailed above.

6. Results

Here are some of the results of our pre-trained model from the previous section.

FID

Percentage of training data labelled 1% 5% 10% 20% 50% 100%
CelebA 12.31 9.34 8.81 6.34 - 5.58
RaFD - - 22.75 9.94 6.65 5.06

IS

Percentage of training data labelled 1% 5% 10% 20% 50% 100%
CelebA 2.95 2.95 2.99 3.03 - 3.07
RaFD - - 1.64 1.61 1.59 1.58

GAN-train and GAN-test

These numbers are obtained under the 100% setup.

GAN-train GAN-test
CelebA 87.43% 82.26%
RaFD 97.78% 75.95%
Owner
Justin Sun
PhD student
Justin Sun
Modeling Temporal Concept Receptive Field Dynamically for Untrimmed Video Analysis

Modeling Temporal Concept Receptive Field Dynamically for Untrimmed Video Analysis This is a PyTorch implementation of the model described in our pape

qzhb 6 Jul 08, 2021
A toolset for creating Qualtrics-based IAT experiments

Qualtrics IAT Tool A web app for generating the Implicit Association Test (IAT) running on Qualtrics Online Web App The app is hosted by Streamlit, a

0 Feb 12, 2022
This repo in the implementation of EMNLP'21 paper "SPARQLing Database Queries from Intermediate Question Decompositions" by Irina Saparina, Anton Osokin

SPARQLing Database Queries from Intermediate Question Decompositions This repo is the implementation of the following paper: SPARQLing Database Querie

Yandex Research 20 Dec 19, 2022
Image Data Augmentation in Keras

Image data augmentation is a technique that can be used to artificially expand the size of a training dataset by creating modified versions of images in the dataset.

Grace Ugochi Nneji 3 Feb 15, 2022
Learning RGB-D Feature Embeddings for Unseen Object Instance Segmentation

Unseen Object Clustering: Learning RGB-D Feature Embeddings for Unseen Object Instance Segmentation Introduction In this work, we propose a new method

NVIDIA Research Projects 132 Dec 13, 2022
A U-Net combined with a variational auto-encoder that is able to learn conditional distributions over semantic segmentations.

Probabilistic U-Net + **Update** + An improved Model (the Hierarchical Probabilistic U-Net) + LIDC crops is now available. See below. Re-implementatio

Simon Kohl 498 Dec 26, 2022
A Dataset for Direct Quotation Extraction and Attribution in News Articles.

DirectQuote - A Dataset for Direct Quotation Extraction and Attribution in News Articles DirectQuote is a corpus containing 19,760 paragraphs and 10,3

THUNLP-MT 9 Sep 23, 2022
KDD CUP 2020 Automatic Graph Representation Learning: 1st Place Solution

KDD CUP 2020: AutoGraph Team: aister Members: Jianqiang Huang, Xingyuan Tang, Mingjian Chen, Jin Xu, Bohang Zheng, Yi Qi, Ke Hu, Jun Lei Team Introduc

96 May 30, 2022
Colossal-AI: A Unified Deep Learning System for Large-Scale Parallel Training

ColossalAI An integrated large-scale model training system with efficient parallelization techniques. arXiv: Colossal-AI: A Unified Deep Learning Syst

HPC-AI Tech 7.9k Jan 08, 2023
Invert and perturb GAN images for test-time ensembling

GAN Ensembling Project Page | Paper | Bibtex Ensembling with Deep Generative Views. Lucy Chai, Jun-Yan Zhu, Eli Shechtman, Phillip Isola, Richard Zhan

Lucy Chai 93 Dec 08, 2022
meProp: Sparsified Back Propagation for Accelerated Deep Learning (ICML 2017)

meProp The codes were used for the paper meProp: Sparsified Back Propagation for Accelerated Deep Learning with Reduced Overfitting (ICML 2017) [pdf]

LancoPKU 107 Nov 18, 2022
Finite-temperature variational Monte Carlo calculation of uniform electron gas using neural canonical transformation.

CoulombGas This code implements the neural canonical transformation approach to the thermodynamic properties of uniform electron gas. Building on JAX,

FermiFlow 9 Mar 03, 2022
Unofficial implementation of "Coordinate Attention for Efficient Mobile Network Design"

Unofficial implementation of "Coordinate Attention for Efficient Mobile Network Design". CoordAttention tensorflow slim

Billy 9 Aug 22, 2022
This is the second place solution for : UmojaHack Africa 2022: African Snake Antivenom Binding Challenge

UmojaHack-Africa-2022-African-Snake-Antivenom-Binding-Challenge This is the second place solution for : UmojaHack Africa 2022: African Snake Antivenom

Mami Mokhtar 10 Dec 03, 2022
Efficient Multi Collection Style Transfer Using GAN

Proposed a new model that can make style transfer from single style image, and allow to transfer into multiple different styles in a single model.

Zhaozheng Shen 2 Jan 15, 2022
Official Repository for "Robust On-Policy Data Collection for Data Efficient Policy Evaluation" (NeurIPS 2021 Workshop on OfflineRL).

Robust On-Policy Data Collection for Data-Efficient Policy Evaluation Source code of Robust On-Policy Data Collection for Data-Efficient Policy Evalua

Autonomous Agents Research Group (University of Edinburgh) 2 Oct 09, 2022
Model serving at scale

Run inference at scale Cortex is an open source platform for large-scale machine learning inference workloads. Workloads Realtime APIs - respond to pr

Cortex Labs 7.9k Jan 06, 2023
This project uses Template Matching technique for object detecting by detection of template image over base image.

Object Detection Project Using OpenCV This project uses Template Matching technique for object detecting by detection the template image over base ima

Pratham Bhatnagar 7 May 29, 2022
Python package provinding tools for artistic interactive applications using AI

Documentation redrawing Python package provinding tools for artistic interactive applications using AI Created by ReDrawing Campinas team for the Open

ReDrawing Campinas 1 Sep 30, 2021
Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy" (ICLR 2022 Spotlight)

About Code release for Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy (ICLR 2022 Spotlight)

THUML @ Tsinghua University 221 Dec 31, 2022