I have a hard time telling apart three famous actors: Leonardo DiCaprio, Matt Damon and Mark Wahlberg. As you can imagine, the Scorsese film The Departed was a wash-out for me. Could I put AI to the task and help restore my enjoyment of the critically acclaimed Crime Thriller?
Pre-Cleaning
I pulled together 200 images of each actor from Google Images.
While Google Images is a great resource for quickly assembling a set of images for training AI, the images are noisy. I have illustrated some problems with a random sample. Proceeding to train with this set, the strategy based on fast.ai’s approach to Transfer Learning is:
- Fit the model classifier starting with ResNet34 trained on ImageNet data and using One Cycle policy for training the fully-connected layer over a few (e.g. 8) epochs
- Unfreeze the layers and explore the learning rate to select the min-max range
- Continue fitting the model with the One Cycle policy to train all layers with the range of learning rates.
With 3 classes, 469 images in training set and 117 in validation set, this gives:
-
The Stage-I accuracy after 8 epochs (in 2 runs of 4 each) is roughly 76%.
-
The learning rate range-finder gives the min. as 1e-6 and max as 1e-3.
-
The Stage-II accuracy has improved to roughly 82%.
Post-Cleaning
After cleaning the dataset and removing duplicates, the data look much cleaner.
With 3 classes, 333 images in training set and 89 in validation set, this gives:
-
The Stage-I accuracy after 8 epochs (in 2 runs of 4 each) is roughly 72%.
-
The learning rate range-finder gives the min. as 7e-6 and max. as 2e-3.
-
The Stage-II accuracy has improved to roughly 86%.
Summary
The confusion matrix with the “as-is” image set is shown on the left and with the clean image set on the right.
One the one hand, I am kicked at the results in a weekend’s worth of work. On the other hand, the error rates seem much higher compared to the examples in the lectures and results posted by peers. Suggestions?