All Projects → mattans → Ageprogression

mattans / Ageprogression

Projects that are alternatives of or similar to Ageprogression

Lstm chem
Implementation of the paper - Generative Recurrent Networks for De Novo Drug Design.
Stars: ✭ 87 (-1.14%)
Mutual labels:  jupyter-notebook
P5 vehicledetection unet
p5_VehicleDetection_Unet
Stars: ✭ 87 (-1.14%)
Mutual labels:  jupyter-notebook
Fcos tensorflow
FCOS: Fully Convolutional One-Stage Object Detection.
Stars: ✭ 87 (-1.14%)
Mutual labels:  jupyter-notebook
Curso data science
Código para el curso "Aprende Data Science y Machine Learning con Python"
Stars: ✭ 87 (-1.14%)
Mutual labels:  jupyter-notebook
Calogan
Generative Adversarial Networks for High Energy Physics extended to a multi-layer calorimeter simulation
Stars: ✭ 87 (-1.14%)
Mutual labels:  jupyter-notebook
Deprecated Boot Camps
DEPRECATED: please see individual lesson repositories for current material.
Stars: ✭ 87 (-1.14%)
Mutual labels:  jupyter-notebook
Airbnb Dynamic Pricing Optimization
[BA project] Dynamic Pricing Optimization for Airbnb listing to optimize yearly profit for host. Use Clustering for competitive analysis, kNN regression for demand forecasting, and find dynamic optimal price with Optimization model.
Stars: ✭ 85 (-3.41%)
Mutual labels:  jupyter-notebook
Intro2musictech
公众号“无痛入门音乐科技”开源代码
Stars: ✭ 88 (+0%)
Mutual labels:  jupyter-notebook
Game Theory And Python
Game Theory and Python, a workshop investigating repeated games using the prisoner's dilemma
Stars: ✭ 87 (-1.14%)
Mutual labels:  jupyter-notebook
Spark Nlp Models
Models and Pipelines for the Spark NLP library
Stars: ✭ 88 (+0%)
Mutual labels:  jupyter-notebook
Simple Qa Emnlp 2018
Code for my EMNLP 2018 paper "SimpleQuestions Nearly Solved: A New Upperbound and Baseline Approach"
Stars: ✭ 87 (-1.14%)
Mutual labels:  jupyter-notebook
Gym trading
Stars: ✭ 87 (-1.14%)
Mutual labels:  jupyter-notebook
Repo2docker Action
GitHub Action for repo2docker
Stars: ✭ 88 (+0%)
Mutual labels:  jupyter-notebook
Few Shot Text Classification
Code for reproducing the results from the paper Few Shot Text Classification with a Human in the Loop
Stars: ✭ 87 (-1.14%)
Mutual labels:  jupyter-notebook
Stanford Project Predicting Stock Prices Using A Lstm Network
Stanford Project: Artificial Intelligence is changing virtually every aspect of our lives. Today’s algorithms accomplish tasks that until recently only expert humans could perform. As it relates to finance, this is an exciting time to adopt a disruptive technology that will transform how everyone invests for generations. Models that explain the returns of individual stocks generally use company and stock characteristics, e.g., the market prices of financial instruments and companies’ accounting data. These characteristics can also be used to predict expected stock returns out-of-sample. Most studies use simple linear models to form these predictions [1] or [2]. An increasing body of academic literature documents that more sophisticated tools from the Machine Learning (ML) and Deep Learning (DL) repertoire, which allow for nonlinear predictor interactions, can improve the stock return forecasts [3], [4] or [5]. The main goal of this project is to investigate whether modern DL techniques can be utilized to more efficiently predict the movements of the stock market. Specifically, we train a LSTM neural network with time series price-volume data and compare its out-of-sample return predictability with the performance of a simple logistic regression (our baseline model).
Stars: ✭ 88 (+0%)
Mutual labels:  jupyter-notebook
Deep Learning Notes
Experiments with Deep Learning
Stars: ✭ 1,278 (+1352.27%)
Mutual labels:  jupyter-notebook
Faster Rcnn Densecap Torch
Faster-RCNN based on Densecap(deprecated)
Stars: ✭ 87 (-1.14%)
Mutual labels:  jupyter-notebook
Magnet
MAGNet: Multi-agents control using Graph Neural Networks
Stars: ✭ 88 (+0%)
Mutual labels:  jupyter-notebook
Smiles Transformer
Original implementation of the paper "SMILES Transformer: Pre-trained Molecular Fingerprint for Low Data Drug Discovery" by Shion Honda et al.
Stars: ✭ 86 (-2.27%)
Mutual labels:  jupyter-notebook
Samplevae
Multi-purpose tool for sound design and music production implemented in TensorFlow.
Stars: ✭ 88 (+0%)
Mutual labels:  jupyter-notebook

PyTorch Implementation of Age Progression/Regression by Conditional Adversarial Autoencoder

