--- license: mit language: - en --- # Hyp-OC Model Card
[**Project Page**](https://kartik-3004.github.io/hyp-oc/) **|** [**Paper (ArXiv)**](https://arxiv.org/pdf/2404.14406.pdf) **|** [**Code**](https://github.com/Kartik-3004/hyp-oc)
## Introduction Hyp-OC, is the first work exploring hyperbolic embeddings for one-class face anti-spoofing (OC-FAS). We show that using hyperbolic space helps learn a better decision boundary than the Euclidean counterpart, boosting one-class face anti-spoofing performance.
## Training Framework
Overview of the proposed pipeline: Hyp-OC. The encoder extracts facial features which are used to estimate the mean of Gaussian distribution utilized to sample pseudo-negative points. The real features and pseudo-negative features are then concatenated and passed to FCNN for dimensionality reduction. The low-dimension features are mapped to Poincaré Ball using *exponential map*. The training objective is to minimize the summation of the proposed loss functions Hyp-PC} and Hyp-CE. The result is a separating *gyroplane* beneficial for one-class face anti-spoofing. ## Usage The pre-trained weights can be downloaded directly from this repository or using python: ```python from huggingface_hub import hf_hub_download hf_hub_download(repo_id="kartiknarayan/hyp-oc", filename="pretrained_weights/vgg_face_dag.pth", local_dir="./") hf_hub_download(repo_id="kartiknarayan/hyp-oc", filename="weights/CASIA_MFSD/casia_mfsd/best_epoch.pth", local_dir="./") hf_hub_download(repo_id="kartiknarayan/hyp-oc", filename="weights/OULU_NPU/oulu_npu/best_epoch.pth", local_dir="./") hf_hub_download(repo_id="kartiknarayan/hyp-oc", filename="weights/ROSEYoutu/rose_youtu/best_epoch.pth", local_dir="./") hf_hub_download(repo_id="kartiknarayan/hyp-oc", filename="weights/ReplayAttack/replayattack/best_epoch.pth", local_dir="./") hf_hub_download(repo_id="kartiknarayan/hyp-oc", filename="weights/ICM/icm/best_epoch.pth", local_dir="./") hf_hub_download(repo_id="kartiknarayan/hyp-oc", filename="weights/OCI/oci/best_epoch.pth", local_dir="./") hf_hub_download(repo_id="kartiknarayan/hyp-oc", filename="weights/OCM/ocm/best_epoch.pth", local_dir="./") hf_hub_download(repo_id="kartiknarayan/hyp-oc", filename="weights/OMI/omi/best_epoch.pth", local_dir="./") ``` ## Citation ```bibtex @inproceedings{narayan2024hyp, title={Hyp-oc: Hyperbolic one class classification for face anti-spoofing}, author={Narayan, Kartik and Patel, Vishal M}, booktitle={2024 IEEE 18th International Conference on Automatic Face and Gesture Recognition (FG)}, pages={1--10}, year={2024}, organization={IEEE} } ``` Please check our [GitHub repository](https://github.com/Kartik-3004/hyp-oc) for complete instructions.