wy1iu / sphereface

Implementation for <SphereFace: Deep Hypersphere Embedding for Face Recognition> in CVPR'17.
MIT License
1.59k stars 542 forks source link

Why do pixel normalization? #115

Open Chrgo opened 6 years ago

Chrgo commented 6 years ago

A quite simple question, why normalize pixels with (img - 127.5)/128? I didn't find any useful information. Can anyone help me? Thanks.

wy1iu commented 5 years ago

It is a standard data processing procedure. I think it is used not only in deep neural nets. Imagine a simple case where you just classify two points in 2D space, if you don't do such normalization, they will just lie in the positive domain, which limits the learning space of the decision boundary and incorporates unnecessary bias.

johnnysclai commented 5 years ago

I think @Chrgo is asking why (img - 127.5)/128 is used, instead of (img - 127.5)/127.5.

wy1iu commented 5 years ago

@johnnysclai I don’t think it really matters. As long as your testing and training are consistent, you will be fine.