DOI: 10.5061/dryad.djh9w0w8b
title: Data from: Dorsoventral comparison of intraspecific variations in the butterfly wing pattern using a convolutional neural network

description: Butterfly wing patterns exhibit notable differences between the dorsal and
 ventral surfaces, and morphological analyses of them have provided
 insights into the ecological and behavioural characteristics of wing
 colour patterns. Conventional methods for dorsoventral comparisons are
 constrained by the need for homologous patches or shared features between
 two surfaces, limiting their applicability across species. We used a
 convolutional neural network (CNN)-based analysis, which can compare
 images of the two surfaces without focusing on homologous patches or
 features, to detect dorsoventral bias in intraspecific variations: sexual
 dimorphism and female-limited mimetic polymorphism (FMP). Using specimen
 images of 29 species, we first showed that the level of sexual dimorphism
 calculated by CNN-based analysis corresponded well with traditional
 assessments of sexual dissimilarity, demonstrating the validity of the
 method. Dorsal biases were widely detected in sexual dimorphism,
 suggesting that the conventional hypothesis of dorsally biased sexual
 selection can be supported in a broader range of species. In contrast, the
 FMP showed no significant bias, indicating the importance of both surfaces
 in mimicry. Our study demonstrates the potential versatility of CNN in
 comparing wing patterns between the two surfaces, while providing broader
 insights into the relationship between dorsoventrally different selections
 and dorsoventral biases in intraspecific variations.
description: # Dorsoventral comparison of intraspecific polymorphisms in the butterfly
 wing pattern using a convolutional neural network
 [https://doi.org/10.5061/dryad.djh9w0w8b](https://doi.org/10.5061/dryad.djh9w0w8b) ## Dataset (Butterfly specimen image dataset from "Suguru Igarashi Insect Collection") #### File: butterflies\_dorsal\_ventral.zip **Description:** Butterfly specimen images from 29 species observed in the Yaeyama Islands, Japan, were photographed from a large butterfly specimen dataset ["Suguru Igarashi Insect Collection"](https://umdb.um.u-tokyo.ac.jp/DEntomology/IgarashiInsect1/en/index.php), stored in the University Museum, The University of Tokyo (UMUT). Dorsal and ventral surfaces were photographed for each individuals. Please note that the images used in the analysis for the associated paper that are included in the preprint (DOI: [10.1101/2024.08.01.606114](https://www.biorxiv.org/content/10.1101/2024.08.01.606114v1)) have been removed, as they are not compatible with the CC0 license waiver required by Dryad. Please cite our associated journal paper in any reference to these images. #### File: Table\_S2.xlsx **Description:** Supplementary table 2. The names of species and other information about sex and polymorphism for each photographed individual. The "Image filename" corresponds to the filenames in butterflies_dorsoventral_comparison.zip. ## Code (PerceptualSimilarity-for-butterfly) The code to obtain LPIPS distance between input images. ### Dependencies * Python 3.5 or later ### Quick Start 1. Download the zip and change your working directory to the repo with: 'cd PerceptualSimilarity-for-butterfly' 2. Install the required python 3 packages with: 'pip install -r ./requirements.txt' 3. To run the code with sample dataset, run 'python3 lpips_from_list.py -dir "./imgs/sample_images/" -list "./lists/sample_images.csv" -res "./results/results_sample_images.csv"' 4. The calculated LPIPS distances will be saved in 'PerceptualSimilarity-for-butterfly/results' ### Usage run python3 lpips_from_list.py from the directory it is located The following options are required: '-dir' specifies the path of the directory containing input images '-list' specifies the name of the csv file which contains the file names of all pairs you want to calculate the distance '-res' specifies the name of the output csv file Please cite the data as: Our paper for the use of this repository and the application of this technique for butterflies' wing color pattern analysis: Dorsoventral comparison of intraspecific variations in the butterfly wing pattern using a convolutional neural network. [https://doi.org/10.1101/2024.08.01.606114](https://doi.org/10.1101/2024.08.01.606114) Zhang et al. (2018)'s paper for the base repository: [https://github.com/richzhang/PerceptualSimilarity](https://github.com/richzhang/PerceptualSimilarity) [https://richzhang.github.io/PerceptualSimilarity/](https://richzhang.github.io/PerceptualSimilarity/) Zhang et al. 2018 for perceptual similarity code.