harveymannering commited on
Commit
7493544
·
verified ·
1 Parent(s): d571e06

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -1
README.md CHANGED
@@ -1 +1,25 @@
1
- VGG model taken finetuned on AffectNet data for prediction of the 7 basic emotions.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ VGG model taken finetuned on AffectNet data for prediction of the 7 basic emotions. The model architecture can be described in code as follows:
2
+
3
+ ```
4
+ class CustomVGG(nn.Module):
5
+ def __init__(self):
6
+ super(CustomVGG, self).__init__()
7
+
8
+ # Download VGG model
9
+ self.vgg = models.vgg16(pretrained=True)
10
+
11
+ # Add a final MLP to be run after the VGG model
12
+ self.vgg.classifier[6] = nn.Linear(in_features=4096, out_features=7)
13
+
14
+ def forward(self, x):
15
+ pred = self.vgg(x)
16
+ return pred
17
+
18
+ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
19
+ classifier = CustomVGG()
20
+ classifier = classifier.to(device)
21
+ ```
22
+
23
+ Here is the loss plot for this training run. This checkpoint is taken from the epoch with the best validation loss. At it's peak it acheievd 59% accuracy on the validation set. It was trained on 7 basic emotion classes with no face cropping, but a bunch of augmentations including the standard ImageNet normalization.
24
+
25
+ ![480942868-7b13906a-58a0-428a-bd16-b359eb89301d](https://cdn-uploads.huggingface.co/production/uploads/6349716695ab8cce385f450e/cOtOMddRH0IIzBTd4bgb0.png)