AN AI WEB-BASED EMOTION DETECTION SYSTEM EMPLOYING CNN (CONVOLUTIONAL NEURAL NETWORK)
Abstract
ABSTRACT.
This research addresses the development and implementation of a web-based emotion recognition system utilizing Convolutional Neural Networks (CNNs) to detect and classify human emotions from facial expressions in real-time. Despite significant advancements in machine learning and computer vision, practical deployment of emotion recognition systems remains constrained by accessibility barriers, computational inefficiencies, and suboptimal user interfaces. This study leveraged the FER2013 dataset, comprising 35,887 grayscale facial images across seven emotional categories (anger, disgust, fear, happiness, sadness, surprise, and neutral), to train an optimized CNN model. The methodology adopted the Agile System Development Life Cycle (SDLC), facilitating iterative development and continuous integration of user feedback. Data preprocessing involved image normalization, resizing to 48×48 pixels, and augmentation techniques including random rotations, horizontal flipping, and brightness adjustments to enhance model robustness. The CNN architecture comprised multiple convolutional layers for hierarchical feature extraction, batch normalization for training stability, pooling layers for dimensionality reduction, and fully connected layers for classification. The model was trained using the Adam optimizer with categorical cross-entropy loss function, implementing early stopping to prevent overfitting. Comprehensive testing on a stratified test subset (10% of the dataset) yielded an overall accuracy of 69%, with precision and recall metrics demonstrating balanced performance across emotion classes. The system achieved optimal results for happiness detection (78% recall, 75% precision) while facing challenges with disgust recognition (50% recall, 55% precision) due to dataset imbalance. Threshold optimization analysis identified 0.40 as the optimal decision boundary, maximizing the F1-score (0.69) while maintaining balanced classification distribution. The confusion matrix revealed 701 true positives for happiness and 455 for neutral expressions, confirming robust detection for these categories. ROC curve analysis demonstrated solid discrimination ability with a micro-average AUC of 0.72, significantly outperforming random classification baselines. The web-based deployment through Streamlit provided an intuitive interface supporting both real-time webcam input and static image upload functionality. This research contributes to the field of affective computing by demonstrating that carefully optimized CNN architectures can achieve competitive accuracy while maintaining computational efficiency suitable for web-based real-time applications.
Full-Text Access Notice
In accordance with the NERD Policy on promoting peer-reviewed publication, public access to the full text of a project, thesis or dissertation is restricted for three years, allowing the author and supervisors sufficient time to pursue peer-reviewed publication.
During this period, researchers with legitimate academic or research purposes may request authorisation directly from the author to enable NERD to release the indexed full texts of the work using the form below.