TY - JOUR
T1 - LEPY
T2 - A Python pipeline for automated trait extraction from standardised Lepidoptera images
AU - Correa-Carmona, Yenny
AU - Böttger, Dennis
AU - Korsch, Dimitri
AU - Holzmann, Kim L.
AU - Alonso-Alonso, Pedro
AU - Pinos, Andrea
AU - Yon, Felipe
AU - Keller, Alexander
AU - Steffan-Dewenter, Ingolf
AU - Bodesheim, Paul
AU - Peters, Marcell K.
AU - Brehm, Gunnar
N1 - Publisher Copyright:
© 2026 The Author(s).
PY - 2026/5
Y1 - 2026/5
N2 - We present LEPY, a free and openly available Python-based pipeline for the automated extraction and analysis of morphological and colour traits, from mounted specimens of Lepidoptera (butterflies and moths). The pipeline uses an automatically detected scale bar for accurate morphological measurements, together with image segmentation that separates the specimen from the background, with users able to pre-select from a set of segmentation models. We designed LEPY to be user-friendly and reproducible, ensuring efficient and consistent analysis of large image datasets. The pipeline also supports the integration of ultraviolet (UV) photographs for improved colour analysis, an innovative feature rarely available in existing trait-analysis tools. LEPY computes morphological traits such as body length, forewing length, and specimen area. It also extracts colour traits including hue, saturation, intensity from the red, green, and blue (RGB) channels, as well as brightness, contrast, chromaticity, and luminance from both RBG and UV channels. The pipeline uses the data to calculate colour diversity with the Shannon index, exports results in a structured, machine-readable format, and it also generates visual summaries of each image pair. We tested LEPY on different moth groups spanning a wide range of body sizes and colouration patterns. As an ecological case study, we applied the pipeline to complete datasets of Sphingidae and Saturniidae collected along an elevational gradient in the Peruvian Andes. The resulting trait data revealed taxon-dependent morphological and colour responses to elevation, thereby demonstrating LEPY's utility for analysing large-scale trait datasets. LEPY provides a robust and fully automated approach for the analysis of morphological and colour traits in Lepidoptera, supporting ecological and evolutionary research. Its scalability and ability to generate standardised, high-resolution trait datasets make it a valuable tool for biodiversity monitoring, macroecological research, and the development of global trait databases.
AB - We present LEPY, a free and openly available Python-based pipeline for the automated extraction and analysis of morphological and colour traits, from mounted specimens of Lepidoptera (butterflies and moths). The pipeline uses an automatically detected scale bar for accurate morphological measurements, together with image segmentation that separates the specimen from the background, with users able to pre-select from a set of segmentation models. We designed LEPY to be user-friendly and reproducible, ensuring efficient and consistent analysis of large image datasets. The pipeline also supports the integration of ultraviolet (UV) photographs for improved colour analysis, an innovative feature rarely available in existing trait-analysis tools. LEPY computes morphological traits such as body length, forewing length, and specimen area. It also extracts colour traits including hue, saturation, intensity from the red, green, and blue (RGB) channels, as well as brightness, contrast, chromaticity, and luminance from both RBG and UV channels. The pipeline uses the data to calculate colour diversity with the Shannon index, exports results in a structured, machine-readable format, and it also generates visual summaries of each image pair. We tested LEPY on different moth groups spanning a wide range of body sizes and colouration patterns. As an ecological case study, we applied the pipeline to complete datasets of Sphingidae and Saturniidae collected along an elevational gradient in the Peruvian Andes. The resulting trait data revealed taxon-dependent morphological and colour responses to elevation, thereby demonstrating LEPY's utility for analysing large-scale trait datasets. LEPY provides a robust and fully automated approach for the analysis of morphological and colour traits in Lepidoptera, supporting ecological and evolutionary research. Its scalability and ability to generate standardised, high-resolution trait datasets make it a valuable tool for biodiversity monitoring, macroecological research, and the development of global trait databases.
KW - Colour analysis
KW - Computer vision
KW - Deep learning
KW - Image segmentation
KW - Morphological traits
KW - Ultraviolet imaging
UR - https://www.scopus.com/pages/publications/105032201987
U2 - 10.1016/j.ecoinf.2026.103680
DO - 10.1016/j.ecoinf.2026.103680
M3 - Artículo
AN - SCOPUS:105032201987
SN - 1574-9541
VL - 95
JO - Ecological Informatics
JF - Ecological Informatics
M1 - 103680
ER -