What is the name of algorithm to Face Recognition

I work on assignments in my college to make attendance systems but when I am using my photo, my algorithm still can detect me. What is the algorithm that can make me just detect faces in live people, not photos?

First you need to define what the differences are between videos and still images.
Then you design a system that addresses the difference.

Sometimes there are problems that an algorithm cannot solve by itself. You may need to constrain or re-define the problem.