Computer vision for assessing species color pattern variation from web-based community science images

Maggie M. Hantak, Robert Guralnick, Alina Zare, Brian J. Stucky

Abstract

Openly available community science digital vouchers provide a wealth of data to study phenotypic change across space and time. However, extracting phenotypic data from these resources requires significant human effort. Here, we demonstrate a workflow and computer vision model for automatically categorizing species color pattern from community science images. Our work is focused on documenting the striped/unstriped color polymorphism in the Eastern Red-backed Salamander (Plethodon cinereus). We used an ensemble convolutional neural network model to analyze this polymorphism in 20,318 iNaturalist images. Our model was highly accurate (~98%) despite image heterogeneity. We used the resulting annotations to document extensive niche overlap between morphs, but wider niche breadth for striped morphs at the range-wide scale. Our work showcases key design principles for using machine learning with heterogeneous community science image data to address questions at an unprecedented scale.

Introduction: The Phenotypic Bottleneck

Ecologists and evolutionary biologists are currently sitting on a goldmine of data: millions of "digital vouchers" (photographs) uploaded to community science platforms like iNaturalist. These images contain vital information about animal phenotypes—physical traits like color, size, and health—that could help us understand how species respond to climate change.

However, there is a massive "phenotypic bottleneck." Manually looking at tens of thousands of photos to record traits is labor-intensive and slow. While computer vision has become excellent at identifying which species is in a photo, using it to score specific traits within a species (like whether a salamander is striped or unstriped) is much less developed, especially when dealing with the "messy" reality of amateur photography (varying lighting, angles, and backgrounds).

Comparison of the striped (left) and unstriped (right) color morphs of the Eastern Red-backed Salamander.

Methods: A Human-in-the-Loop Pipeline

The authors developed a pipeline to bridge the gap between raw community images and biological insights:

  1. Human-in-the-Loop Training: Seven volunteers manually scored 4,000 images to create a "ground truth" dataset. They used a consensus method (multiple people scoring the same image) to ensure high-quality labels.
  2. Ensemble Deep Learning: The team used an ensemble of Convolutional Neural Networks (CNNs) based on the EfficientNet-b4 architecture. They employed transfer learning, starting with a model pre-trained on the massive ImageNet dataset and fine-tuning it for salamander classification.
  3. Data Augmentation: To handle the heterogeneity of iNaturalist photos, they used techniques like random flips, rotations, and color jittering during training to make the model more robust.
  4. Ecological Modeling: Once the model classified the remaining ~16,000 images, the researchers combined this data with WorldClim environmental layers. They used MAXENT (Maximum Entropy Modeling) and logistic regression to analyze how color morphs relate to climate and geography.

Results: Range-Wide Ecological Insights

The ensemble model reached ~98% accuracy on the test set, demonstrating that deep learning can handle the "noise" of community science. Despite images containing hands, leaves, varying scales, and blurry subjects, the model achieved near-human accuracy.

Of the 20,318 images analyzed, 75.9% (15,413) were labeled as striped and 24.1% (4,905) as unstriped. The resulting dataset allowed for a high-resolution map of morph distribution across North America.

Geographic distribution of striped (red) and unstriped (black) color morphs across the range of P. cinereus, derived from 20,318 iNaturalist observations.

Biologically, the study found that the "striped" morph has a wider niche breadth. This suggests that the striped pattern might be an evolutionary bet-hedging strategy, allowing those individuals to survive across a broader range of climatic conditions compared to their unstriped counterparts. While previous small-scale studies suggested temperature was the main driver of morph frequency, this range-wide automated analysis revealed that precipitation (specifically seasonality and wettest quarter moisture) actually has a stronger effect on separating the two morphs.

The two morphs share an 87% niche overlap, confirming they are not entirely ecologically distinct but do partition space at the margins. Striped morph frequency was positively correlated with elevation and precipitation seasonality, while unstriped morphs were more common in warmer, drier conditions.

Discussion and Future Directions

Between the start and end of the study, the number of available images on iNaturalist nearly doubled. This highlights that automated tools aren't just a luxury—they are a necessity for keeping pace with the exponential growth of community-contributed data.

However, some limitations remain. The study used a binary classification (striped vs. unstriped). A third, rare "erythristic" (all-red) morph exists but was too infrequent in the dataset to train a separate category. Additionally, the model performs best with dorsal (top-down) views; images showing only the ventral (belly) side had to be excluded.

Future work could involve "species verification" steps to filter out misidentified species and adapting this workflow to other species in the Plethodon genus that share similar color polymorphisms. This research showcases key design principles for using machine learning with heterogeneous community science image data to address questions at an unprecedented scale.

Summary updated

BibTeX
@inproceedings{hantak2022computer,
  author = {Maggie M. Hantak and Robert Guralnick and Alina Zare and Brian J. Stucky},
  title = {{Computer vision for assessing species color pattern variation from web-based community science images}},
  booktitle = {iScience},
  year = {2022},
  doi = {10.1016/j.isci.2022.104784},
}
Figure