Instructions to use mancooper/FaceAuthenticator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use mancooper/FaceAuthenticator with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://mancooper/FaceAuthenticator") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,43 +1,81 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
license: mit
|
| 3 |
metrics:
|
| 4 |
-
- accuracy
|
| 5 |
library_name: keras
|
| 6 |
language:
|
| 7 |
-
- en
|
| 8 |
pipeline_tag: image-classification
|
| 9 |
tags:
|
| 10 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
Model
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
The model
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
βββ train
|
| 42 |
β βββ fake
|
| 43 |
β βββ real
|
|
@@ -46,8 +84,51 @@ The model has been trained on a dataset containing facial images labelled for au
|
|
| 46 |
β βββ fake
|
| 47 |
β βββ real
|
| 48 |
βββ valid.csv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
|
| 51 |
-
π Training Hyperparameters
|
| 52 |
-
Training regime: VGG16 with 10 epochs
|
| 53 |
-
Accuracy: Approximately 82%
|
|
|
|
| 1 |
---
|
| 2 |
+
---
|
| 3 |
license: mit
|
| 4 |
metrics:
|
| 5 |
+
- accuracy
|
| 6 |
library_name: keras
|
| 7 |
language:
|
| 8 |
+
- en
|
| 9 |
pipeline_tag: image-classification
|
| 10 |
tags:
|
| 11 |
+
- face-detection
|
| 12 |
+
- deepfake-detection
|
| 13 |
+
- image-classification
|
| 14 |
+
- vgg16
|
| 15 |
+
- yolo
|
| 16 |
---
|
| 17 |
+
|
| 18 |
+
# FaceAuthenticator.keras
|
| 19 |
+
|
| 20 |
+
## Model Card
|
| 21 |
+
|
| 22 |
+
### Model Details
|
| 23 |
+
|
| 24 |
+
- **Model Name:** FaceAuthenticator.keras
|
| 25 |
+
- **Developer:** Prathmesh Patil
|
| 26 |
+
- **Model Architecture:** VGG16-based Convolutional Neural Network (CNN)
|
| 27 |
+
- **Face Detection:** YOLO (You Only Look Once)
|
| 28 |
+
- **Model Framework:** Keras
|
| 29 |
+
- **License:** MIT
|
| 30 |
+
- **Task:** Face detection and real/fake face image classification
|
| 31 |
+
|
| 32 |
+
### Model Description
|
| 33 |
+
|
| 34 |
+
FaceAuthenticator.keras is a deep learning model designed to classify facial images as real or fake. It combines YOLO-based face detection with a VGG16-based convolutional neural network for image classification.
|
| 35 |
+
|
| 36 |
+
The YOLO model identifies and localizes faces in an input image. The detected facial regions are then processed by the VGG16-based classifier to predict whether the face is real or fake.
|
| 37 |
+
|
| 38 |
+
The system is intended for applications involving facial image verification and preliminary deepfake detection.
|
| 39 |
+
|
| 40 |
+
### Intended Use
|
| 41 |
+
|
| 42 |
+
**Direct Use**
|
| 43 |
+
|
| 44 |
+
The model can be used to detect faces in images and classify detected facial regions as real or fake, provided that the input format and preprocessing match the model's requirements.
|
| 45 |
+
|
| 46 |
+
**Downstream Use**
|
| 47 |
+
|
| 48 |
+
Potential applications include:
|
| 49 |
+
- Preliminary deepfake image detection.
|
| 50 |
+
- Facial image authenticity analysis.
|
| 51 |
+
- Integration into image verification tools.
|
| 52 |
+
- Educational and research projects involving computer vision.
|
| 53 |
+
|
| 54 |
+
**Out-of-Scope Use**
|
| 55 |
+
|
| 56 |
+
The model is not intended to establish a person's identity or determine whether an individual is authorized to access a system. It should not be used as the sole basis for security-critical decisions, identity verification, or other high-impact applications.
|
| 57 |
+
|
| 58 |
+
### Model Architecture
|
| 59 |
+
|
| 60 |
+
The system consists of two primary components:
|
| 61 |
+
|
| 62 |
+
1. **YOLO Face Detection:** Detects and localizes faces within an input image, helping isolate the relevant facial regions for further processing.
|
| 63 |
+
2. **VGG16-Based Classification:** Extracts facial image features and classifies the detected face as real or fake.
|
| 64 |
+
|
| 65 |
+
This two-stage pipeline separates face localization from authenticity classification.
|
| 66 |
+
|
| 67 |
+
### Training Details
|
| 68 |
+
|
| 69 |
+
**Classification Model:** VGG16-based CNN
|
| 70 |
+
|
| 71 |
+
**Training Regime:** 10 epochs
|
| 72 |
+
|
| 73 |
+
**Reported Accuracy:** Approximately 82%
|
| 74 |
+
|
| 75 |
+
**Training Dataset Structure:**
|
| 76 |
+
|
| 77 |
+
```text
|
| 78 |
+
dataset-metadata.json
|
| 79 |
βββ train
|
| 80 |
β βββ fake
|
| 81 |
β βββ real
|
|
|
|
| 84 |
β βββ fake
|
| 85 |
β βββ real
|
| 86 |
βββ valid.csv
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
The classification dataset contains facial images labeled as either real or fake, organized into training and validation sets.
|
| 90 |
+
|
| 91 |
+
The reported accuracy is approximate and may vary depending on the evaluation dataset and experimental conditions. Further testing is required to establish generalization performance.
|
| 92 |
+
|
| 93 |
+
### Performance Metrics
|
| 94 |
+
|
| 95 |
+
- **Accuracy:** Approximately 82% as reported during model development.
|
| 96 |
+
- **Evaluation:** Validation performance should be assessed using representative, previously unseen images.
|
| 97 |
+
- **Additional Metrics:** Precision, recall, F1-score, and a confusion matrix are recommended for a more comprehensive evaluation.
|
| 98 |
+
|
| 99 |
+
### Bias, Risks, and Limitations
|
| 100 |
+
|
| 101 |
+
- **Dataset Bias:** Performance may vary across demographic groups and image sources represented differently in the training data.
|
| 102 |
+
- **Image Quality:** Blurry, low-resolution, poorly illuminated, or heavily occluded faces may affect detection and classification.
|
| 103 |
+
- **Generalization:** The model may perform differently on unseen datasets, new deepfake-generation techniques, or images with different compression levels.
|
| 104 |
+
- **Detection Errors:** YOLO may fail to detect some faces or may produce inaccurate bounding boxes.
|
| 105 |
+
- **Classification Errors:** A real image may be classified as fake, or a fake image may be classified as real.
|
| 106 |
+
- **Limited Evaluation:** The reported accuracy alone does not establish reliability across all real-world scenarios.
|
| 107 |
+
|
| 108 |
+
### Recommendations
|
| 109 |
+
|
| 110 |
+
Users should evaluate the model on diverse datasets before deploying it in practical applications. For sensitive applications, predictions should be combined with additional verification methods and human review.
|
| 111 |
+
|
| 112 |
+
The model's predictions should be treated as estimates rather than definitive proof of image authenticity.
|
| 113 |
+
|
| 114 |
+
### How to Get Started
|
| 115 |
+
|
| 116 |
+
Refer to `code.py` for the inference implementation and the required preprocessing steps.
|
| 117 |
+
|
| 118 |
+
The general inference workflow is:
|
| 119 |
+
|
| 120 |
+
1. Load an input image.
|
| 121 |
+
2. Use YOLO to detect and localize faces.
|
| 122 |
+
3. Extract the detected facial regions.
|
| 123 |
+
4. Apply the preprocessing required by the VGG16-based classifier.
|
| 124 |
+
5. Run classification to obtain the real/fake prediction.
|
| 125 |
+
|
| 126 |
+
Ensure that the YOLO detector, classifier, and preprocessing pipeline are configured consistently with the original implementation.
|
| 127 |
+
|
| 128 |
+
### Ethical Considerations
|
| 129 |
+
|
| 130 |
+
This model is intended for research, experimentation, and educational use. Its outputs should not be interpreted as conclusive evidence of deception, fraud, or a person's identity. Users are responsible for ensuring appropriate privacy protections and responsible use of facial images.
|
| 131 |
+
|
| 132 |
+
### License
|
| 133 |
|
| 134 |
+
This project is released under the MIT License.
|
|
|
|
|
|
|
|
|