Deep Learning: Classification of Shark Species via Denticle Morphology
....well, not exactly.
While working in Dr. David Baker's lab, one of the projects I had the opportunity to work on involved machine learning which was started by Ph.D. candidate Vicki Sheng and involved a collaboration with Erin Dillon of the University of California at Santa Barbra. The objective was to demonstrate how existing machine learning libraries can be utilized to reduce the workload (and potentially increase the accuracy) of identifying which shark species once inhabited paleo-environments.
So, how would one identify which species of shark forged in regions of the ocean long before humans were there to monitor them? You analyze the droppings they left behind.
Notice that not only does denticle morphology change across species, but it also varies across its location on the individual as well.
Each specie of shark has millions of what are called denticles which coat the outer portion of its skin; these are analogous to the scales that fish have (but, sharks are not kosher). These denticles exhibit different morphologies based on the species of shark allowing elasmobranchologist (a fancy way of saying shark nerd) to classify the species they belong to. For example, some denticles are shaped in a way to make the shark more streamline allowing for a more aggressive hunting style, while others help to increase drag which makes them ideal for cruising slowly along the benthic floor in search of prey. But wait, there's so much more!
These denticles serve a number of other utilities including protecting their body from fouling organisms by acting as a sort of anti-stick surface. In fact, denticles are such an ingenious design by Mother Nature, many are attempting to emulate their morphologies for a number of applications (anti-bacterial surfaces in hospitals, Olympic uniforms, etc). What makes them favored by paleo-ecologists is their ability to endure prolonged deposition in most marine environments due multiple layers consisting of a clacareous matieral, followed by an enamel-like material called vitrodentine, allowing them to exist within the seafloor long after the shark itself has died and decomposed.
Features, which mostly consists of drastic changes in values among neighboring pixels are determined by the program randomly each time it is given an input (i.g. image). By allowing the program to determine which feature it believes represents what the input is, allows for the potential of pattern recognition beyond what a human may even be capable of.
To teach a computer to classify denticles (or anything really) was a monumental task for computer scientists for the longest time. Before machine learning became more popular in the last decade, programmers attempted to solve classification problems by hard-coding what features to be looking for when trying to identify a given image. But this methodology proved to be exhausting as it would require someone to type every feature they thought distinguished a given object. Not only would that have required all of eternity but it also meant that a finished product would only be as good as the individual who programmed it (that's the best case scenario).
Instead of programming every single feature that makes a cat a cat, computer scientists have revitalized an older machine learning method (see interesting backstory here) that allows for a machine to learn which features it thinks makes a cat a cat. Convolutional Neural Networks (CNN) is a training method which fine tunes a program's ability to accurately predict a given input through many trial and errors. This paradigm is actually a form of biomimicry in itself which attempts to emulate the neurons in a human brain which fire when activated.
Tensorboard allows for the results to be represented in various different formats which makes it easier to understand the training and testing stages. The top image shows the accuracy of the training versus the validation over time, and also the cross entropy, across each training step (epoch). The bottom image shows a confusion matrix which was generated using the misclassifed images, and setting the train, validation, and testing split percentages to 80, 10, and 10, respectively.
The results for the model presented above was made using the Inception V3 model as its base. Through transfer learning, our model can utilize all of previous experience the Inception V3 was exposed to by its original creators and be simply tacked on as the final layer. Using 20 different shark species to represent our different categories and ~200 images per category, we trained the model on 100,000 steps to arrive at a final TensorFlow predictive accuracy of 86.1%.
Some images were withheld from the initial training (and the subsequent validation and test split) and used to represent a "real world" test which resulted in a higher accuracy than what was provided by Tensorflow. A second real world test was used by attempting to classify unidentified denticles which were found deposited within a known environment. By knowing which species could and could not have be found in the environment, we were able to gain a bit of insight on how well the model predicts unknown specimens.
If this subject peaks your interest I encourage checking out the following links:
How Machines Learn - CGP Grey
Shark denticles and paleo-ecology - Erin Dillion
3 Cool Materials Inspired by Denticles - Seeker