Skip to content
HelioMesquitaPublic

About

On-device face liveness detection and recognition for iOS using Apple's Vision framework — no cloud, no third-party SDKs

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BioProof

On-device face liveness detection and recognition for iOS using Apple's Vision framework — no cloud, no third-party SDKs.


What is BioProof?

BioProof is an iOS app that proves a user is a real, live person — not a photo or a video — and identifies who they are, all processed entirely on-device.

It was built as a university project to explore Apple's Vision framework and biometric concepts such as facial landmark detection, liveness challenges, and face matching.


How it works

Registration

The user registers their face by positioning it in front of the camera. The app captures facial landmarks across six regions and stores them locally. Before saving, it validates that all regions are fully detected to ensure a complete and consistent baseline.

Liveness Detection

When verifying a user, BioProof runs a sequence of challenges to confirm the person is physically present:

  • Look Straight - detected via yam and pitch angle
  • Turn head left — detected via yaw angle
  • Turn head right — detected via yaw angle
  • Look Up — detected via pitch angle
  • Blink 5 times — detected via Eye Aspect Ratio (EAR)

Only after passing all challenges does the app attempt to identify the person.

Face Matching

After liveness is confirmed with the face looking straight at the camera, BioProof compares the detected landmarks against all registered users using Euclidean distance between normalized landmark points. The closest match below a configurable threshold is returned as the identified person.


Tech stack

  • Swift — 100% native, no third-party dependencies
  • Vision — VNDetectFaceLandmarksRequest and VNDetectFaceRectangleRequest for landmark detection, bounding box, and yaw
  • AVFoundation — camera session management and real-time frame capture
  • UserDefaults — lightweight local storage for registered face records (university project scope)

Key concepts

Normalized landmarks — all facial points are stored as normalized coordinates (0 to 1) relative to the bounding box, making them scale-invariant. The same face registered close to or far from the camera produces the same stored values.

Eye Aspect Ratio (EAR) — a ratio between the vertical and horizontal distances of eye landmark points. When the eye closes, the vertical distance approaches zero and EAR drops below a threshold (~0.2). A blink is counted on the transition from closed back to open, preventing multiple counts per blink.

AspectFill coordinate conversion — the camera preview uses .resizeAspectFill, which crops the buffer to fill the screen. All Vision coordinates are converted to screen coordinates accounting for this scale and offset, so bounding boxes and landmark points align precisely with what the user sees.


Requirements

  • iOS 17+
  • iPhone with front-facing camera
  • Xcode 16+

Limitations

This project was built for academic purposes and is not intended for production use. The face matching is based on simple Euclidean distance between 2D normalized points and does not provide the security guarantees of a production biometric system. Matching accuracy may vary depending on lighting, angle, and distance from the camera.


License

MIT

About

On-device face liveness detection and recognition for iOS using Apple's Vision framework — no cloud, no third-party SDKs

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages