Update README.md
Browse files
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 |
+

|