Facial Emotion Recognition Using Deep Learning: A CNN-Based Web-Deployed Affective Computing System
Keywords:
Facial Emotion Recognition, Deep Learning, Convolutional Neural Networks, PyTorch, OpenCV, Haar Cascade, Flask, Affective Computing, Batch Normalization, Adam OptimizerAbstract
Facial Emotion Recognition (FER) is a transformative application of affective computing that automatically identifies
human emotional states from facial images. This paper presents a comprehensive web-based FER system built on a
custom Convolutional Neural Network (CNN) — EmotionCNN — featuring four progressively scaled convolutional
blocks (32, 64, 128, 256 filters) with Batch Normalization, ReLU activations, and Max Pooling, culminating in three
fully connected layers for classification into seven Ekman emotion categories: Happy, Sad, Angry, Surprise, Fear,
Disgust, and Neutral. The network is trained on a controlled synthetic dataset of 4,200 grayscale 48×48 pixel images
generated via OpenCV drawing primitives, achieving 100% accuracy on a held-out 700-image test set. Three classical
baseline classifiers — Logistic Regression (83.29%), Random Forest (77.43%), and SVM with RBF kernel (65.00%)
— are systematically evaluated for comparative analysis. Face localization employs the Viola–Jones Haar Cascade
detector for efficient CPU-bound frontal-face detection. The complete system is deployed as a full-stack Flask
application with PyTorch inference, SQLite persistence, and a Bootstrap 5 dark-violet responsive interface,
incorporating drag-and-drop upload, real-time confidence-scored predictions, per-user history tracking, and a fivechart
analytics dashboard. Mathematical formulations of the convolutional operation, Batch Normalization, ReLU,
Softmax, and Adam optimizer are presented alongside the system architecture, algorithmic pipeline, UML diagrams,
and a comprehensive results analysis.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Authors

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.











