DOI: 10.5061/dryad.m37pvmdbq
title: Data from: Sensory exploitation of insect face cues by courting peacock spiders: A test using computer vision

description: Males use multiple tactics to capture and maintain female attention during
 courtship. These can include exploiting female sensory biases toward
 stimuli associated with foraging or shelter, as well as exploiting female
 anti-predatory responses. In the jumping spider genus Maratus, male
 courtship involves the display of complex abdominal patterning that for
 some species appears to mimic facial features of common jumping spider
 predators (e.g., wasps, mantids), at least to human observers.
  We therefore hypothesized that some Maratus species have evolved
 predator-mimicking courtship displays to influence female behavior early
 in courtship. To evaluate this, we used computer-vision and machine
 learning to investigate the likelihood that a simulated female Maratus
 viewer might misclassify a courting male’s display as a predator face. We
 find that of 62 species/morphs studied, 13 are consistently misclassified
 as predator and/or prey insect faces at rates of 20% and greater.
 Additionally, our results indicate that males may be more likely to be
 misclassified as insects during the first stage of courtship, when males
 are furthest from the female and viewed through her lateral eyes. Our in
 silico test provides initial support for the possibility that males of
 some Maratus species might use predator and/or prey-mimicry to exploit
 female sensory biases in courtship.
description: Images were collected from public online photography sharing
 sites, primarily Flickr. All *Maratus *images come from Jurgen Otto.
 Images were standardized using Adobe Photoshop CS5.1. Analysis in MATLAB
 uses the Histogram of Oriented Gradients feature extraction method and
 support vector machine multiclass classification, iteratively running 10
 iterations of each of the four sighting distances for each of the four
 image sets. The Results folders include the results of all simulations for
 both the genus-wide analysis and the single-species analysis.
 Supplementary Table 1 shows the combined misclassification of *Maratus
 *across all simulations, sorted by species.
description: # Data from: Sensory exploitation of insect face cues by courting male
 peacock spiders: A test using computer vision
 [https://doi.org/10.5061/dryad.m37pvmdbq](https://doi.org/10.5061/dryad.m37pvmdbq) Included are the image banks used to train and test the classifier as well as Excel workbooks containing the misclassification results for each tested condition, for both the genus-wide and the single-species tests. MatLab code given processes all four image types (fly, mantid, *Maratus*, wasp) across all 4 sighting distances (1cm, 2cm, 3cm, 5cm) - note that each sighting distance has a corresponding HOGExtractor function.  ### Image Banks ImageBank_GenusWide.zip and ImageBank_SingleSpecies.zip each contain four folders describing the four image sets used by the classifier (Grey Background - Color; Grey Background - Greyscale; Natural Background - Color; and, Natural Background - Greyscale). Within each of these four folders are four folders, containing the edited images of fly faces, mantid faces, *Maratus* abdomens, and wasp faces. Images are all named by their classification, identity number, and image treatment. ### Matlab Scripts SVMClassifier_4IMDS_looped.m is the script that iteratively reads in each of the four image banks, applies each of the four extractor functions, and runs each simulation for 10 iterations. * HOGExtractor11.m is the script used to simulate a sighting distance of 1cm (using a cell size of 11x11 pixels) * HOGExtractor22.m is the script used to simulate a sighting distance of 2cm (using a cell size of 22x22 pixels) * HOGExtractor34.m is the script used to simulate a sighting distance of 3cm (using a cell size of 34x34 pixels) * HOGExtractor57.m is the script used to simulate a sighting distance of 5cm (using a cell size of 57x57 pixels) ### Results Tables `Results_Tables_GenusWide.zip` and `Results_Tables_SingleSpecies.zip` each contain 16 Excel workbooks. Each workbook contains the results of a simulation, indicated by the name. For example, GbC_11x11_Total.xlsx is the collected results for the simulation run on Grey Background - Color images, using the feature extraction function HOGExtractor11.m, which extracts features in cells of 11x11 pixels, simulating a sighting distance of 1cm. For each workbook, the first sheet is the average confusion matrices of all 10 iterations, which are each given in subsequent sheets. These raw results sheets, labeled 1-10 include the following columns: * Files (filename for the image used in testing), * Known (true identity of image class, given in integers based on alphabetized order of class names), * Guessed (classification made by machine, given in the same integers used in Known), * Score Flies, * Score Mantid, * Score Maratus Fan, * Score Wasp (all score columns give the numeric score assigned to each class for the given image. Scores are indicators of fit, the class with the highest score is the class given in Guessed), * Var8 indicates classification of all Flies, * Var9 indicates classification of all Mantids,  * Var10 indicates classification of all *Maratus*,  * Var11 indicates classification of all Wasps. These last four columns give the confusion matrices that are averaged together for the first sheet in each book. SupTable1.xlsx summarizes *Maratus* misclassifications from all 16 simulations in the GenusWide analysis. Misclassifications are listed by *Maratus* species and include the number of times an image was used in testing, the number of times it was misclassified in testing, and the class in which it was incorrectly classified. These results are given in both counts and percentages.