< Deeplarning > Understand Backpropagation of RNN/GRU and Implement It in Pure Python---1

< Deeplarning > Understand Backpropagation of RNN/GRU and Implement It in Pure Python---1

Understanding GRU

As we know, RNN has the disadvantage of gradient vanishing(and gradient exploding). GRU/LSTM is invented to prevent gradient vanishing, because more early information could be encoded in the late steps.

Just similarly to residual structure in CNN, GRU/LSTM could be treated as a RNN model with residual block. That is to say that former hidden states is identically added to the newly computed hidden state(with a gate).
For more details about GRU structure, you could check my former blog.

Read more
< Deeplearning > Use CNN and RNN to detect blink in a video

< Deeplearning > Use CNN and RNN to detect blink in a video

Let’s do it!

If you use your face to pay a sum of money by ALIPAY, you may find that it sometimes requires you to do some facial movement to check whether you are a real person or not.

So as you see, facial motion detection is actually being used in many circumstances. You may want to figure out how to detect facial motion.

In this post, I will take motion blink as a example to demonstrate how to do realize it.

So Let’s do it.

Read more

< Network > Understanding DepthWiseConv

Some knowledge about DepthWiseConv

As we all know, people invent DepthWiseConv for more efficient computation cost without accuracy loss.

DepthwiseConv coupled with PointWiseConv could be equal to normal convlution.

DepthWiseConv means that we assign a single kernel to each feature channel. PointWiseConv is a normal convolution kernel with kernel size 1 and stride 1.

DepthWiseConv aims to extract the spatial feature of a feature map, while PointWiseConv aims to extracte the correlation of different feature maps.

Read more

< Tensorflow >How dose TensorFlow do Quant Aware Training?

Let firstly simplify the Quant process in TF

Overview

1
S_a1(q_a1 + Z_a1) = S_w1(q_w1 + Z_w1) * S_a0(q_a0 + Z_a0)
  • q_a1: Quanted activation value in layer 1

  • S_a1, Z_a1: Estimated scale and zero point in layer 1

  • q_w1: Quanted weight in layer 1

  • S_w1, Z_w1: Statistical scale and zero point in layer 1

  • q_a0: Quanted activation value in layer 0

  • S_a0, Z_a0: Estimated scale and zero point in layer 0

As we can see, in order to compute q_a1(Quanted activation value in layer 1), we have to get S_w1, Z_w1, S_a0, Z_a0, q_a1, Z_a1. To get S_w1/Z_w1 is simple, we can get the Statistical maximum of the weights in each layer we want. The only tricky thing is how to get S_a1/Z_a1/S_a0/Z_a0, which have to be estimated from the training data.

Read more
< Antispoofing > Multi-Task-Learning in Face Antispoofing

< Antispoofing > Multi-Task-Learning in Face Antispoofing

Is Face Antispoofing only a binary classification task?

Of course, we can consider face antispoofing as a binary classification task. We can train a classifier to distinguish a face image between liveness and fake.

It may work well but it can not fully use all information of the input face image. In order to push the limit of our trained data and trained classifier, we have to cultivate other information that could help us to better discriminate an attack face.

Read more
< DeepLearning > The Support Vectors in DeepLearning

< DeepLearning > The Support Vectors in DeepLearning

Dose DeepLearning has ‘Support Vectors’?

As we all know, support vectors is a notation in SVM(Support Vector Machine). Support vectors means that the data points in the decision boundary(the Maximum Margin in SVM) are very important in a classification algorithm.

We can train a SVM only with the ‘Support Vectors’ and can achieve the same accuracy with models trained with more data. So does the ‘Support Vectors’ exists in DeepLearning?

Read more

< Antispoofing > Data Augmentation in Face Antispoofing

How dose people spoof a digital device with face recognition

To attack a image recognition system is easy. Even to change a single pixel could successfully let the recognition system lose efficiency. So people would use the loophole to simulate a set of fake images to spoof the face recognition system.

So in order to defense the spoofing, we should simulate all the possible attacking conditions in the real life with limited training dataset.

Read more

< Antispoofing > Does we should align face in Face Antispoofing

Align or not, Texture or shape

Relationship with Face Recognition(FR)

The aim of Face Recognition is to shorten the distance of one person from different scene, even from different medium. For example, FR should shorten the distance between the person in real life and the person’s picture in paper or tv or phone.

However, Face Antispoofing(FA) just did the opposite thing.

FA should shorten the person from the same medium. FA should shroten the distance between the two different real persons. And FA should widen the distance of the people from different medium, even the two persons are the same.
So as we can see, to differentiate medium is the key of FA.

Read more

< Tensorflow > Data flow in Tensorflow

Using data queue to read data(abandoned, not support in future Tensorflow version)

If you store you data in traditional hard disk, I suggest you read data through the data format of tfrecord. However, if you store your data in solid state drives , I suggest that you read by FIFO Queue to directly read image by its root.
Firstly, you have to set up a FIFO Queue:

Read more