The most face detection systems these days work with a version of the Viola & Jones algorithm. You can find many papers on this topic. For example this one:
http://www.cs.ubc.ca/~lowe/425/slides/13-ViolaJones.pdf[
^]
If you use openCV you can use the provided face detector there which is also based on the Viola & Jones algorithm. It works pretty robust in different settings but it is not perfect (no face localisation is). But if you can develop a better face detection system then this you may become very popular ;)