Downloads · 30 days
15
10% of all-time downloads
harkishankhuva/face-expression-classification
face-expression-classification is a image classification model from harkishankhuva. Use it when you need a label for an image. It is set up for keras. The card lists the license as mit.
This model is designed for facial expression classification and it uses custom CNN model to classify the images into 7 different categories.
Downloads · 30 days
15
10% of all-time downloads
All-time downloads
146
Public
Repo size
3.7 MB
Likes
0
Public
Click a slice to open those files.
.keras3.7 MB · 100%
From the Hugging Face model README
This model is designed for facial expression classification and it uses custom CNN model to classify the images into 7 different categories.
This CNN Model is to classify the facial expression into one of the following categories:
| Layer (type) | Output Shape | Param # |
|---|---|---|
| conv2d (Conv2D) | (None, 46, 46, 32) | 320 |
| max_pooling2d (MaxPooling2D) | (None, 23, 23, 32) | 0 |
| dropout (Dropout) | (None, 23, 23, 32) | 0 |
| conv2d_1 (Conv2D) | (None, 21, 21, 64) | 18,496 |
| max_pooling2d_1 (MaxPooling2D) | (None, 10, 10, 64) | 0 |
| batch_normalization (BatchNormalization) | (None, 10, 10, 64) | 256 |
| dropout_1 (Dropout) | (None, 10, 10, 64) | 0 |
| conv2d_2 (Conv2D) | (None, 8, 8, 128) | 73,856 |
| max_pooling2d_2 (MaxPooling2D) | (None, 4, 4, 128) | 0 |
| batch_normalization_1 (BatchNormalization) | (None, 4, 4, 128) | 512 |
| dropout_2 (Dropout) | (None, 4, 4, 128) | 0 |
| conv2d_3 (Conv2D) | (None, 2, 2, 128) | 147,584 |
| flatten (Flatten) | (None, 512) | 0 |
| dense (Dense) | (None, 96) | 49,248 |
| dropout_3 (Dropout) | (None, 96) | 0 |
| dense_1 (Dense) | (None, 96) | 9,312 |
| dropout_4 (Dropout) | (None, 96) | 0 |
| dense_2 (Dense) | (None, 64) | 6,208 |
| dense_3 (Dense) | (None, 7) | 455 |
Total params: 306,247 (1.17 MB)
Trainable params: 305,863 (1.17 MB)
Non-trainable params: 384 (1.50 KB)
| Name | Value |
|---|---|
| Input shape | 48x48 (48, 48, 1) |
| Optimizer | Adam |
| Loss | Crossentropy |
| Max epochs | 200 |
| Early stopping monitor | val_loss |
| Early stopping patience | 12 |
precision recall f1-score support
0 0.52 0.40 0.45 491
1 0.00 0.00 0.00 55
2 0.43 0.17 0.25 528
3 0.83 0.84 0.83 879
4 0.51 0.67 0.58 626
5 0.39 0.58 0.47 594
6 0.73 0.72 0.73 416
accuracy 0.58 3589
macro avg 0.49 0.48 0.47 3589
weighted avg 0.58 0.58 0.57 3589
Training notebook: https://www.kaggle.com/code/harkishankhuva/facial-expression-classification