Can computer vision objectively determine how different are mice from hominids and settle whether they qualify as a generalizable model organism?
Every hominid and mouse drawing used to train and validate the classifier, at full resolution, cropped to the ink.
Photos of the drawings were cropped to their ink content, converted to grayscale, and cached as 160×160 PNGs (resized to 128×128 at load time) so training doesn't re-decode full-resolution source JPEGs every epoch. Training augmentation used random rotation, horizontal flip, small translation, and scale jitter; validation images are unaugmented.
The classifier fine-tunes a pretrained EfficientNet-B0 backbone (ImageNet weights). With only 125 training images, fine-tuning the entire 4M-parameter backbone would just memorize the training set, so everything except the final MBConv block and the classifier head is frozen — 1.7M of the 4.0M total parameters are actually trained.
Optimized with AdamW (lr 3e-4, weight decay 1e-4) and cosine annealing over 25 epochs, cross-entropy loss, batch size 16, ImageNet normalization. Validation accuracy reached 100% by epoch 18 and briefly held it before mild overfitting set back in as the frozen backbone's few trainable layers kept fitting a training set this small — the checkpoint saved is the epoch-18 best, not the final epoch:
epoch 1/25 train_loss=0.5903 val_loss=0.4901 val_acc=90.6% epoch 5/25 train_loss=0.1143 val_loss=0.1071 val_acc=96.9% epoch 10/25 train_loss=0.0719 val_loss=0.0587 val_acc=96.9% epoch 15/25 train_loss=0.0188 val_loss=0.0606 val_acc=96.9% epoch 18/25 train_loss=0.0371 val_loss=0.0671 val_acc=100.0% epoch 19/25 train_loss=0.0693 val_loss=0.0775 val_acc=100.0% epoch 22/25 train_loss=0.0447 val_loss=0.1307 val_acc=96.9% epoch 25/25 train_loss=0.0586 val_loss=0.1854 val_acc=93.8% best val acc: 100.0% (epoch 18 checkpoint used below)
GradCAM highlights, in red, which regions of each drawing produced the strongest gradient for the model's predicted class. Ten validation examples per class, shown at full resolution.
One interpretation of the existence of a somewhat consistent GradCAM heatmap is that there is a body part or feature the model finds most important for classifying. What would happen if we occluded a little part of the image and re-run the classifier? Does it truly depend on a small detail? Can a mouse be seen as a hominid? Can a hominid be seen as a mouse?
We limited the occlusion to max 32px (of the 128px canvas) and counted how many samples of the whole dataset we were able to 'flip' to the opposite class.
Heatmaps and blackout occlusions show us how the model treats the data it is presented with. But what is the idea of a mouse, of a hominid that it actually learned?
To try and answer this we started with a blank canvas and ran a gradient ascent on the classifiers output logic leading to a convincing 'mouse' or 'hominind'
We put in a couple of constraints: we force continuous strokes with a fixed pen width rather than a pixel grid and the loss was set to reward the spatial frequency spectrum of the training data. Below are eight runs from random initializations.
We took EfficientNet. A model that has seen it all (aka the ImageNet database) and showed it a carefully curated dataset of hominids and mice.
We saw where the model looks for information when having to decide, we found that it is easy to fool into thinking a mouse is a hominid, but not the other way around.
Finally, we saw its somewhat abstract ideas of our shapes.
Hominids are "limby" crotch-centric figures, while mice are defined by their ears with a round back in close proximity. And yet by squinting its eyes, or having carefully placing a small black square, this objective judge can mistake a mouse for a hominid. This can be interpreted as a computational confirmation that mice are valid model organisms for humans. Surprisingly, though, we should be careful when extrapolating ideas from humans to mice as it might not be as easy.
We work with mice to study vision and wish to extrapolate our findings to humans. But mice are nocturnal animals adapted to whisk, smell and hear their way through the world. Such is the valid criticism of this model.
As a mouse researcher I am biased. That is why I reached out to computer vision to provide the ultimate objective truth.