0% found this document useful (0 votes)
14 views6 pages

CNN Model Performance Analysis

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views6 pages

CNN Model Performance Analysis

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Algorithm 1: CNN-Based Model (Convolutional Neural

Network)

1.

Accuracy Table
The accuracy table captures how well the CNN model performs during both
training and validation phases, usually over several epochs (iterations of the
training process). For this, you will run your model over multiple epochs (e.g.,
1, 5, 10, 20) and track the accuracy over time.

2.

Detailed Accuracy Table Example:

3.

Epo Training Accuracy Validation Accuracy


ch (%) (%)
1 65.0 62.0
5 75.0 70.0
10 85.0 80.0
20 90.0 85.0

4.
1. How to Get This Data:
Train the CNN using the dataset from Kaggle. Track both training accuracy (how well
the model performs on the data it has seen) and validation accuracy (how well the
model generalizes to unseen data). You can log this information after each epoch.

Discussion of Accuracy Table:

1. Model Learning Progress: The table shows steady improvement in accuracy as the
number of epochs increases. This suggests the model is learning well. For instance,
validation accuracy improves from 62% at epoch 1 to 85% at epoch 20.
2. Overfitting Risk: The slight difference between training and validation accuracy
(e.g., at epoch 20: 90% vs. 85%) indicates minimal overfitting, meaning the model
generalizes well. If this gap increases, overfitting could be a concern.

5.

Performance Metrics Table


Performance metrics such as Precision, Recall, and F1-score give a deeper
understanding of how the CNN model performs across different emotions.
These metrics are important because accuracy alone might not reflect the
model's performance on imbalanced datasets, where some emotions are easier
to predict than others.

6.
Detailed Performance Metrics Table Example:

7.

Emotio Precisio Recal F1-


n n l Score
Angry 0.82 0.80 0.81
Happy 0.90 0.88 0.89
Neutral 0.75 0.78 0.76
Sad 0.70 0.68 0.69
Surpris
0.85 0.83 0.84
e

8.

1. Precision: How many selected items (emotions) are relevant. For example, 82% of
all instances classified as "Angry" are truly angry.
2. Recall: How many relevant items (emotions) are selected. For example, 80% of all
actual "Angry" instances were identified.
3. F1-Score: The harmonic mean of precision and recall. This is useful when classes are
imbalanced, balancing both false positives and false negatives.

Discussion of Performance Metrics Table:

1. Balanced Emotions: Emotions like "Happy" and "Surprise" have high F1-scores
(close to 0.89 and 0.84, respectively), meaning the model predicts them well, likely
due to their distinctive facial features.
2. Challenging Emotions: Emotions like "Sad" and "Neutral" have lower F1-scores
(around 0.69 and 0.76). These emotions are more subtle and thus harder for the
model to distinguish, which may require further tuning of the model or additional
data to improve performance.

9.

Line/Bar Chart: Accuracy Over Epochs


Visualizing accuracy over time helps show how the model improves as
training progresses.

10.

Example Line Chart Explanation:

11.

1. X-Axis: Epochs (1, 5, 10, 20, etc.)


2. Y-Axis: Accuracy (%)
3. Lines: One line for training accuracy and another for validation accuracy.

Accuracy Line Chart Example:


shell
Copy code
Training Accuracy:
Validation Accuracy:

Epochs
| 90% | + + Training
| /+-------------+85% | / + Validation
| + \80% | + \
| / \
75% | +
| 65% |

Discussion of Line Chart:

1. Convergence of Lines: The training and validation accuracies both increase and
converge over time. This suggests the model is learning well and generalizing
appropriately without significant overfitting.
2. Slow Improvement: You might see rapid improvement in the early epochs, followed
by slower gains. This is typical of CNNs as they fine-tune their weights over time.

12.

Learning Curve Diagram


The learning curve shows how performance changes as more training data is
provided. It's a crucial way to determine if adding more data will continue to
improve performance.

13.

Learning Curve Example:

14.

1. X-Axis: Amount of training data (e.g., percentage of dataset used)


2. Y-Axis: Model accuracy or loss

shell
Copy code
Training Data
| 90% | + Training Accuracy
| /+-------------+ 85% | / +
Validation Accuracy
| + \80% | + \
| / \
75% | +
|

Discussion of Learning Curve:


1. Learning Rate: If the training accuracy improves with more data, but validation
accuracy plateaus, this suggests the model may have enough training data. If both
improve, more data could help.
2. Bias-Variance Tradeoff: If the curves are close, the model is well-generalized. A
significant gap would indicate that more training data or complexity may help
reduce bias or variance.

15.

Confusion Matrix Diagram


A confusion matrix breaks down the model’s predictions for each emotion,
showing where it makes correct predictions and where it confuses one emotion
for another.

16.

Confusion Matrix Example:

17.

Ang Hap Neutr Sa Surpris


ry py al d e
Angry 80 5 10 5 0
Happy 2 88 5 3 2
Neutra
8 7 75 10 0
l
Sad 5 4 10 68 13
Surpris
0 2 1 1 96
e

18.

Discussion of Confusion Matrix:

19.

1. Emotion Confusion: The model often confuses "Neutral" and "Sad" emotions (as
seen in the confusion matrix where 10% of "Neutral" are classified as "Sad"). This
reflects the subtle difference between these two emotions.
2. Correct Classifications: The "Happy" and "Surprise" emotions are generally easier to
predict, with high true positives (e.g., 88 and 96 in their respective categories).

Algorithm 2 and 3: (Additional CNN or Other Models like


SVM or Random Forest)
Repeat the same structure as Algorithm 1, adjusting the results and tables for each
new algorithm. When presenting each algorithm, be sure to follow this detailed
breakdown to clearly show each model's performance and challenges.

Comparison of Algorithms

1.

Accuracy Comparison Table


Compare the accuracy results of all three algorithms in one table.

2.

Example Accuracy Comparison Table:

3.

Epo CNN CNN SVM


ch Model 1 Model 2 Model 3
1 65.0% 62.0% 58.0%
5 75.0% 70.0% 68.0%
10 85.0% 80.0% 78.0%
20 90.0% 85.0% 83.0%

4.

Discussion:

5.

1. Better Accuracy: CNN Model 1 consistently outperforms the others, likely due to its
ability to learn spatial hierarchies in the data. SVM, while effective in lower-
dimensional spaces, may struggle with complex image data compared to CNN.
2. Close Competition: CNN Model 2 and SVM Model 3 may perform closely, but CNN
typically excels at image-based tasks due to its architecture.

6.

Performance Metrics Table Comparison


Compare precision, recall, and F1-score across the three models for all
emotions.

7.
8.
Line Chart Comparison
Overlay the accuracy lines of all three models to visually compare how they
progress through the training process.

9.

Final Discussion:

10.

1. Best Algorithm: After comparing accuracy, performance metrics, and confusion


matrices, CNN Model 1 appears to be the most effective for facial emotion
recognition, based on its high accuracy and balanced performance across all
emotions.

This comprehensive breakdown will ensure that Chapter 4 presents results in a clear,
detailed, and insightful manner. Let me know if you'd like to adjust any specific parts
further!

You might also like