Data from: Testing the equivalency of human “predators” and deep neural networks in the detection of cryptic moths
Data files
Jan 16, 2025 version files 46.86 MB
-
dataAndCode.zip
46.86 MB
-
README.md
3.63 KB
Abstract
Researchers have shown growing interest in using deep neural networks (DNNs) to efficiently test the effects of perceptual processes on the evolution of color patterns and morphologies. Whether this is a valid approach remains unclear, as it is unknown whether the relative detectability of ecologically relevant stimuli to DNNs actually matches that of biological neural networks. To test this, we compare image classification performance by humans and six DNNs (AlexNet, VGG-16, VGG-19, ResNet-18, SqueezeNet, and GoogLeNet) trained to detect artificial moths on tree trunks. Moths varied in their degree of crypsis, conferred by different sizes and spatial configurations of transparent wing elements. Like humans, four of six DNN architectures found moths with larger transparent elements harder to detect. However, humans and only one DNN architecture (GoogLeNet) found moths with transparent elements touching one side of the moth’s outline harder to detect than moths with untouched outlines. When moths took up a smaller proportion of the image (i.e., were viewed from further away), the camouflaging effect of transparent elements touching the moth’s outline was reduced for DNNs but enhanced for humans. Viewing distance can thus interact with camouflage type in opposing directions in humans and DNNs, which warrants a deeper investigation of viewing distance/size interactions with a broader range of stimuli. Overall, our results suggest that humans and DNN responses had some similarities, but not enough to justify widespread use of DNNs for studies of camouflage.
README: Testing the equivalency of human “predators” and deep neural networks in the detection of cryptic moths
https://doi.org/10.5061/dryad.w0vt4b92k
Description of the data and file structure
This data was collected for the paper entitled "Testing the equivalency of human “predators” and deep neural networks in the detection of cryptic moths."
Files and variables
File: Data___Code.zip
Description: This archive contains:
1) Folder entitled "224x224 images," which contains images of moths for DNNs requiring images of this resolution. Each subfolder contains images of a given moth morph. Abbreviations should be interpreted thusly: O=opaque morph, LW=morph with large windows, SW=morph with small windows, BE=morph with large windows touching bottom edges of wings, B3E=morph with large windows touching all three wing edges. Image names are the default names assigned by the camera that took the images.
2) Folder entitled "227x227 images," which contains images of moths for DNNs requiring images of this resolution. Subfolder and image names are as in (1) above.
3) Folder entitled "DNN code," which contains the MATLAB code used to run the DNN simulations. 'trainAndTestANN_Master.m' is the master script used to run the simulations. 'classActivMap.m' is a custom function that is called by the master script. 'lengths.mat' is a file containing the sizes (in pixels) of the moths at their broadest dimension and is read in by the master script. When running the master script, these three files should be located in the directory containing the appropriate-sized image subfolders (i.e. "224x224 images/" or "227x227 images/", described above), and this should also be the working directory in MATLAB.
4) Folder entitled "DNN output," which contains the data files output by the MATLAB code that were used for statistical analysis. Each file contains the data from 100 replicates using the same DNN starting architecture. The key to the column headings is as follows: Morph: moth morph in the picture, indicated by "Franglais" abbreviations, and should be interpreted thusly: C=O, GF=LW, PF=SW, FBdown=BE, FBside=B3E; ANN: ID of artificial neural network; ANNlabel: 1 if the network identified a moth in the picture and 0 if it did not; scores: score assigned by the artificial neural network indicating its certainty of there being a moth in the picture; sizes: diameter of the moth in pixels; fileNames: file name of the associated image
5) File entitled "humanMothData.txt," which contains the data collected from humans via Testable.org. The key to the column headings is as follows: sequence: the order the images were presented in for each participant; stim: picture ID; TrialGroup: 1-5 Morphtype, 6-10 background (1=LW,2=BE,3=C,4=B3E,5=SW); ITI_ms: in between Trial time, in ms (according to the computer clock); RT: Time needed to reply (until key was pressed); correct: 1=correct, 0=wrong; age: participant´s age; sex: participant´s sex; height_cm: participant´s height. Can be used as a proxy for distance to screen (arm length distance was required); completionCode: individual code given to each participant (can be used as participant ID). Some participants' heights were implausibly large or small and must have been entered incorrectly; for these individuals, values have been replaced with "NaN."
Code/software
A text editor or spreadsheet program are needed to view the data files. MATLAB is needed to view and run the code.