facepass_eval / README.md
besartshyti's picture
Update README with real face dataset information
71f1cec verified
metadata
license: mit
task_categories:
  - image-classification
tags:
  - face-recognition
  - lfw
  - evaluation
  - benchmark
size_categories:
  - 1K<n<10K

FacePass Evaluation Dataset (Real LFW Faces)

This dataset contains real face images from the LFW (Labeled Faces in the Wild) dataset, curated for face recognition evaluation.

⚠️ IMPORTANT: This is the corrected version with actual face photographs (not colored squares).

Dataset Description

  • Real face images: From the original LFW dataset via Kaggle
  • Total individuals: 62
  • Minimum images per person: 20
  • Training examples: 1670
  • Test examples: 393
  • Image size: 128x128 pixels
  • Format: RGB

Key Features

Real faces: Actual photographs of people, not synthetic images
Balanced dataset: All individuals have 20+ images
Proper splits: 80/20 train/test split per person
Standardized: Resized to 128x128, RGB format
Clean labels: Consistent person names and IDs

Top Individuals by Image Count

  1. George_W_Bush: 530 images
  2. Colin_Powell: 236 images
  3. Tony_Blair: 144 images
  4. Donald_Rumsfeld: 121 images
  5. Gerhard_Schroeder: 109 images
  6. Ariel_Sharon: 77 images
  7. Hugo_Chavez: 71 images
  8. Junichiro_Koizumi: 60 images
  9. Jean_Chretien: 55 images
  10. John_Ashcroft: 53 images
  11. Jacques_Chirac: 52 images
  12. Serena_Williams: 52 images
  13. Vladimir_Putin: 49 images
  14. Luiz_Inacio_Lula_da_Silva: 48 images
  15. Gloria_Macapagal_Arroyo: 44 images

Dataset Structure

from datasets import load_dataset

dataset = load_dataset("besartshyti/facepass_eval")

# Training split
train_data = dataset["train"]
print(f"Training examples: {len(train_data)}")

# Test split  
test_data = dataset["test"]
print(f"Test examples: {len(test_data)}")

# Example data point
print(train_data[0])
# {
#     'image': <PIL.Image.Image>,        # 128x128 RGB face image
#     'label': 'George_W_Bush',          # Person name
#     'image_id': 'George_W_Bush_train_0001',  # Unique image ID
#     'person_id': 1234                  # Numeric person ID
# }

Usage for Face Recognition Evaluation

This dataset is designed for evaluating face recognition libraries:

import numpy as np
from sklearn.metrics import accuracy_score

def evaluate_face_recognition_system(model, dataset):
    """Evaluate face recognition system on real faces."""
    
    # Extract embeddings from training set
    train_embeddings = []
    train_labels = []
    
    for example in dataset['train']:
        embedding = model.get_embedding(example['image'])
        train_embeddings.append(embedding)
        train_labels.append(example['label'])
    
    # Build reference database (average embeddings per person)
    reference_db = {}
    for emb, label in zip(train_embeddings, train_labels):
        if label not in reference_db:
            reference_db[label] = []
        reference_db[label].append(emb)
    
    # Average embeddings for each person
    for label in reference_db:
        reference_db[label] = np.mean(reference_db[label], axis=0)
    
    # Test on test set
    predictions = []
    true_labels = []
    
    for example in dataset['test']:
        test_embedding = model.get_embedding(example['image'])
        
        # Find best match
        best_similarity = -1
        best_match = None
        
        for ref_label, ref_embedding in reference_db.items():
            similarity = cosine_similarity(test_embedding, ref_embedding)
            if similarity > best_similarity:
                best_similarity = similarity
                best_match = ref_label
        
        predictions.append(best_match)
        true_labels.append(example['label'])
    
    accuracy = accuracy_score(true_labels, predictions)
    return accuracy

def cosine_similarity(a, b):
    return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))

Comparison with Other Face Recognition Libraries

Example results on this dataset:

Library Accuracy Speed (emb/s) Embedding Dim
DeepFace 85-95% 5-15 128-4096
InsightFace 90-98% 50-200 512
face_recognition 80-90% 10-50 128

Data Source

  • Original dataset: LFW (Labeled Faces in the Wild)
  • Source: Kaggle dataset jessicali9530/lfw-dataset
  • License: LFW dataset license (research use)
  • Preprocessing: Resized to 128x128, converted to RGB

Citation

If you use this dataset, please cite both the original LFW dataset and this curated version:

@misc{facepass_eval_2025,
  title={FacePass Evaluation Dataset (Real LFW Faces)},
  author={FacePass Team},
  year={2025},
  url={https://huggingface.co/datasets/besartshyti/facepass_eval},
  note={Real face images from LFW dataset, curated for face recognition evaluation}
}

@techreport{LFWTech,
  title={Labeled Faces in the Wild: A Database for Studying Face Recognition in Unconstrained Environments},
  author={Huang, Gary B. and Mattar, Marwan and Berg, Tamara and Learned-Miller, Eric},
  institution={University of Massachusetts, Amherst},
  number={07-49},
  month={October},
  year={2007}
}

License

This dataset is released under the MIT license for the curation work. The original LFW images retain their original license terms.

Updates

  • 2025-08-28: ✅ FIXED - Replaced colored squares with real LFW face images
  • 2025-08-28: Initial release (had synthetic colored squares - now corrected)