Group Emotion Recognition

Computer Vision and Deep Learning for Collective Mood Analysis

View Interactive Notebook

Project Overview

This project develops an automated system for analyzing collective emotions in group photographs by detecting individual faces, recognizing their emotions, and aggregating them to determine the overall group mood. Built on Google Vertex AI infrastructure for scalable processing and model deployment. The system has practical applications in assessing employee satisfaction at corporate events, measuring student engagement in educational settings, evaluating attendee sentiment at conferences, and understanding collective well-being in social gatherings. Using advanced computer vision and quality-weighted aggregation, this project provides insights into group dynamics without requiring subjective human labeling.

Key Objectives

Dataset

Source: Approximately 3,000 group images scraped from the internet

Characteristics: Real-world, unconstrained images with diverse lighting conditions, face sizes, angles, and group compositions

Annotations: Manual labeling using Label Studio for validation and ground-truth comparison

Key Metrics Tracked:

Sample Visualization

Face Detection Comparison: RetinaFace vs YOLOv8

Comparison of face detection results: RetinaFace vs YOLOv8-face showing detected faces in group images

Methods & Techniques

Face Detection Algorithms Evaluated:

RetinaFace YOLOv8-face YOLO11 Face Emotion OpenCV Haar Cascades SSD

Emotion Recognition & Aggregation:

Label-Free Evaluation Metrics:

Quality Analysis Visualization

Face Quality Analysis Heatmap

Quality analysis heatmap showing the relationship between face size, sharpness, and usability for emotion detection

Results & Performance

RetinaFace
Best Detector
29 vs 24
RetinaFace vs YOLO
10-15+
Optimal Group Size
Top-40
Faces Selected

Key Findings

  • Best Face Detector: RetinaFace significantly outperformed YOLOv8-face, recovering 29 usable faces vs 24 in crowded scenes and showing superior multi-scale detection capabilities
  • Group Size Matters: Small groups (1-2 faces) show high variability and unreliable predictions despite appearing confident; predictions stabilize and become representative with 10-15+ faces
  • Entropy as Emotional Diversity Indicator: Low entropy indicates emotionally coherent groups with dominant single emotions, while high entropy reveals genuinely diverse emotional compositions
  • Quality-Weighted Aggregation Benefits: Produces stable group-level distributions as group size increases, with strong inverse relationship between entropy and distribution peakiness
  • Label-Free Evaluation Success: The behavior-based evaluation framework successfully assesses system reliability without requiring controversial subjective ground-truth labels
  • Practical Insight: System captures multiple concurrent emotional signals in real-world groups, treating group emotion as a probabilistic distribution rather than a single categorical label

Technologies Used

Google Vertex AI Python DeepFace RetinaFace Ultralytics (YOLO) OpenCV NumPy Pillow pandas SciPy Google Cloud Storage Label Studio

Entropy and Emotional Diversity: Key Examples

The following examples demonstrate how entropy quantifies emotional diversity in groups. Low entropy indicates emotionally coherent groups (dominant single emotion), while high entropy reveals genuinely mixed emotional states.

Low Entropy Examples (Emotionally Coherent)

Low Entropy Example 1 Low Entropy Example 2

Medium Entropy Examples

Medium Entropy Example 1 Medium Entropy Example 2

High Entropy Examples (Emotionally Diverse)

High Entropy Example 1 High Entropy Example 2

Each visualization shows: (left) group image with detected faces, (right) weighted emotion distribution. Entropy values quantify the spread of emotions across the group.

Innovation Highlights

This project introduces a novel behavior-based, label-free evaluation framework that avoids subjective ground-truth labeling by focusing on:

By treating group emotion as a probabilistic distribution rather than a single label, the system provides principled evaluation and captures the complexity of real-world group emotional dynamics.