LEPY: A Python-Based Pipeline for Automated Morphological Trait Analysis of Lepidoptera Images
Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
1. We present LEPY, a Python-based pipeline for automating the extraction and analysis of morphological traits, including structural and colour properties, from mounted Lepidoptera specimens. It uses a U-Net neural network for image segmentation and a scale bar for precise measurements. LEPY is designed to be easy and reproducible, ensuring efficient and consistent analysis of large Lepidoptera image datasets. It also supports the integration of UV photographs for enhanced colour analysis. 2. LEPY computes structural traits, including body and wing length and area, and colour characteristics such as hue, saturation, and intensity, which are stored in a structured format (CSV) for easy evaluation. It also provides distribution metrics that describe the brightness and dynamic range/contrast, chromaticity, and luminance for four colour channels (R, G, B, and UV). Data from all channels are integrated to calculate colour diversity using the Shannon index. A visual summary of each image pair, including false colour images, is also provided. 3. We validated LEPY using data from Sphingidae and Saturniidae moths, known for their contrasting traits, which were sampled along a complete elevational gradient in the Peruvian Andes. In both families, forewing length increased with elevation. As expected, Sphingidae had smaller wing areas than Saturniidae despite their longer forewings. The brightness of colours decreased with elevation in both families, and Sphingidae were generally darker than Saturniidae. The dynamic range/contrast varied among species but was uncorrelated to elevation. 4. LEPY is a powerful tool for studying key Lepidoptera traits. It integrates advanced computer vision and neural network methods with automated measurements, supporting ecological and evolutionary research. It also offers new possibilities for analysing Lepidoptera traits along gradients and responses to environmental changes.