CoolFace
Modelpublic

arsath-sm/face_classification_model2

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
Model Card

Inception-style Face Classification Model ๐ŸŽญ

This model uses an Inception-style architecture to distinguish between real human faces and AI-generated faces.

Model Description ๐Ÿ“

Model Architecture

  • โ€”Inception-style network with multi-scale feature processing
  • โ€”Input shape: (224, 224, 3)
  • โ€”Multiple inception modules with parallel pathways
  • โ€”Global average pooling
  • โ€”Dense layers with dropout for classification
  • โ€”Binary output with sigmoid activation

Task

Binary classification to determine if a face image is real (human) or AI-generated.

Framework and Training

  • โ€”Framework: TensorFlow
  • โ€”Training Device: GPU
  • โ€”Training Dataset: Custom dataset of real and AI-generated faces
  • โ€”Validation Metrics:
  • โ€”Accuracy: 52.94%
  • โ€”Loss: 0.6913

Intended Use ๐ŸŽฏ

Primary Intended Uses

  • โ€”Research in deepfake detection
  • โ€”Educational purposes in deep learning
  • โ€”Face authentication systems

Out-of-Scope Uses

  • โ€”Production-level face verification
  • โ€”Legal or forensic applications
  • โ€”Stand-alone security systems

Training Procedure ๐Ÿ”„

Training Details

python
optimizer = Adam(learning_rate=0.0001)
loss = 'binary_crossentropy'
metrics = ['accuracy']

Training Hyperparameters

  • โ€”Learning rate: 0.0001
  • โ€”Batch size: 32
  • โ€”Dropout rate: 0.5
  • โ€”Architecture:
  • โ€”Initial conv: 64 filters, 7x7
  • โ€”Inception modules: [64, 128, 256, 512] filters
  • โ€”Dense layer: 256 units

Evaluation Results ๐Ÿ“Š

Performance Metrics

  • โ€”Validation Accuracy: 52.94%
  • โ€”Validation Loss: 0.6913

Advantages Over ResNet Model

  • โ€”Better generalization
  • โ€”More stable learning process
  • โ€”Lower validation loss
  • โ€”Slightly higher accuracy

Usage ๐Ÿ’ป

python
from tensorflow.keras.models import load_model
import cv2
import numpy as np

# Load the model
model = load_model('face_classification_model2')

# Preprocess image
def preprocess_image(image_path):
    img = cv2.imread(image_path)
    img = cv2.resize(img, (224, 224))
    img = img / 255.0
    return np.expand_dims(img, axis=0)

# Make prediction
image = preprocess_image('face_image.jpg')
prediction = model.predict(image)
is_real = prediction[0][0] > 0.5

Ethical Considerations ๐Ÿค

This model is designed for research and educational purposes only. Users should:

  • โ€”Obtain proper consent when processing personal face images
  • โ€”Be aware of potential biases in face detection systems
  • โ€”Consider privacy implications when using face analysis tools
  • โ€”Not use this model for surveillance or harmful applications

Technical Limitations โš ๏ธ

  1. 1.Current performance limitations:
  2. 2.Accuracy only slightly above random chance
  3. 3.May require ensemble methods for better results
  4. 4.Limited testing on diverse datasets
  1. 1.Recommended improvements:
  2. 2.Extended training with larger datasets
  3. 3.Implementation of data augmentation
  4. 4.Hyperparameter optimization
  5. 5.Transfer learning from pre-trained models

Citation ๐Ÿ“š

bibtex
@software{face_classification_model2,
  author = {Your Name},
  title = {Face Classification Model using Inception Architecture},
  year = {2024},
  publisher = {HuggingFace},
  url = {https://huggingface.co/arsath-sm/face_classification_model2}
}

Contributors ๐Ÿ‘ฅ

  • โ€”Arsath S.M
  • โ€”Faahith K.R.M
  • โ€”Arafath M.S.M

University of Jaffna

License ๐Ÿ“„

This model is licensed under the MIT License.