I have worked all my life in Machine Learning, and I've never seen one algorithm knock over its benchmarks like Deep Learning - Andrew Ng
This repository includes deep learning based project implementations I've done from scratch. You can find both the source code and documentation as a step by step tutorial. Model structrues and pre-trained weights are shared as well.
PS: This repository is updated regularly. You should pull the repo if you forked.
1- Facial Expression Recognition Code
, Tutorial
This is a custom CNN model. Kaggle FER 2013 data set is fed to the model. This model runs fast and produces satisfactory results.
2- Real Time Facial Expression Recognition Code
, Tutorial
, Video 1
, Video 2
This is the adaptation of the same model to real time video or web cam. OpenCV's haar cascade module detects the face and we applied facial expression recoginition to detected face.
3- Face Recognition With Oxford VGG-Face Model Code
, Tutorial
Oxford Visual Geometry Group's VGG model is famous for confident scores on Imagenet contest. They retrain almost the same network structure for face recognition. Pre-trained weights are converted from Matlab to Keras. This implementation is mainly based on convolutional neural networks, autoencoders and transfer learning. This is on the top of the leaderboard for face recognition challenges.
4- Real Time Deep Face Recognition Implementation with VGG-Face Code
, Video
This is the real time implementation of VGG-Face model for face recognition.
5- Face Recognition with Google FaceNet Model Code
, Tutorial
, Real Time Code
, Video
This is an alternative to Oxford VGG model. My experiments show that it runs faster than VGG-Face but it is less accurate even though FaceNet has a more complex structure. Pre-trained weights are converted from TensorFlow in the study of David Sandberg to Keras. Besides, model construction is mainly based on the study of Yu-Yang Huang.
6- Face Recognition with OpenFace Model Code
, Tutorial
, Real Time Code
, Video
OpenFace is a lightweight model for face recognition tasks. It is not the best but it is the fastest. Original study shared the pre-trained weights in Lua Torch format. On the other hand, this repository is shared the pre-trained weights in a flat file. I build the OpenFace model in Keras based on these sources.
7- Apparent Age and Gender Prediction Code for age
, Code for gender
, Tutorial
We've used VGG-Face model for apparent age prediction this time. We actually applied transfer learning. Locking the early layers' weights enables to have outcomes fast.
This study is mainly based on this study. However, this study shared pre-trained weights in Caffe and use VGG model. I adapt VGG-Face instead of VGG and train the model from scratch.
8- Real Time Age and Gender Prediction Code
, Video
This is a real time apparent age and gender prediction implementation
9- Celebrity You Look-Alike Face Recognition Code
, Tutorial
Applying VGG-Face recognition technology for imdb data set will find your celebrity look-alike if you discard the threshold in similarity score.
10- Real Time Celebrity Look-Alike Face Recognition Code
, Video
This is the real time implementation of finding similar celebrities.
11- Race and Ethnicity Prediction
Tutorial
, AI Ethics Tutorial
, Code
, Real Time Code
, Video
Ethnicity is a facial attribute as well and we can predict it from facial photos similiar to Age and Gender. We customize VGG-Face and applied transfer learning to classify 6 different race and ethnicity groups. FairFace data set is fed to the network to train.
12- Beauty Score Prediction Tutorial
, Code
South China University of Technology published a research paper about facial beauty prediction. They also open-sourced the data set. 60 labelers scored the beauty of 5500 people. We will build a regressor to find facial beauty score. We will also test the built regressor on a huge imdb data set to find the most beautiful ones.
13- Making Arts with Deep Learning: Artistic Style Transfer Code
, Tutorial
, Video
What if Vincent van Gogh had painted Istanbul Bosporus? Today we can answer this question. A deep learning technique named artistic style transfer enables to transform ordinary images to masterpieces.
14- Autoencoder and clustering Code
, Tutorial
We can use neural networks to represent data. If you design a neural networks model symmetric about the centroid and you can restore a base data with an acceptable loss, then output of the centroid layer can represent the base data. Representations can contribute any field of deep learning such as face recognition, style transfer or just clustering.
15- Convolutional Autoencoder and clustering Code
, Tutorial
We can adapt same representation approach to convolutional neural networks, too.
16- Transfer Learning: Consuming InceptionV3 to Classify Cat and Dog Images in Keras Code
, Tutorial
We can have the outcomes of the other researchers effortlessly. Google researchers compete on Kaggle Imagenet competition. They got 97% accuracy. We will adapt Google's Inception V3 model to classify objects.
17- Handwritten Digit Classification Using Neural Networks Code
, Tutorial
We had to apply feature extraction on data sets to use neural networks. Deep learning enables to skip this step. We just feed the data, and deep neural networks can extract features on the data set. Here, we will feed handwritten digit data (MNIST) to deep neural networks, and expect to learn digits.
18- Handwritten Digit Recognition Using Convolutional Neural Networks with Keras Code
, Tutorial
Convolutional neural networks are close to human brain. People look for some patterns in classifying objects. For example, mouth, nose and ear shape of a cat is enough to classify a cat. We don't look at all pixels, just focus on some area. Herein, CNN applies some filters to detect these kind of shapes. They perform better than conventional neural networks. Herein, we got almost 2% accuracy than fully connected neural networks.
19- Automated Machine Learning and Auto-Keras for Image Data Code
, Model
, Tutorial
AutoML concept aims to find the best network structure and hyper-parameters. Here, I've applied AutoML to facial expression recognition data set. My custom design got 57% accuracy whereas AutoML found a better model and got 66% accuracy. This means almost 10% improvement in the accuracy.
20- Explaining Deep Learning Models with SHAP Code
, Tutorial
SHAP explains black box machine learning models and makes them transparent, explainable and provable.
21- Gradient Vanishing Problem Code
Tutorial
Why legacy activation functions such as sigmoid and tanh disappear on the pages of the history?
22- How single layer perceptron works Code
This is the 1957 model implementation of the perceptron.
I have tested this repository on the following environments. To avoid environmental issues, confirm your environment is same as below.
C:\>python --version
Python 3.6.4 :: Anaconda, Inc.
C:\>activate tensorflow
(tensorflow) C:\>python
Python 3.5.5 |Anaconda, Inc.| (default, Apr 7 2018, 04:52:34) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> print(tf.__version__)
1.9.0
>>>
>>> import keras
Using TensorFlow backend.
>>> print(keras.__version__)
2.2.0
>>>
>>> import cv2
>>> print(cv2.__version__)
3.4.4
To get your environment up from zero, you can follow the instructions in the following videos.
Installing TensorFlow and Prerequisites Video
Installing Keras Video
This repo might use some external sources. Notice that related tutorial links and comments in the code blocks cite references already.
There are many ways to support a project - starring the GitHub repos is one.
This repository is licensed under MIT license - see LICENSE
for more details