Chapter 4
Results
4.1 Introduction
This chapter presents the results of the experiments conducted using the Kaggle Facial Emotion
Recognition dataset. Three distinct CNN-based models, referred to here as CNN1, CNN2, and
CNN3, were trained and evaluated on the dataset. The objective is to recognize emotions such as
happiness, sadness, anger, and more. The results will be discussed in the context of model
accuracy, performance metrics, learning curves, confusion matrices, and comparative analysis. This
chapter will also explore the implications of these results in the broader context of facial emotion
recognition tasks and future improvements.
4.2 Dataset Overview and Preprocessing
Before diving into the results, it is important to provide a brief description of the dataset used and
the preprocessing steps applied to the data.
Dataset Source: The dataset used for this project was sourced from Kaggle and contains
grayscale images of human faces categorized into seven emotion classes: Happy, Sad, Angry,
Disgust, Fear, Surprise, and Neutral.
Dataset Size: The dataset consists of 35,887 images split into training and testing sets.
Training Set: 28,709 images
Testing Set: 7,178 images
Preprocessing Steps:
o Resizing: All images were resized to 48x48 pixels to ensure uniform input size.
o Normalization: Pixel values were normalized to a range between 0 and 1 to enhance
the efficiency of the models.
o Data Augmentation: Techniques such as random rotations, horizontal flipping, and
zooming were applied to the training data to artificially increase the size of the
dataset and reduce overfitting.
4.2.1 Data Distribution
The distribution of images per emotion class was uneven, with "Happy" and "Neutral" being the
most represented, while "Disgust" was significantly underrepresented. This imbalance could affect
the model’s ability to learn to recognize minority classes accurately. To mitigate this, weighted loss
functions were applied during training to give more emphasis to the minority classes.
4.3 Algorithm Architectures
This section outlines the CNN architectures used in the experiment.
CNN1:
o Architecture: 4 convolutional layers with 32, 64, 128, and 256 filters respectively.
Each convolutional layer is followed by a max-pooling layer and ReLU activation.
o Dropout regularization was used after the first two layers to prevent overfitting.
o Fully connected layer with 128 neurons before the softmax output layer.
CNN2:
o Architecture: Similar to CNN1 but with 5 convolutional layers and a more
aggressive dropout rate (0.5) applied after each pooling layer.
o Fully connected layer with 64 neurons before the softmax output layer.
CNN3:
o Architecture: Deeper network with 7 convolutional layers, but smaller filter sizes
(16, 32, 64 filters).
o No dropout in the initial layers but higher dropout (0.6) in later layers.
o Fully connected layer with 256 neurons for higher feature extraction capacity.
These models were chosen to provide a comparative analysis of shallow, moderate, and deep CNN
architectures for emotion recognition.