You can detect head gestures like nodding and head shaking by tracking HeadPose changes in real time. You can use this feature as a custom liveness detector. Reference https://learn.microsoft.com/en-us/azure/cognitive-services/computer-vision/how- to/use-headpose