As a participant of the 2018 Workshop in Machine Learning Applications for Computer Graphics (Cohen-Or, Fogel), I was exposed to many interesting ideas in the fields of artificial intelligence and computer vision, such as variational autoencoders (VAE) and deep convolutional generative adversarial networks (DCGAN). In the latter part of the course, I was asked to choose a paper to study and implement. Skimming through articles, I discovered an interesting paper from CVPR 2017, titled Age Progression/Regression by Conditional Adversarial Autoencoder (Zhang, Song, et al.). The article presented a method to performage modification on a given face image, with exciting utilization from recreational applications to assist the searches of missing children. A complete review of the project can be seen here.

System Architecture

The system architecture was written in Python 3.7 and PyTorch 0.4.1, with attempts to keep the code ascompatible as possible with older versions of Python 3 and PyTorch. Other external packages that wereused are NumPy, scikit-learn, OpenCV, imageio and Matplotlib.

The network is comprised of an encoder which transforms RGB images to Z vectors (vectors in a latent space), a generator which transforms vectors to RGB images, a discriminator that measures (and forces) uniform distribution on the encoder's output and a discriminator that measures (and forces) realistic properties on the generator's output.

Encoder

Encoder with 5 convolutional layers and a fully connected layer. Viewing from left to right, faceimages of dimensions 128x128x3 are transformed into unlabeled Z vectors of size 50 in a latent space. alt

Generator

Generator with 7 deconvolutional layers and a fully connected layer. Viewing from left to right,labeled Z vectors of size 70 in a latent space are transformed into face images of dimensions 128x128x3. alt

Descriminators:

Discriminator on Z with 4 fully connected layers. alt

Discriminator on images with 4 convolutional layers and 2 fully connected layers. alt

Prerequisites

  • Python 3.7
  • PyTorch 0.4.1
  • Python data science and graphic packages: NumPy, scikit-learn, OpenCV, imageio and Matplotlib

Training

For training, the UTKFace dataset is used, which was collected by the original authors of the article and tested in their implementation. UTKFace contains over 20,000 aligned and cropped face images withtheir appropriate labels. A special utility was written, the UTKFace Labeler, which sorts the dataset images to separated folders based on the label, to match with PyTorch demands that classes are determined by folders structure.

Before training, one random batch of images is separated from the dataset and used for validation, meaning that the network does not back propagate losses on it. the losses on the validation batch are expected to decrease at each epoch similarly to their change in the rest of the dataset. After every epoch, an image comparing the original validation images with the reconstructed images is saved to the epoch's folder, allowing a human eye to monitor the training session. An example can be seen here:

alt

Original images are on the right and generated images are on the left. It can be seen that centered, frontal images with natural postures reconstruct more accurately than others. Also, rare objects such as glasses, jewelry and watermarks are subdued.

At the end of each epoch, all of the calculated losses are passed to a class I designed, called Loss Tracker. The loss tracker object produces graphs of the changes in losses over epochs and saves them, again to allow a human to analyze and verify the training session. The loss tracker object also enables pre-programmed heuristics to address issues such as overfitting, underfitting, unknown fitting, and drift. It is also possible to watch the graphs update in a new window during training. An example can be seen here:

alt

To start a training session run main.py --mode train <num of epochs> --input <dataset path> --output <results path>

For the full list of options for the training session run main.py --help

Applications

A few applications were developed over Jupyter Notebook to test the system with the trained models interactively. As inputs, users can choose between already labeled images from UTKFace, to observe the results with regard to parameters such as age, gender, and race. The applications, referred as Games, can be seen further down this section.

The Aging Game. An input image is fed to the encoder, and the resulted Z vector is fed to the generator ten times, each time with the true gender and a different age group. Then, the original image is presented next to all of the output images. The output images can be seen as the aging process of a person, from childhood to old age. The original image and the generated image of the same age group are marked in a white rectangle, for comparison.

alt

The Morph Game. Two input images are fed to the encoder, and the resulted Z vectors are concatenated with their true labels. Then, a set of vectors is created, with a gradual change from the first vector to the second vector, . The set of vectors is fed to the generator. The output images can be seen as a morphing process from one person to another, where not only the personality features change but also age and gender, allowing to examine concepts such as immediate age transition between age groups and gender fluidity.

alt

The Kids Game. Two input images are fed to the encoder. Then, per each index of the Z vectors, a random float is generated uniformly in the semi-open range , and a new Z vector element is generated by , so that a new Z vector is created and each of its features contains a mixture of the first and second images' features. This process repeats for times so that assemblies of new random Z vectors are produced. These vectors are then concatenated with labels of the youngest age group and a random gender per each vector. Then, the vectors are fed to the generator. The output images can be seen as the potentially shared offsprings of the two people in the input images.

alt

Author

  • Mattan Serry

License

This project is licensed under the MIT License.

Acknowledgments

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].