Facial Emotion Detection Model

A lightweight deep learning model that classifies facial expressions into 7 emotion categories.

Model Details

  • Model type: Image Classification
  • Architecture: ResNet50-based
  • Input: 224x224 RGB images
  • Output: 7 emotion classes
  • Accuracy: 85.60%

Emotion Classes

  • 😠 Angry
  • 🀒 Disgust
  • 😨 Fear
  • 😊 Happy
  • 😐 Neutral
  • 😒 Sad
  • 😲 Surprise

Quick Start

from tensorflow.keras.models import load_model
from PIL import Image
import numpy as np

# Load model
model = load_model('Facial_Emotion_Detection_Model.h5')

# Preprocess image
img = Image.open('face.jpg').convert('RGB').resize((224, 224))
x = np.array(img) / 255.0
x = np.expand_dims(x, axis=0)

# Predict
predictions = model.predict(x)
emotion = ['angry', 'disgust', 'fear', 'happy', 'neutral', 'sad', 'surprise'][np.argmax(predictions)]
confidence = np.max(predictions)

print(f"Emotion: {emotion} ({confidence:.2%})")
Usage
Ideal for:

Emotion analysis applications

Human-computer interaction

Customer sentiment analysis

Research projects

Limitations
Best with frontal face images

Performance varies with image quality

Cultural differences may affect accuracy

License: Apache 2.0
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support