FaceDetection / README.md
aafreen06's picture
Upload README.md with huggingface_hub
97d4839 verified
---
tags:
- image-classification
- face-recognition
- keras
- tensorflow
- opencv
library_name: keras
---
# Face Recognition Model
A CNN-based face recognition model built from scratch using Keras/TensorFlow.
## People it recognizes
- Aafreen
- Syeda
- Taha
## Model Architecture
- 4 Convolutional Blocks (Conv2D β†’ BatchNorm β†’ ReLU β†’ MaxPool)
- Filters: 32 β†’ 64 β†’ 128 β†’ 256
- Dense(256) β†’ Dropout(0.5) β†’ Dense(3, Softmax)
- Input size: 128Γ—128Γ—3
## Training Details
- Dataset: ~71 images (22–26 per person)
- Augmentation: 7 variants per training image (flip, rotation, brightness, zoom)
- Split: 70% train / 15% val / 15% test
- Optimizer: Adam (lr=0.001)
- Loss: Categorical Crossentropy
- Callbacks: EarlyStopping, ReduceLROnPlateau, ModelCheckpoint
## Files
| File | Description |
|------|-------------|
| `face_model.h5` | Trained Keras model |
| `class_names.json` | Label index mapping |
| `training_curves.png` | Accuracy & loss plots |
| `confusion_matrix.png` | Evaluation results |
## How to use
```python
from tensorflow.keras.models import load_model
import json, numpy as np
model = load_model('face_model.h5')
with open('class_names.json') as f:
class_names = json.load(f)
# Predict on a 128x128 face crop
img = img / 255.0
img = np.expand_dims(img, axis=0)
pred = model.predict(img)
label = class_names[str(np.argmax(pred))]
conf = np.max(pred)
print(f"{label} ({conf*100:.1f}%)")
```
## Project
Applied AI Final Project β€” COMP 6721
Concordia University, Winter 2026