How to differentiate a live person infront of Web Cam to a Photo of person

For an attendance project, How can I differentiate Live person infront of web cam to showing a photo of the person. How do we do that? Any ideas is appreciated