Deep Learning on field photography reveals the morphometric diversity of Colombian Freshwater Fish | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Deep Learning on field photography reveals the morphometric diversity of Colombian Freshwater Fish Jose Luis Poveda-Cuellar, David Morantes-Duarte, Fabio Martínez-Carrillo, and 3 more This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-6552537/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Neotropical freshwater fish are among the most morphologically diverse vertebrates, but their study has long depended on preserved specimens, limiting our understanding of their natural body shapes due to preservation-induced distortions. Field photography provides a powerful, noninvasive alternative to capture fish morphology as it occurs in nature. However, automatically extracting accurate shape information from these images remains a major challenge, especially for highly diverse taxa. Here, we present an AI-based workflow that integrates Segment Anything, to automate fish segmentation and shape extraction from field photographs. We applied this workflow to CavFish-Colombia, a curated dataset of 1,749 images representing 393 Colombian freshwater fish species, obtained using the PhotaFish standardized imaging system. Achieving more than 97% segmentation accuracy, our workflow enables precise and consistent extraction of natural fish body shapes. We provide the first structured morphospace of Colombian freshwater fish based on natural body shapes, quantified through descriptors such as area, perimeter, and invariant moments. This morphospace reveals distinct gradients in body size and contour complexity, spanning from large, robust species with rounded forms to small, elongate species related to locomotion and habitat use. Our results demonstrate that AI-driven field photograph analysis can transform large-scale morphological studies, delivering accurate, rapid, and scalable data for biodiversity evaluations, functional trait analyses, and ecological research. This noninvasive morphological monitoring, directly from field images, opens new opportunities to assess fish morphology and analyze shape variation as it naturally occurs, capturing more accurate representations of living specimens. Fish morphology foundation models field photography image-based morphometrics PhotaFish system Figures Figure 1 Figure 2 Figure 3 Figure 4 Introduction Freshwater fishes are one of the most diverse vertebrate groups globally (Tonella et al. 2023 ). Colombia hosts approximately 1,682 species in several major hydrographic regions, including the Amazon, Orinoco, Caribbean, Magdalena-Cauca, and Pacific basins (DoNascimiento et al. 2024 ). This notable biodiversity is crucial to maintaining the ecological integrity of freshwater ecosystems, serving as bioindicators of environmental health and contributing to essential processes such as nutrient cycling, habitat structuring, and trophic interactions (Pelicice et al. 2023 ). Moreover, this rich biodiversity is accompanied by high morphological diversity. Freshwater fish exhibit a wide range of shapes, sizes, and functional traits linked to various strategies for locomotion, feeding, reproduction, and habitat use strategies (Gatz 1979 ; Winemiller 1991 ). Understanding this morphological diversity is crucial to assessing functional adaptations, species interactions, and the evolutionary processes that shape freshwater fish communities (Su et al. 2019 ). However, accurately capturing the morphological diversity of freshwater fish requires innovative measurement techniques that overcome the limitations of traditional morphometry (Saleh et al. 2023 ). Traditional methods, relying on manual measurements or landmark-based geometric morphometrics (Claude 2008 ), are time-consuming, prone to measurement errors, and require physical handling of specimens (Saleh et al. 2023 ). Furthermore, the use of preserved specimens introduces biases due to morphological distortions caused by fixation and preservation processes (Barragán et al. 2024 ), because alteration complicate species comparisons and ecological interpretations (Martinez et al. 2013 ). Therefore, utilizing living specimens (Sotola et al. 2019 ; Barragán et al. 2024 ) or capturing field photographs (García-Melo et al. 2019 ; Petrellis 2021 ) is recommended preserve the natural shape of the organisms for morphometric analyzes. Field photography has become a crucial tool in ichthyological research, offering a noninvasive and standardized approach to capturing taxonomically informative images of live fish (García-Melo et al. 2019 ). That is, advances in field photography systems (Sabaj Pérez 2009 ; García-Melo et al. 2019 ), now enable researchers to obtain high-resolution images with minimal handling, significantly reducing stress and mortality while preserving the natural colors, meristic traits, and morphometric characteristics of the specimens. However, unlike other vertebrates, fish remain among the least photographed organisms in the wild, largely due to the challenges of observing them in their natural habitats (García-Melo et al. 2019 ). The integration of artificial intelligence (AI) tools, particularly computer vision and machine learning, offers a promising solution. AI-powered methods automate morphometric trait measurements, increasing the scalability and efficiency of data collection while reducing the need for manual processing (Ou et al. 2023 ; Bakış et al. 2023 ). These methods mainly focus on two main tasks: detecting key anatomical landmarks and segmenting the fish body from an image. Landmark detection uses AI models to identify specific reference points, such as the snout, eye, dorsal fin base and tail, enabling the measurement of traits such as body length, height, and head size (Bakış et al. 2023 ; Saleh et al. 2023 ). This process relies on deep learning techniques, including artificial neural networks (Bakış et al. 2023 ), convolutional neural networks (Tseng et al. 2020 ) and Mobile Fish Landmark Detection Network (Saleh et al. 2023 ), which incorporates elements of transformer-based architectures for improved efficiency. The second key task, body segmentation, allows AI to automatically outline the shape of the fish, facilitating the extraction of measurements such as total length, body width, and features of the tail and eyes (Fernandes et al. 2020 ; Ariede et al. 2023 ). Deep learning models like Mask R-CNN, SegNet and U-Net (Fernandes et al. 2020 ; Yu et al. 2020 ) have been widely used for this purpose, providing high precision while reducing errors from manual tracing. Despite these advances, current AI-based methods present several limitations that affect their broad applicability and effectiveness. Their reliance on large annotated datasets for training can be a significant difficulty (Zhuang et al. 2021 ). Although there are annotated datasets exist, such as DeepFish (Garcia-d’Urso et al. 2022 ), and FishAir (Bakış et al. 2023 ), they may not adequately represent the diversity of Colombian freshwater fish, such supervised datasets are limited to code the whole variability of fish that should be fed to code effective learning models (Ariede et al. 2023 ). Furthermore, many existing AI models are optimized for a limited range of species and morphometric traits (Yu et al. 2020 ; Han et al. 2022 ), often focusing on commercially important marine fish. This raises concerns about their applicability to the diverse and morphologically variable freshwater fish communities found in the Neotropics. To address these limitations, the Segment Anything Model (SAM) (Kirillov et al. 2023 ) presents a promising alternative for automated segmentation. Foundational models have gained significant attention in AI research as large-scale, self-supervised learning frameworks capable of extracting generalizable representations without the need for extensive labeled datasets (Schneider et al. 2024 ). These models operate under unsupervised and weakly supervised training paradigms, allowing them to adapt to diverse contexts with high variability. SAM, trained on a vast data set containing more than 1 billion object masks derived from 11 million high-quality images (Kirillov et al. 2023 ), has demonstrated remarkable generalization capabilities across a wide range of biological taxa, effectively delineating anatomical structures such as fins, heads, and body contours (Bakış et al. 2023 ). However, its application to Neotropical freshwater fish remains largely unexplored, and the accuracy and ecological relevance of SAM-generated segmentations for morphometric analyses require rigorous validation. This study introduces a novel framework for the automated characterization of Colombian freshwater fish, leveraging ensembled foundational models designed to enhance generalization capabilities and operate effectively in alternative, noncontrolled environments. Using field photography of live fish, this research captures natural shapes unaffected by preservation distortions, ensuring a more accurate representation of morphological diversity. Additionally, by harnessing the power of ensemble foundational models, this study seeks the automated quantification of morphometric traits in highly diverse freshwater fish assemblages, providing an ecologically relevant basis for ichthyological research. Likewise, the computed geometric moments allow quantitative measurement of morphometry in animals, bringing an explainable analysis in the selected cohort. Considering the methodology introduced, this work can potentially be extended to other species and animals. Materials and Methods CavFish-Colombia data set The Visual Catalog of Freshwater Fish in Colombia (CavFish-Colombia) (https://cavfish.unibague.edu.co) is an extensive image database that includes more than 1,749 field photographs representing approximately 393 (23% checklist of Colombia Fish) freshwater fish species in Colombia's main hydrographic basins, including the Magdalena-Cauca, Chocó Biogeográfico, Orinoco and Amazon regions. This catalogue uniquely captures fish in their natural environments and, as the only field photography database with photographic records dating back more than 10 years of freshwater fish in the Andes and Amazon regions, highlights Colombia's biodiversity, positioning the country as one of the richest in fish species worldwide. All images were obtained according to Colombian regulations and permits for biological collections. Image Acquisition and Standardization CavFish were obtained using the Photafish system (García-Melo et al. 2019), a standardized field photography set-up designed for ecological studies. All photographs were taken of live fish inside a portable aquarium, using either a white or black background, with or without a scale rule, under consistent lighting conditions. The cameras (Canon EOS 70D, ILCE-7M3, ILCE-7RM4A, ILCE-6000) provided high-resolution images. Each image was accompanied by detailed camera metadata, including parameters such as approximate focus distance, image size, megapixels, field of view (FOV), focal length, sensor dimensions, and crop factor. Additionally, species identification was conducted by expert ichthyologists, and species names were standardized and classified according to their respective families, following Checklist Colombia V.2.17 (DoNascimiento et al. 2024). The size of the fish was estimated in millimeters by converting the measurements of the pixels using a scale rule (10 mm) present in the images, determining the number of pixels corresponding to 10 mm. This ratio enabled for accurate pixel-to-millimeter conversion. For images without a scale rule, size estimation was based on camera metadata, including field of view (FOV), sensor size, focus distance, and crop factor. The FOV in millimeters was derived from the distance of the object and the FOV in radians, while its height was determined using the sensor’s aspect ratio. Then, the pixel-to-millimeter conversion factor was calculated by dividing the FOV dimensions by the image resolution in pixels. Finally, the size of the fish was estimated by multiplying the number of pixels occupied by the fish by the corresponding conversion factor. Data Processing Pipeline Techniques for segmenting general objects in computer vision were herein adapted to segment fish from field photographs using deep learning models, and extracting relevant morphometric descriptors for further analysis were employed. These descriptors allow for a comprehensive understanding of the morphometric variation within fish species, which is essential for ecological research and biodiversity studies (Fig. 1). The method can be divided into four major steps: (1) segmentation of fish images, (2) morphometric validation, (3) extraction of morphometric descriptors, and (4) analysis of morphometric diversity. 1. Segmentation of fish The segmentation process of fish images is achieved using a two-step pipeline incorporating two deep learning models. Grounding DINO (Liu et al. 2024) and the SAM (Kirillov et al. 2023). These models allow for automatic fish identification and precise shape delineation in images, a crucial step for morphometric analyses. Automatic delineation with Grounding DINO, an object detection model that identifies and coarsely bounds the fish shape into a rectangle within an image by combining two sources of information: text-based descriptions (e.g., the word "fish") and visual features extracted from the image. It should be noted that, in this work, the fish localization is mainly related to visual features, following unique and general prompts that avoid any interference in the final results. To analyze visual features, the DINO foundational foundation is based on an ensemble architecture of transformer modules. Each transformer splits the image into a set of subregions, which preserve spatial information with positional embeddings analyzed through attention mechanism. In AI, such attention mechanisms have demonstrated strong capabilities to recover complex and nonlocal patterns, allowing to be more efficient in training tasks, i.e., the localization of objects. Each transformer module is then coupled in series, extracting from coarse-to-fine image features such as shapes, texture, and color patterns. Thus, the grounding DINO model achieves a precise localization of fishes, being invariant to scale, magnitude and any geometric transformation of fish observation into the image. To improve the localization ability, Grounding-DINO was fine-tuned using the FishNet dataset (Khan et al. 2023), which includes 94,532 images from 463 fish families captured in diverse orientations, habitats, and environmental conditions. Optimization used predefined parameters, including image scaling (400–600 px) to preserve detail while minimizing distortion. Feature extraction used a Swin-T-based encoder with spatial corrections, plus a 6-layer transformer network to focus on key regions. Training lasted 30 epochs with AdamW, adjusting learning rates for stability and to prevent overfitting. Once detected, Grounding-DINO outputs a bounding box defining the segmentation region. For morphometric analysis, the SAM isolates the fish from the background to achieve a precise segmentation of the fish body. A key advantage of SAM is its prompt-based adaptability, allowing it to segment objects in new image types without requiring additional training. For this, SAM operates through three main components: the prompt encoder, the image encoder, and the image decoder. In this case, the prompt encoder did not affect the final segmentation of the fish, using the same prompts on the inputs. In such a case, we are interested to fully carry out visual fish processing. The bounding boxes produced by Grounding DINO are first processed by the Prompt Encoder, which interprets them as instructions for segmentation. The image encoder then extracts relevant features from the entire image, capturing information about texture, shape, and contrast. Similarly to the basic DINO, the SAM model incorporates an encoder with multiple transformer modules. From the set of ensemble encoder transformers are output embedding vectors that are complex descriptors with the most salient image features. These vectors are mapped to a decoder, also formed by ensembles of transformers but dedicated to retrieving segmentation. The image decoder generates a precise segmentation mask, effectively isolating the fish from other objects in the image. Additionally, to enhance segmentation quality and ensure seamless, well-defined boundaries, morphological transformations, such as opening and closing, are applied. These operations effectively eliminate gaps and discontinuities within the masks, smooth the segmented regions, and remove small artifacts, resulting in a more precise and continuous representation of the fish body. 2. Morphometric Validation 2.1 Manual Annotations for Segmentation Validation To ensure the precision of the segmentation results, 1,749 fish images were manually annotated using the Computer Vision Annotation Tool (CVAT). These annotations precisely delineated the fish boundaries, providing a high-fidelity representation of the shape of the fish and serving as a benchmark for comparison with SAM-generated segmentations. 2.2 Segmentation performance and statistical error assessment To quantify the accuracy of segmentations generated by the SAM, the established metrics were employed: Intersection of Union (IoU) and the Dice coefficient. The IoU measures the overlap between the predicted segmentation mask and the manually annotated ground-truth mask, normalized by their union. It is calculated as IoU = (Area of Intersection) / (Area of Union), where an IoU value of 1.0 indicates perfect overlap, signifying perfect segmentation, whereas a value of 0.0 indicates no overlap. The Dice coefficient, also known as the F1 score, assesses the similarity between the predicted masks and ground truth masks. It is calculated as Dice = 2 * (Area of Intersection) / (Area of Predicted + Area of Ground Truth), where a Dice coefficient of 1.0 indicates perfect agreement and 0.0 indicates no agreement. To characterize the distribution of segmentation errors, we modeled the IoU and Dice coefficient values using a Beta distribution. The Beta distribution is appropriate for modeling bounded data, such as the IoU and Dice coefficients, which range from 0 to 1. The mean and standard deviation of the Beta distribution were estimated for both metrics. To define an error range, the thresholds of three standard deviations from the mean were calculated. Segments with IoU or Dice values falling outside this range were flagged as potential errors, indicating significant deviations from the expected segmentation accuracy. This approach allowed for the identification of outliers and ensured that the segmentation results met predefined accuracy criteria. 2.3 Validation of Segmentation Accuracy Using Morphometric Metrics To further validate the accuracy of the SAM segmentations, the area (pixel count) and perimeter (pixel length) of the segmented fish were compared with the corresponding values obtained from the manual annotations. The agreement between predicted and observed morphometric values was assessed using the following metrics: Root Mean Square Error (RMSE), Coefficient of Determination (R²), and Residual Prediction Deviation (RPD). The root mean square error (RMSE) quantifies the average magnitude of the errors between the predicted and observed values, providing an absolute measure of prediction accuracy, and is calculated as RMSE = sqrt(mean((predicted - observed) 2 )). The coefficient of determination (R2) measures the proportion of variance in the observed values that is predictable from the predicted values, indicating the goodness of fit of the model. The residual prediction deviation (RPD) contextualizes the RMSE by comparing it to the standard deviation of the observed values, providing a measure of predictive performance relative to the variability of the data. It is calculated as RPD = standard deviation (observed) / RMSE. RPD values above 2 indicate acceptable predictive performance, while values above 3 suggest excellent performance (Helser et al. 2019). 3. Morphometric descriptor extraction To quantitatively analyze the shape and structural complexity of fish specimens from 2D images normalized to a millimeter size pixel, a comprehensive set of morphometric descriptors was extracted from the segmented images. The descriptors included area, perimeter, diameter, compactness, and Hu and Zernike moments (Hernández-Serna and Jiménez-Segura 2014). Normalization ensures that measurements are consistent and comparable across images, regardless of variations in the original image size or resolution. Evaluation of the results obtained from AI-based segmentation against established morphometric descriptors aimed to validate the accuracy and reliability of automated approaches to capture meaningful shape variations between diverse species of fish. Each descriptor captures specific aspects of fish morphology, providing a robust quantitative framework for comparing species with different body shapes and structural features. Detailed information on each descriptor is provided in Table 1, and visual representations are shown in Figure S1 in Supporting Information. Table 1 Morphometric descriptors for shape analysis in fish Descriptor Meaning Higher value Lower value Area Total region occupied by the fish in the image, approximating body size. Larger-bodied species with broad shapes and well-developed fins (e.g., Aequidens sp. Eigenmann & Bray, 1894). Smaller-bodied, streamlined species (e.g., Belonion dibranchodon Collette, 1966). Perimeter Length of the fish’s contour, reflecting the complexity of the boundary. Irregular outlines with extended fins, barbels, or odontodes (e.g., Ctenolucius hujeta (Valenciennes, 1850). Compact bodies with smooth contours (e.g., Synbranchus marmoratus Bloch, 1795). Diameter Estimated width assuming a circular equivalent shape based on area. Broad, deep-bodied species (e.g., Serrasalmus hollandi Eigenmann, 1915 ). Narrow, elongated species (e.g., Belonion dibranchodon Collette, 1966). Compactibility Relationship between area and perimeter, indicating shape roundness. More circular, symmetrical bodies (e.g., Heros severus Heckel, 1840). Elongated or irregularly shaped species (e.g., Farlowella mariaelenae Martín Salazar, 1964). Hu moments Shape descriptors invariant to translation, rotation, and scaling. Asymmetrical or highly elongated species (e.g., Synbranchus marmoratus Bloch, 1795). Symmetrical, compact species (e.g., Poptella compressa (Günther, 1864). Zernike moments Orthogonal shape descriptors capturing morphological complexity. Finer structural details like barbels, odontodes, or fin extensions (e.g., Poptella compressa (Günther, 1864). Streamlined, elongated bodies with fewer localized features (e.g., Triportheus sp.). 4. Morph ometric Diversity Analysis To analyze the morphometric variation between fish species in the dataset, Principal Component Analysis (PCA) was applied to the extracted descriptors. PCA reduces the dimensionality of the feature space, identifying the principal axes of variation, and enabling visualization of species clustering based on their morphometric characteristics. The analysis was performed on the correlation matrix. Before analysis, the distribution of each variable was examined and logarithmic x +1 transformations were applied to approximate normality. After transformation, the variables were standardized using z-transformation to ensure equal contribution to PCA. Furthermore, Pearson's correlation coefficient was calculated to assess the strength of the relationships between variables, helping to identify potential multicollinearity. To further explore the distribution of fish species within the morphospace, we applied Kernel Density Estimation (KDE) to the PCA-transformed data. To estimate the probability of occurrence for morphometric descriptors within a two-dimensional space defined by the first two principal component (PC) axes, two-dimensional KDE (Carmona et al. 2024) was utilized. Given that kernel density estimates are sensitive to the choice of smoothing bandwidth, unconstrained bandwidth selectors (Duong 2007) were employed to optimize the analysis. In this approach, the bandwidths for individual groups (e.g., taxonomic orders) were constrained by the overall bandwidth of the data set to ensure that the density estimates for each group remained within the morphometric descriptor space defined by the entire dataset. To visualize the probability distribution of trait combinations across the PCA space, contour plots were generated based on the two-dimensional kernel density distributions. These plots employed a color gradient and contour lines to represent the 0.5, 0.95, and 0.99 quantiles of the probability distribution, thus highlighting areas with the highest and lowest probability of occurrence for specific morphometric descriptors. All analyzes were performed on high performance workstations equipped with NVIDIA GPUs to accelerate deep learning model training and evaluation. The development and analysis were carried out using Jupyter Notebook in Google Colab, and deep learning frameworks such as TensorFlow and PyTorch (Paszke et al. 2019) were used for implementing the models. The extraction of morphometric features was performed using custom image processing scripts, while KDE and PCA analyses were carried out using the funspacef R package (Carmona et al. 2024). Results Segmentation process The segmentation process demonstrated high accuracy, with a mean Dice coefficient of 0.98 and a mean IoU of 0.97. Both metrics exhibited narrow distributions around their respective means. The standard deviation (SD) thresholds of the Dice coefficient were ± 1 SD (0.91), ± 2 SD (0.95) and ± 3 SD (0.97). Similarly, the IoU thresholds were: ±1 SD (0.89), ± 2 SD (0.93) and ± 3 SD (0.97) (Fig. 2 ). These results indicate consistent and highly accurate segmentation, achieving approximately 98% agreement with manual annotations. A statistical threshold analysis using a Beta distribution identified potential segmentation errors. Outliers, detected as values exceeding ± 3 SD from the mean, and Dice values below 0.91 and IoU values below 0.89 (Fig. 2 ). These outliers represented only 29 images, or 1.6% of the total dataset (Fig. S2), suggesting a low error rate for the segmentation process. Morphometrics Trait Extraction Accuracy The accuracy of the extracted morphometric measurements was assessed by comparing the observed and predicted values for the area of the fish (px²) and the perimeter (px). The prediction model exhibited strong predictive performance, with an R² of 0.995 for the area and 0.945 for the perimeter (Fig. 3 ), indicating excellent agreement between the predicted and observed values (see details in the supporting information, Fig. S3). The RMSE was calculated to quantify the accuracy of the prediction. The mean observed area was 2,922,600.91 px², with an RMSE of 162,464.64 px², representing 5.56% of the observed mean. The mean observed perimeter was 11,352.11 px, with an RMSE of 1,436.89 px, representing 12.66% of the observed mean. The higher relative RMSE for the perimeter may be attributed to increased sensitivity to boundary delineation or data variability. Given that area is a squared measure, small inaccuracies in boundary delineation result in larger cumulative errors compared to perimeter, which is a linear measure. RPD was calculated to contextualize RMSE relative to the variability of the observed values. The RPD for the area was 14.695, and for the perimeter was 3.721. These values indicate a high predictive capacity for both measurements, with greater precision in area estimation compared to perimeter (Fig. 3 ). Morphometric Diversity Analysis The PCA revealed that 69% of the morphometric variation between the Colombian freshwater fish species is captured within the first two principal components (PCs) (Fig. 4 , details in supporting information, Fig. S4, Table S1 ). This indicates that the primary trends in fish shape are effectively summarized by these two axes. PC1 represents a gradient of species with large body areas and rounded contours, such as Serrasalmus sp. (Characiformes), to those with smaller body areas and elongated contours, as exemplified by Synbranchus marmoratus (Synbranchiformes). This axis reflects fundamental differences in body shape and size. The PC2, primarily associated with perimeter, distinguishes species with large, irregular contours from those with smaller, symmetrical contours. This axis highlights the significance of proportionality and contour irregularity (see supporting information, Table S1 ). Species with higher perimeter values exhibit extensive fin structures, such as the well-developed dorsal fins in Aequidens and Geophagus , or elongated caudal fin rays seen in certain Siluriformes, particularly Loricariidae (e.g., Hypostomus ). On the contrary, species with lower perimeter values typically display reduced fin structures, with some fins absent, short, or highly reduced, as observed in certain Characidae and Trichomycteridae, where barbels and other appendages are minimal or absent. The morphometric space of Colombian freshwater fish is dominated by a single high-density node, suggesting that most species share around a common body shape (Fig. 2 A). This group, located near the origin of the principal component space, comprises species with moderate body size and flattened elliptical bodies with dorsoventrally or laterally. These species exhibit intermediate values for the Zernike moments and the Hu moments, reflecting relatively symmetric body shapes and moderate fin development. This group is predominantly composed of Characiformes, Siluriformes, Atheriniformes, and Cichliformes, including species such as Hemibrycon spp., Astroblepus spp., and Chaetostoma spp. Distinct patterns of trait-space occupancy were observed among Colombian freshwater fish taxa, as illustrated in the morphometric space (see details in Supporting Information, Fig. S5). Gymnotiformes and Synbranchiformes, such as Synbranchus marmoratus , occupy peripheral regions, characterized by highly specialized, elongated body shapes, as seen in electric knifefish and swamp eels. Blenniformes, such as Heros severus , occupy a localized region, distinguished by compact body shapes and irregular fin configurations, specifically, deep-bodied, laterally compressed profiles with elongated rays in the dorsal, caudal, and anal fins. Characiformes and Siluriformes, the most species-rich taxa, dominate the central regions, exhibiting broad variation in traits. This pattern is similarly observed in Acanthuriformes, Gobioformes, and Atheriniformes, though with fewer species analyzed. Their morphometric diversity ranges from rounded bodies with pronounced fins to elongated, streamlined shapes, for example, Serrasalmus hollandi or Herus severus and Ctenolucius hujeta or Astroblepus spp. Siluriformes exhibit the most expansive morphometric hotspot, encompassing a wide spectrum of streamlined and dorsoventrally flattened shapes. These results highlight a common predominant body shape among Colombian freshwater fish, while also revealing unique body shapes in morphospace, underscoring their morphometric specialization, as no species occupies identical regions. Discussion Morphometric diversity is fundamental to understanding evolutionary trajectories, ecological adaptations, and species conservation, as morphology directly influences locomotion, feeding strategies, and habitat use (Gatz 1979 ; Winemiller 1991 ). This study represents the first large-scale morphological characterization of Colombian freshwater fish, analyzing 393 species of the 1,711 species of Colombian freshwater fish using an automated deep learning approach. The methodology used integrates a two-step deep learning pipeline, with the SAM playing a key role in segmenting fish from field images. The ability of SAM to generalize across a wide range of body shapes, sizes, and pigmentation patterns makes it particularly valuable for large-scale studies (Kirillov et al. 2023 ). This segmentation enables the precise extraction of morphometric traits, including area, perimeter, and invariant moments. SAM achieved more than 97% segmentation accuracy, demonstrating its potential to replace manual segmentation and streamline morphometric analyzes. While deep learning applications in fish segmentation have predominantly focused on marine and commercially important species, freshwater taxa have been largely underrepresented. Models such as SegNet (Fernandes et al. 2020 ) and Mask R-CNN (Ariede et al. 2023 ) have been used in fewer than 60 freshwater species (Yu et al. 2020 ; Garcia-d’Urso et al. 2022 ; Rocha et al. 2024 ), primarily due to the scarcity of annotated image datasets. Traditional models require extensive manual labeling of body regions and keypoints (Hasegawa and Nakano 2024 ), limiting their adaptability to species with diverse morphologies and complex pigmentation patterns (Ariede et al. 2023 ). A major challenge in fish segmentation research is the difficulty of generalizing models to morphologically distinct species, particularly in complex environmental backgrounds (Zhuang et al. 2021 ). The SAM overcomes this limitation through its zero-shot segmentation capability, delineating fish morphology without requiring species-specific labeled data (Schneider et al. 2024 ). This capability has been validated across various biological groups, including marine objects (Hong et al. 2024 ), nematodes (Sigurðardóttir et al. 2024 ), and fish (Hasegawa and Nakano 2024 ), confirming its effectiveness. This is the first study to apply SAM to an image data set standardized and annotated by ichthyologists, demonstrating its suitability for freshwater fish morphology analysis. Despite its high accuracy, SAM exhibited segmentation errors in three main scenarios: misclassification of nonbiological elements when fish were positioned near aquarium walls or the water surface (see details in Supporting Information, Fig. S2 A–C), omission of fine morphological structures such as barbels and small fins were occasionally omitted (see details in Supporting Information, Fig. S2 E), and focusing on a single individual image containing multiple fish (see details in Supporting Information, Fig. S2 D). The high performance of SAM is largely attributed to the quality of the CavFish dataset and the PhotaFish system (García-Melo et al. 2019 ). Unlike databases such as FishBase (Froese and Pauly 2024 ) and FishNet (Khan et al. 2023 ), where image variability in specimen condition, background, lighting, and tank setup limits morphometric consistency, CavFish ensures taxonomically informative images that preserve natural shape and utilize controlled backgrounds. This minimizes segmentation variability and enhances model accuracy. Although SAM has not yet been tested on other datasets, as mentioned above, adopting standardized photographic protocols is strongly recommended to improve segmentation accuracy across diverse field conditions. The integration of SAM with CavFish allowed for a comprehensive evaluation of the morphometric diversity of Colombian freshwater fish, supporting previous findings on species-level morphological variation and its ecological significance. The PC1 primarily reflects differences in overall body proportions, delineating a morphospace from larger, more robust species with rounded contours to smaller, more streamlined shapes. PC2 captures variations in body perimeter, separating species with broader, irregular shapes, often associated with larger or more numerous fins, from those with more compact, symmetrical bodies where fin structures are reduced. These morphometric patterns align with previous studies (Conde-Saldaña et al. 2017 ; Caillon et al. 2018 ), which emphasize body elongation as a major driver of morphometric variability with significant implications for locomotion and habitat use. Elongated, fusiform, or streamlined body shapes are widely recognized adaptations for reducing drag and maximizing sustained swimming efficiency (Blake 2004 ; Langerhans 2009 ; Hincapié-Cruz and Márquez 2021 ). These traits improve energy-efficient locomotion, making them advantageous for species inhabiting open-water environments or high-flow habitats (Langerhans and Reznick 2010 ). In Colombian freshwater ecosystems, elongated species are primarily associated with the order Synbranchiformes, represented by a single species, Synbranchus marmoratus . Other species with this body shape include Ctenolucius hujeta (Characiformes), Farlowella mariaelenae (Siluriformes), and Potamorrhaphis spp. and Belonion dibranchodon (Atheriniformes). Body elongation also influences feeding strategies. For species relying on suction feeding, deeper-bodied forms typically exhibit a larger cross-sectional area of the epaxial musculature, which is a key determinant of suction pressure during feeding (Holzman et al. 2012 ). Additionally, highly elongated fish with numerous vertebrae tend to be more flexible (Yamada et al. 2009 ), and some of these species exhibit a fossorial lifestyle, residing among rocks or within sand and mud (Claverie and Wainwright 2014 ) such as Synbranchus marmoratus and Farlowella mariaelenae . In contrast, species with deeper, laterally compressed bodies and larger caudal peduncles are adapted for unsteady swimming, excelling in burst acceleration and maneuverability within structurally complex environments (Langerhans 2009 ). These traits are advantageous for rapid predator evasion and navigating through dense vegetation or heterogeneous habitats (Webb 1984 ; Schrank et al. 1999 ; Langerhans and Reznick 2010 ). Among Colombian freshwater fish, Heros severus and Aequidens spp. (Blenniiformes) and Thoracocharax spp. (Characiformes) exhibit these morphological features. This variation in body shape may have been the result of divergent selection pressures related to differences in water flow, dissolved oxygen availability, prey abundance, and elevation gradient (Crispo and Chapman 2010 ; Foster et al. 2015 ; Malato et al. 2017 ). The variation in fin morphology captured by PC2 further underscores the role of fins in body stabilization and locomotion. Previous ecomorphological studies of Neotropical fish have highlighted the functional importance of pectoral, pelvic, and caudal fins, particularly in relation to habitat exploitation under varying water velocities (Conde-Saldaña et al. 2017 ; Hulthén et al. 2024 ). Species with larger fins provide strong evidence that fin size plays a crucial role in generating escape momentum for predator avoidance (Gosline 1994 ; Hulthén et al. 2024 ). A notable example is Hypostomus spp. (Loricariidae), a group of Siluriformes commonly found in fast-flowing waters with rocky substrates (Conde-Saldaña et al. 2017 ). On the contrary, species with smaller fins, such as Knodus spp. or Astyanax spp. (Characiformes) may benefit from reduced drag and enhanced maneuverability (Blake 2004 ; Langerhans 2009 ). This adaptation facilitates unstable swimming behaviors, characterized by frequent changes in velocity and direction (Webb 1982 ), allowing them to forage efficiently for food resources such as insects beneath macrophytes and submerged roots, common elements in Colombian freshwater ecosystems. Beyond these ecological and functional interpretations, the observed body shape diversity also reflects deeper evolutionary processes. Natural selection drives morphological divergence through environmental adaptation, with water flow, habitat complexity, and predation pressure serving as the main forces shaping body plans suited to distinct ecological roles (Manna et al. 2017 ; Scharnweber 2020 ). Simultaneously, adaptive radiations, such as those seen in cichlids and loricariids, illustrate how the colonization of novel ecological niches can trigger rapid morphological diversification (Lujan and Armbruster 2012 ; Arbour and López-Fernández 2016 ). Furthermore, functional innovations, such as jaw specialization in Loricariidae or lower lip differentiation in Cyprinidae, have allowed certain lineages to access novel food resources, expanding their ecological breadth and contributing to morphospace expansion (Lujan and Armbruster 2012 ; Corse et al. 2015 ). Contour analysis from a single-lateral view, as presented in this study, offers valuable insights for trait-based ecological research and has great potential for broader applications in fish morphology studies. However, this method captures only the general shape of the body defined by the outline, omitting key structural traits such as the position of the pectoral fin and the placement of the eyes, which play critical functional roles in locomotion, respiration, and sensory perception (Caillon et al. 2018 ). To achieve a more comprehensive understanding of the morphospace diversity of Colombian freshwater fish, future research should address several challenges. First, it is essential to expand the representation of species to better encompass the remarkable richness of Colombian freshwater fish. Second, future studies should integrate additional localized morphometric traits, including eye position, body height, dentition, gill-raker and fin morphology, caudal peduncle dimensions, and head and mouth shape, to capture functionally relevant attributes associated with habitat use, locomotion, and trophic functions. Third, incorporating three-dimensional (3D) analyses of body structures would allow researchers to examine traits not visible in two-dimensional contours, such as body depth, while integrating coloration patterns could further reveal ecological and behavioral adaptations that are not captured by shape alone. Conclusions This study demonstrates the effectiveness of AI-driven segmentation using foundation models for large-scale morphometric analysis of Colombian freshwater fish, representing the first application of a deep learning pipeline to quantify morphological diversity directly from standardized field photography of live specimens. Using Segment Anything’s (SAM) zero-shot segmentation capability, our workflow achieves over 97% segmentation accuracy, accurately delineating fish morphology across a wide range of body shapes and sizes. These results establish SAM's capacity to replace manual segmentation, dramatically reducing annotation effort while preserving the precision required for quantitative morphological analyses. Beyond its technical advances, our study provides the first comprehensive assessment of the natural morphometric diversity of Colombian freshwater fish, using data derived from live images rather than preserved specimens. By identifying key gradients of body shape variation, such as body proportions, contour complexity, and fin morphology, closely related to locomotion and habitat use, we offer novel insights into the functional morphology of one of the most diverse geographical regions of freshwater fish. Importantly, our workflow enables the scalable, noninvasive, and standardized collection of morphometric data from living organisms in natural environments. This methodology offers a scalable and efficient solution for researchers. By facilitating rapid, high-throughput analyses of morphological traits, this contribution not only addresses current limitations in data availability but also opens avenues for the advancement of comparative morphology, functional ecology, evolutionary drivers of variation, and ecosystem monitoring in freshwater systems. Declarations Conflict of Interest statement The authors declare that they have no conflict of interest. Acknowledgements We thank the Field Museum of Chicago, WWF, Fundación Omacha, Universidad del Tolima, and Universidad de Ibagué for their support during expeditions enabling the photographic documentation of Colombian fish species. We also acknowledge the Universidad Industrial de Santander, particularly the School of Biology for their funding and assistance in this research. Likewise, Biomedical Imaging, Vision and Learning Laboratory, Biotechnology (Bivl 2 ab), Environmental Management Research Group (iBGA), and the CavFish Scientific Committee, for providing computational resources, species identification, and valuable insights. Special thanks to Marlon Camilo Herrera for his dedication at the Visual Science Lab. The authors wish to thank anonymous reviewers, and Editors for valuable revision to improve manuscripts. Authors' Contributions All authors contributed to the conception, design of the research, and interpretation of the results, integrating their perspectives according to their areas of expertise. Efforts were made to consider the scientific literature relevant to Colombia. Data analysis was performed by JLPC; DMD; and FMC, who also participated, along with JGM; SMR; and BR, in the review and preparation of the manuscript. Fish photographs were taken by JGM using the Photafish system and archived in the CavFish database. The manuscript was primarily written by JLPC and DMD. All authors approved the final manuscript. Funding This work was supported by the Universidad Industrial de Santander (UIS), Colombia, through a forgivable loan for doctoral studies in Biological Sciences awarded to Jose Luis Poveda Cuellar Availability of Data and Code Data, CavFish data set, supporting the findings of this study are available from the corresponding author upon reasonable request (https://cavfish.unibague.edu.co/catalogo). The morphometric database, and the R and Python code used for analysis will be publicly available on GitHub upon publication. References Arbour JH, López-Fernández H (2016) Continental cichlid radiations: functional diversity reveals the role of changing ecological opportunity in the Neotropics. Proc R Soc B 283:20160556. https://doi.org/10.1098/rspb.2016.0556 Ariede RB, Lemos CG, Batista FM, et al (2023) Computer vision system using deep learning to predict rib and loin yield in the fish Colossoma macropomum . Animal Genetics 54:375–388. https://doi.org/10.1111/age.13302 Bakış Y, Wang X, Altıntaş B, et al (2023) On Image Quality Metadata, FAIR in ML, AI-Readiness and Reproducibility: Fish-AIR example. BISS 7:e112178. https://doi.org/10.3897/biss.7.112178 Barragán KS, Chuctaya J, Escobar-Camacho D, et al (2024) Fresh vs. Preserved Specimens: Length‐Weight Relationships of Fishes from the Western Amazon (Napo Basin, Ecuador). Journal of Applied Ichthyology 2024:2430326. https://doi.org/10.1155/2024/2430326 Blake RW (2004) Fish functional design and swimming performance. Journal of Fish Biology 65:1193–1222. https://doi.org/10.1111/j.0022-1112.2004.00568.x Caillon F, Bonhomme V, Möllmann C, Frelat R (2018) A morphometric dive into fish diversity. Ecosphere 9:e02220. https://doi.org/10.1002/ecs2.2220 Carmona CP, Pavanetto N, Puglielli G (2024) funspace: An R package to build, analyse and plot functional trait spaces. Diversity and Distributions 30:e13820. https://doi.org/10.1111/ddi.13820 Claude J (2008) Morphometrics with R. Springer, New York Claverie T, Wainwright PC (2014) A Morphospace for Reef Fishes: Elongation Is the Dominant Axis of Body Shape Evolution. PLoS ONE 9:e112732. https://doi.org/10.1371/journal.pone.0112732 Conde-Saldaña CC, Albornoz-Garzón JG, López-Delgado EO, Villa-Navarro FA (2017) Ecomorphological relationships of fish assemblages in a trans-Andean drainage, Upper Magdalena River Basin, Colombia. Neotrop ichthyol 15:. https://doi.org/10.1590/1982-0224-20170037 Corse E, Tarkan AS, Emiroğlu Ö, et al (2015) Covariation of trophic and habitat‐related traits in chondrostoms ( C yprinidae): implications for repeated and diversifying evolutionary processes. Journal of Zoology 295:294–305. https://doi.org/10.1111/jzo.12212 Crispo E, Chapman LJ (2010) Geographic variation in phenotypic plasticity in response to dissolved oxygen in an African cichlid fish. J of Evolutionary Biology 23:2091–2103. https://doi.org/10.1111/j.1420-9101.2010.02069.x DoNascimiento C, Agudelo-Zamora HD, Bogota-Gregory JA (2024) Lista de especies de peces de agua dulce de Colombia/Checklist of the freshwater fishes of Colombia.v2.17. https://doi.org/10.15472/numrso Duong T (2007) ks : Kernel Density Estimation and Kernel Discriminant Analysis for Multivariate Data in R. J Stat Soft 21:. https://doi.org/10.18637/jss.v021.i07 Fernandes AFA, Turra EM, De Alvarenga ÉR, et al (2020) Deep Learning image segmentation for extraction of fish body measurements and prediction of body weight and carcass traits in Nile tilapia. Computers and Electronics in Agriculture 170:105274. https://doi.org/10.1016/j.compag.2020.105274 Foster K, Bower L, Piller K (2015) Getting in shape: habitat-based morphological divergence for two sympatric fishes: Habitat-based morphological divergence. Biol J Linn Soc Lond 114:152–162. https://doi.org/10.1111/bij.12413 Froese R, Pauly D (2024) FishBase.World Wide Web electronic publication. https://www.fishbase.se/search.php. Accessed 11 Aug 2024 Garcia-d’Urso N, Galan-Cuenca A, Pérez-Sánchez P, et al (2022) segmentation, classification,. Scientific Data García-Melo JE, García-Melo LJ, García-Melo JD, et al (2019) Photafish system: An affordable device for fish photography in the wild. Zootaxa 4554:. https://doi.org/10.11646/zootaxa.4554.1.4 Gatz AJ (1979) Community organization in fishes as indicated by morphological features. Ecology 60:711–718 Gosline WA (1994) Function and structure in the paired fins of scorpaeniform fishes. Environ Biol Fish 40:219–226. https://doi.org/10.1007/BF00002508 Han B, Hu Z, Su Z, et al (2022) Mask_LaC R-CNN for measuring morphological features of fish. Measurement 203:111859. https://doi.org/10.1016/j.measurement.2022.111859 Hasegawa T, Nakano D (2024) Robust Fish Recognition Using Foundation Models toward Automatic Fish Resource Management. JMSE 12:488. https://doi.org/10.3390/jmse12030488 Helser TE, Benson I, Erickson J, et al (2019) A transformative approach to ageing fish otoliths using Fourier transform near infrared spectroscopy: a case study of eastern Bering Sea walleye pollock ( Gadus chalcogrammus ). Can J Fish Aquat Sci 76:780–789. https://doi.org/10.1139/cjfas-2018-0112 Hernández-Serna A, Jiménez-Segura LF (2014) Automatic identification of species with neural networks. PeerJ 2:e563. https://doi.org/10.7717/peerj.563 Hincapié-Cruz JP, Márquez EJ (2021) Variación fenotípica de los peces Curimata mivartii (Characiformes: Curimatidae) y Pimelodus grosskopfii (Siluriformes: Pimelodidae) en hábitats lóticos y lénticos. Revista de Biología Tropical 69: Holzman R, Collar DC, Mehta RS, Wainwright PC (2012) An integrative modeling approach to elucidate suction-feeding performance. Journal of Experimental Biology 215:1–13. https://doi.org/10.1242/jeb.057851 Hong Y, Zhou X, Hua R, et al (2024) WaterSAM: Adapting SAM for Underwater Object Segmentation. JMSE 12:1616. https://doi.org/10.3390/jmse12091616 Hulthén K, Vinterstare J, Nilsson PA, Brönmark C (2024) Finotypic plasticity: Predator‐induced plasticity in fin size, darkness and display behaviour in a teleost fish. Journal of Animal Ecology 93:1135–1146. https://doi.org/10.1111/1365-2656.14130 Khan FF, Li X, Temple AJ, Elhoseiny M (2023) FishNet: A Large-scale Dataset and Benchmark for Fish Recognition, Detection, and Functional Trait Prediction. In: 2023 IEEE/CVF International Conference on Computer Vision (ICCV). IEEE, Paris, France, pp 20439–20449 Kirillov A, Mintun E, Ravi N, et al (2023) Segment Anything. In: 2023 IEEE/CVF International Conference on Computer Vision (ICCV). IEEE, Paris, France, pp 3992–4003 Langerhans RB (2009) Trade‐off between steady and unsteady swimming underlies predator‐driven divergence in Gambusia affinis . J of Evolutionary Biology 22:1057–1075. https://doi.org/10.1111/j.1420-9101.2009.01716.x Langerhans RB, Reznick DN (2010) Ecology and Evolution of Swimming Performance in Fishes: Predicting Evolution with Biomechanics. In: Domenici P, Kapoor BG (eds) Fish Locomotion, 1st edn. CRC Press, pp 200–248 Liu S, Zeng Z, Ren T, et al (2024) Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection Lujan NK, Armbruster JW (2012) Morphological and functional diversity of the mandible in suckermouth armored catfishes (Siluriformes: Loricariidae). Journal of Morphology 273:24–39. https://doi.org/10.1002/jmor.11003 Malato G, Shervette VR, Navarrete Amaya R, et al (2017) Parallel body shape divergence in the Neotropical fish genus Rhoadsia (Teleostei: Characidae) along elevational gradients of the western slopes of the Ecuadorian Andes. PLoS ONE 12:e0179432. https://doi.org/10.1371/journal.pone.0179432 Manna LR, Rezende CF, Mazzoni R (2017) Effect of body size on microhabitat preferences in stream-dwelling fishes. J Appl Ichthyol 33:193–202. https://doi.org/10.1111/jai.13320 Martinez PA, Berbel-Filho WM, Jacobina UP (2013) Is formalin fixation and ethanol preservation able to influence in geometric morphometric analysis? Fishes as a case study. Zoomorphology 132:87–93. https://doi.org/10.1007/s00435-012-0176-x Ou L, Liu B, Chen X, et al (2023) Automated Identification of Morphological Characteristics of Three Thunnus Species Based on Different Machine Learning Algorithms. Fishes 8:182. https://doi.org/10.3390/fishes8040182 Paszke A, Gross S, Massa F, et al (2019) PyTorch: An Imperative Style, High-Performance Deep Learning Library. In: Wallach H, Larochelle H, Beygelzimer A, et al. (eds) Advances in Neural Information Processing Systems. Curran Associates, Inc. Pelicice FM, Agostinho AA, Azevedo-Santos VM, et al (2023) Ecosystem services generated by Neotropical freshwater fishes. Hydrobiologia 850:2903–2926. https://doi.org/10.1007/s10750-022-04986-7 Petrellis N (2021) Measurement of Fish Morphological Features through Image Processing and Deep Learning Techniques. Applied Sciences 11:4416. https://doi.org/10.3390/app11104416 Rocha WS, Da Fonseca TFC, Watanabe CYV, et al (2024) Automatic measurement of fish from images using convolutional neural networks. Multimed Tools Appl. https://doi.org/10.1007/s11042-024-19180-1 Sabaj Pérez MH (2009) Photographic Atlas of Fishes of the Guiana Shield. Bulletin of the Biological Society of Washington 17:52–59. https://doi.org/10.2988/0097-0298-17.1.52 Saleh A, Jones D, Jerry D, Azghadi MR (2023) MFLD-net: a lightweight deep learning network for fish morphometry using landmark detection. Aquat Ecol 57:913–931. https://doi.org/10.1007/s10452-023-10044-8 Scharnweber K (2020) Morphological and trophic divergence of lake and stream minnows ( Phoxinus phoxinus ). Ecology and Evolution 10:8358–8367. https://doi.org/10.1002/ece3.6543 Schneider J, Meske C, Kuss P (2024) Foundation Models: A New Paradigm for Artificial Intelligence. Bus Inf Syst Eng 66:221–231. https://doi.org/10.1007/s12599-024-00851-0 Schrank AJ, Webb PW, Mayberry S (1999) How do body and paired-fin positions affect the ability of three teleost fishes to maneuver around bends? 77:203–210. https://doi.org/10.1139/z98-209 Sigurðardóttir AR, Sveinsdóttir HI, Schultz N, et al (2024) Sequence Segmentation of Nematodes in Atlantic Cod with Multispectral Imaging Data. Foods 13:2952. https://doi.org/10.3390/foods13182952 Sotola VA, Craig CA, Pfaff PJ, et al (2019) Effect of preservation on fish morphology over time: Implications for morphological studies. PLoS ONE 14:e0213915. https://doi.org/10.1371/journal.pone.0213915 Su G, Villéger S, Brosse S (2019) Morphological diversity of freshwater fishes differs between realms, but morphologically extreme species are widespread. Global Ecol Biogeogr 28:211–221. https://doi.org/10.1111/geb.12843 Tonella LH, Ruaro R, Daga VS, et al (2023) NEOTROPICAL FRESHWATER FISHES : A dataset of occurrence and abundance of freshwater fishes in the Neotropics. Ecology 104:e3713. https://doi.org/10.1002/ecy.3713 Tseng C-H, Hsieh C-L, Kuo Y-F (2020) Automatic measurement of the body length of harvested fish using convolutional neural networks. Biosystems Engineering 189:36–47. https://doi.org/10.1016/j.biosystemseng.2019.11.002 Webb PW (1984) Body Form, Locomotion and Foraging in Aquatic Vertebrates. American Zoologist 24:107–120 Webb PW (1982) Locomotor patterns in the evolution of actinopterygian fishes. American Zoologist 22:329–342 Winemiller KO (1991) Ecomorphological Diversification in Lowland Freshwater Fish Assemblages from Five Biotic Regions. Ecological Monographs 61:343–365. https://doi.org/10.2307/2937046 Yamada T, Sugiyama T, Tamaki N, et al (2009) Adaptive radiation of gobies in the interstitial habitats of gravel beaches accompanied by body elongation and excessive vertebral segmentation. BMC Evol Biol 9:145. https://doi.org/10.1186/1471-2148-9-145 Yu C, Fan X, Hu Z, et al (2020) Segmentation and measurement scheme for fish morphological features based on Mask R-CNN. Information Processing in Agriculture 7:523–534. https://doi.org/10.1016/j.inpa.2020.01.002 Zhuang F, Qi Z, Duan K, et al (2021) A Comprehensive Survey on Transfer Learning. Proc IEEE 109:43–76. https://doi.org/10.1109/JPROC.2020.3004555 Additional Declarations No competing interests reported. Supplementary Files SupportingInformationAE.docx Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-6552537","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":452837705,"identity":"d9831d03-f64f-4be7-a9b2-2fa11a92a2c8","order_by":0,"name":"Jose Luis Poveda-Cuellar","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA70lEQVRIiWNgGAWjYBACxgYY6wAQfwBiNnYStDA2zgBpYSbaPqCWZh4Qg5AW5vb2h48LKg7L8R0/Y/7Y5tc2eT5mBsYPH3PwOKznjLHxjDOHjSXP5Bg25/bdNmxjZmCWnLkNj5YZOWzSvG1piRsOgLT03GYEamFj5sWrJf35b6CW+g3n3xg2W/bctidCS4IZM2+bTYLBDaAtDD9uJxLWAvSL9IwzNoYzbzwrnNnbcDu5jZmxGa9fDIEh9rmgQkKe73zyhg8//ty2nd/efPDDR3xaGpAjgrENTDbgVg8E8gwocfcHr+JRMApGwSgYoQAArahUXVOl25EAAAAASUVORK5CYII=","orcid":"","institution":"Industrial University of Santander","correspondingAuthor":true,"prefix":"","firstName":"Jose","middleName":"Luis","lastName":"Poveda-Cuellar","suffix":""},{"id":452837706,"identity":"0b612c6e-fbb6-47b6-b294-29ef3117efec","order_by":1,"name":"David Morantes-Duarte","email":"","orcid":"","institution":"Industrial University of Santander","correspondingAuthor":false,"prefix":"","firstName":"David","middleName":"","lastName":"Morantes-Duarte","suffix":""},{"id":452837707,"identity":"1f80f395-2d83-4eaa-b36f-fe37e58aeb50","order_by":2,"name":"Fabio Martínez-Carrillo","email":"","orcid":"","institution":"Industrial University of Santander","correspondingAuthor":false,"prefix":"","firstName":"Fabio","middleName":"","lastName":"Martínez-Carrillo","suffix":""},{"id":452837708,"identity":"b7273525-d28d-47f3-9258-9a665c3e23ea","order_by":3,"name":"Jorge García-Melo","email":"","orcid":"","institution":"Universidad de Ibagué","correspondingAuthor":false,"prefix":"","firstName":"Jorge","middleName":"","lastName":"García-Melo","suffix":""},{"id":452837709,"identity":"e2326a02-db4d-4727-9b2c-4b138c9bafcf","order_by":4,"name":"Sergio Marchant","email":"","orcid":"","institution":"Industrial University of Santander","correspondingAuthor":false,"prefix":"","firstName":"Sergio","middleName":"","lastName":"Marchant","suffix":""},{"id":452837710,"identity":"ae051059-61e8-48ae-9349-e87af9c68e79","order_by":5,"name":"Björn Reu","email":"","orcid":"","institution":"Industrial University of Santander","correspondingAuthor":false,"prefix":"","firstName":"Björn","middleName":"","lastName":"Reu","suffix":""}],"badges":[],"createdAt":"2025-04-29 05:08:07","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-6552537/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-6552537/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":82167034,"identity":"0d97ca32-38b2-4e6d-b26d-450090be6ada","added_by":"auto","created_at":"2025-05-07 09:19:11","extension":"png","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":383625,"visible":true,"origin":"","legend":"\u003cp\u003eWorkflow depicting of the methodology: (1) Segmentation of fish images using DINO and SAM, (2) Morphometric Validation, (3) Morphometric descriptor extraction, and (4) Morphological diversity analysis\u003c/p\u003e","description":"","filename":"1.png","url":"https://assets-eu.researchsquare.com/files/rs-6552537/v1/6b4a02f8edf3ce24dec74270.png"},{"id":82167033,"identity":"a591edb6-ce77-43b2-9dbe-6444925f2c06","added_by":"auto","created_at":"2025-05-07 09:19:11","extension":"png","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":123770,"visible":true,"origin":"","legend":"\u003cp\u003eDistribution of Dice and IoU metrics for fish segmentation performance\u003c/p\u003e","description":"","filename":"2.png","url":"https://assets-eu.researchsquare.com/files/rs-6552537/v1/9741071573c8d79be65c4def.png"},{"id":82168764,"identity":"baf64390-145a-4225-8d21-fbeb55dd8003","added_by":"auto","created_at":"2025-05-07 09:35:11","extension":"png","order_by":3,"title":"Figure 3","display":"","copyAsset":false,"role":"figure","size":266711,"visible":true,"origin":"","legend":"\u003cp\u003eObserved versus predicted values for the 2D area and perimeter of fish. The red points indicate outlier segmentations and the green points indicate outlier perimeter values. The R² and RMSE values indicate the accuracy of the predictions.\u003c/p\u003e","description":"","filename":"3.png","url":"https://assets-eu.researchsquare.com/files/rs-6552537/v1/f05a78ec27c31027e0743a87.png"},{"id":82167044,"identity":"e96be579-fe1f-4e5e-940a-5707d9a7162b","added_by":"auto","created_at":"2025-05-07 09:19:11","extension":"png","order_by":4,"title":"Figure 4","display":"","copyAsset":false,"role":"figure","size":854536,"visible":true,"origin":"","legend":"\u003cp\u003eThe spectrum of morphometric diversity of Colombian freshwater fish. (A) Projection of Colombian freshwater fish (dots) onto the plane defined by the first two principal components (details in supporting information, Table S1). The color gradient represents the probability of species occurrence, from highest (red) to lowest (white), with contour lines marking the 0.5, 0.95, and 0.99 quantiles (see Methods, KDE). Red regions within the 0.50 probability threshold indicate morphometric hotspots. (B) Distribution of taxonomic orders within the morphospace.\u003c/p\u003e","description":"","filename":"4.png","url":"https://assets-eu.researchsquare.com/files/rs-6552537/v1/000cfb58fc12aaf59f4d9ea9.png"},{"id":82207749,"identity":"fb834e0d-67a0-465b-a073-12396afbb935","added_by":"auto","created_at":"2025-05-07 18:01:39","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":2275713,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-6552537/v1/ca563962-8f25-4d1e-a93b-08d0270b1dd9.pdf"},{"id":82169605,"identity":"6b187ef2-6067-4f7d-85d9-ad7e2c3914ae","added_by":"auto","created_at":"2025-05-07 09:43:11","extension":"docx","order_by":0,"title":"","display":"","copyAsset":false,"role":"supplement","size":662390,"visible":true,"origin":"","legend":"","description":"","filename":"SupportingInformationAE.docx","url":"https://assets-eu.researchsquare.com/files/rs-6552537/v1/a2fde4efee6ff1e31d8fceea.docx"}],"financialInterests":"No competing interests reported.","formattedTitle":"Deep Learning on field photography reveals the morphometric diversity of Colombian Freshwater Fish","fulltext":[{"header":"Introduction","content":"\u003cp\u003eFreshwater fishes are one of the most diverse vertebrate groups globally (Tonella et al. \u003cspan citationid=\"CR52\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). Colombia hosts approximately 1,682 species in several major hydrographic regions, including the Amazon, Orinoco, Caribbean, Magdalena-Cauca, and Pacific basins (DoNascimiento et al. \u003cspan citationid=\"CR13\" class=\"CitationRef\"\u003e2024\u003c/span\u003e). This notable biodiversity is crucial to maintaining the ecological integrity of freshwater ecosystems, serving as bioindicators of environmental health and contributing to essential processes such as nutrient cycling, habitat structuring, and trophic interactions (Pelicice et al. \u003cspan citationid=\"CR41\" class=\"CitationRef\"\u003e2023\u003c/span\u003e).\u003c/p\u003e \u003cp\u003eMoreover, this rich biodiversity is accompanied by high morphological diversity. Freshwater fish exhibit a wide range of shapes, sizes, and functional traits linked to various strategies for locomotion, feeding, reproduction, and habitat use strategies (Gatz \u003cspan citationid=\"CR20\" class=\"CitationRef\"\u003e1979\u003c/span\u003e; Winemiller \u003cspan citationid=\"CR56\" class=\"CitationRef\"\u003e1991\u003c/span\u003e). Understanding this morphological diversity is crucial to assessing functional adaptations, species interactions, and the evolutionary processes that shape freshwater fish communities (Su et al. \u003cspan citationid=\"CR51\" class=\"CitationRef\"\u003e2019\u003c/span\u003e). However, accurately capturing the morphological diversity of freshwater fish requires innovative measurement techniques that overcome the limitations of traditional morphometry (Saleh et al. \u003cspan citationid=\"CR45\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). Traditional methods, relying on manual measurements or landmark-based geometric morphometrics (Claude \u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e2008\u003c/span\u003e), are time-consuming, prone to measurement errors, and require physical handling of specimens (Saleh et al. \u003cspan citationid=\"CR45\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). Furthermore, the use of preserved specimens introduces biases due to morphological distortions caused by fixation and preservation processes (Barrag\u0026aacute;n et al. \u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e2024\u003c/span\u003e), because alteration complicate species comparisons and ecological interpretations (Martinez et al. \u003cspan citationid=\"CR38\" class=\"CitationRef\"\u003e2013\u003c/span\u003e). Therefore, utilizing living specimens (Sotola et al. \u003cspan citationid=\"CR50\" class=\"CitationRef\"\u003e2019\u003c/span\u003e; Barrag\u0026aacute;n et al. \u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e2024\u003c/span\u003e) or capturing field photographs (Garc\u0026iacute;a-Melo et al. \u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e2019\u003c/span\u003e; Petrellis \u003cspan citationid=\"CR42\" class=\"CitationRef\"\u003e2021\u003c/span\u003e) is recommended preserve the natural shape of the organisms for morphometric analyzes.\u003c/p\u003e \u003cp\u003eField photography has become a crucial tool in ichthyological research, offering a noninvasive and standardized approach to capturing taxonomically informative images of live fish (Garc\u0026iacute;a-Melo et al. \u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e2019\u003c/span\u003e). That is, advances in field photography systems (Sabaj P\u0026eacute;rez \u003cspan citationid=\"CR44\" class=\"CitationRef\"\u003e2009\u003c/span\u003e; Garc\u0026iacute;a-Melo et al. \u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e2019\u003c/span\u003e), now enable researchers to obtain high-resolution images with minimal handling, significantly reducing stress and mortality while preserving the natural colors, meristic traits, and morphometric characteristics of the specimens. However, unlike other vertebrates, fish remain among the least photographed organisms in the wild, largely due to the challenges of observing them in their natural habitats (Garc\u0026iacute;a-Melo et al. \u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e2019\u003c/span\u003e).\u003c/p\u003e \u003cp\u003eThe integration of artificial intelligence (AI) tools, particularly computer vision and machine learning, offers a promising solution. AI-powered methods automate morphometric trait measurements, increasing the scalability and efficiency of data collection while reducing the need for manual processing (Ou et al. \u003cspan citationid=\"CR39\" class=\"CitationRef\"\u003e2023\u003c/span\u003e; Bakış et al. \u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). These methods mainly focus on two main tasks: detecting key anatomical landmarks and segmenting the fish body from an image. Landmark detection uses AI models to identify specific reference points, such as the snout, eye, dorsal fin base and tail, enabling the measurement of traits such as body length, height, and head size (Bakış et al. \u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e2023\u003c/span\u003e; Saleh et al. \u003cspan citationid=\"CR45\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). This process relies on deep learning techniques, including artificial neural networks (Bakış et al. \u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e2023\u003c/span\u003e), convolutional neural networks (Tseng et al. \u003cspan citationid=\"CR53\" class=\"CitationRef\"\u003e2020\u003c/span\u003e) and Mobile Fish Landmark Detection Network (Saleh et al. \u003cspan citationid=\"CR45\" class=\"CitationRef\"\u003e2023\u003c/span\u003e), which incorporates elements of transformer-based architectures for improved efficiency. The second key task, body segmentation, allows AI to automatically outline the shape of the fish, facilitating the extraction of measurements such as total length, body width, and features of the tail and eyes (Fernandes et al. \u003cspan citationid=\"CR15\" class=\"CitationRef\"\u003e2020\u003c/span\u003e; Ariede et al. \u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). Deep learning models like Mask R-CNN, SegNet and U-Net (Fernandes et al. \u003cspan citationid=\"CR15\" class=\"CitationRef\"\u003e2020\u003c/span\u003e; Yu et al. \u003cspan citationid=\"CR58\" class=\"CitationRef\"\u003e2020\u003c/span\u003e) have been widely used for this purpose, providing high precision while reducing errors from manual tracing.\u003c/p\u003e \u003cp\u003eDespite these advances, current AI-based methods present several limitations that affect their broad applicability and effectiveness. Their reliance on large annotated datasets for training can be a significant difficulty (Zhuang et al. \u003cspan citationid=\"CR59\" class=\"CitationRef\"\u003e2021\u003c/span\u003e). Although there are annotated datasets exist, such as DeepFish (Garcia-d\u0026rsquo;Urso et al. \u003cspan citationid=\"CR18\" class=\"CitationRef\"\u003e2022\u003c/span\u003e), and FishAir (Bakış et al. \u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e2023\u003c/span\u003e), they may not adequately represent the diversity of Colombian freshwater fish, such supervised datasets are limited to code the whole variability of fish that should be fed to code effective learning models (Ariede et al. \u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). Furthermore, many existing AI models are optimized for a limited range of species and morphometric traits (Yu et al. \u003cspan citationid=\"CR58\" class=\"CitationRef\"\u003e2020\u003c/span\u003e; Han et al. \u003cspan citationid=\"CR22\" class=\"CitationRef\"\u003e2022\u003c/span\u003e), often focusing on commercially important marine fish. This raises concerns about their applicability to the diverse and morphologically variable freshwater fish communities found in the Neotropics.\u003c/p\u003e \u003cp\u003eTo address these limitations, the Segment Anything Model (SAM) (Kirillov et al. \u003cspan citationid=\"CR31\" class=\"CitationRef\"\u003e2023\u003c/span\u003e) presents a promising alternative for automated segmentation. Foundational models have gained significant attention in AI research as large-scale, self-supervised learning frameworks capable of extracting generalizable representations without the need for extensive labeled datasets (Schneider et al. \u003cspan citationid=\"CR47\" class=\"CitationRef\"\u003e2024\u003c/span\u003e). These models operate under unsupervised and weakly supervised training paradigms, allowing them to adapt to diverse contexts with high variability. SAM, trained on a vast data set containing more than 1\u0026nbsp;billion object masks derived from 11\u0026nbsp;million high-quality images (Kirillov et al. \u003cspan citationid=\"CR31\" class=\"CitationRef\"\u003e2023\u003c/span\u003e), has demonstrated remarkable generalization capabilities across a wide range of biological taxa, effectively delineating anatomical structures such as fins, heads, and body contours (Bakış et al. \u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). However, its application to Neotropical freshwater fish remains largely unexplored, and the accuracy and ecological relevance of SAM-generated segmentations for morphometric analyses require rigorous validation.\u003c/p\u003e \u003cp\u003eThis study introduces a novel framework for the automated characterization of Colombian freshwater fish, leveraging ensembled foundational models designed to enhance generalization capabilities and operate effectively in alternative, noncontrolled environments. Using field photography of live fish, this research captures natural shapes unaffected by preservation distortions, ensuring a more accurate representation of morphological diversity. Additionally, by harnessing the power of ensemble foundational models, this study seeks the automated quantification of morphometric traits in highly diverse freshwater fish assemblages, providing an ecologically relevant basis for ichthyological research. Likewise, the computed geometric moments allow quantitative measurement of morphometry in animals, bringing an explainable analysis in the selected cohort. Considering the methodology introduced, this work can potentially be extended to other species and animals.\u003c/p\u003e"},{"header":"Materials and Methods","content":"\u003cp\u003e\u003cstrong\u003eCavFish-Colombia data set\u0026nbsp;\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe Visual Catalog of Freshwater Fish in Colombia (CavFish-Colombia) (https://cavfish.unibague.edu.co) is an extensive image database that includes more than 1,749 field photographs representing approximately 393 (23% checklist of Colombia Fish) freshwater fish species in Colombia\u0026apos;s main hydrographic basins, including the Magdalena-Cauca, Choc\u0026oacute; Biogeogr\u0026aacute;fico, Orinoco and Amazon regions. This catalogue uniquely captures fish in their natural environments and, as the only field photography database with photographic records dating back more than 10 years of freshwater fish in the Andes and Amazon regions, highlights Colombia\u0026apos;s biodiversity, positioning the country as one of the richest in fish species worldwide. All images were obtained according to Colombian regulations and permits for biological collections.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eImage Acquisition and Standardization\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;CavFish were obtained using the Photafish system (Garc\u0026iacute;a-Melo et al. 2019), a standardized field photography set-up designed for ecological studies. All photographs were taken of live fish inside a portable aquarium, using either a white or black background, with or without a scale rule, under consistent lighting conditions. The cameras (Canon EOS 70D, ILCE-7M3, ILCE-7RM4A, ILCE-6000) provided high-resolution images. Each image was accompanied by detailed camera metadata, including parameters such as approximate focus distance, image size, megapixels, field of view (FOV), focal length, sensor dimensions, and crop factor. Additionally, species identification was conducted by expert ichthyologists, and species names were standardized and classified according to their respective families, following Checklist Colombia V.2.17 (DoNascimiento et al. 2024).\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eThe size of the fish was estimated in millimeters by converting the measurements of the pixels using a scale rule (10 mm) present in the images, determining the number of pixels corresponding to 10 mm. This ratio enabled for accurate pixel-to-millimeter conversion. For images without a scale rule, size estimation was based on camera metadata, including field of view (FOV), sensor size, focus distance, and crop factor. The FOV in millimeters was derived from the distance of the object and the FOV in radians, while its height was determined using the sensor\u0026rsquo;s aspect ratio. Then, the pixel-to-millimeter conversion factor was calculated by dividing the FOV dimensions by the image resolution in pixels. Finally, the size of the fish was estimated by multiplying the number of pixels occupied by the fish by the corresponding conversion factor.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eData Processing Pipeline\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eTechniques for segmenting general objects in computer vision were herein adapted to segment fish from field photographs using deep learning models, and extracting relevant morphometric descriptors for further analysis were employed. These descriptors allow for a comprehensive understanding of the morphometric variation within fish species, which is essential for ecological research and biodiversity studies (Fig. 1). The method can be divided into four major steps: (1) segmentation of fish images, (2) morphometric validation, (3) extraction of morphometric descriptors, and (4) analysis of morphometric diversity.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e1. \u0026nbsp; \u0026nbsp;Segmentation of fish\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe segmentation process of fish images is achieved using a two-step pipeline incorporating two deep learning models. Grounding DINO (Liu et al. 2024) and the SAM (Kirillov et al. 2023). These models allow for automatic fish identification and precise shape delineation in images, a crucial step for morphometric analyses. Automatic delineation with Grounding DINO, an object detection model that identifies and coarsely bounds the fish shape into a rectangle within an image by combining two sources of information: text-based descriptions (e.g., the word \u0026quot;fish\u0026quot;) and visual features extracted from the image. It should be noted that, in this work, the fish localization is mainly related to visual features, following unique and general prompts that avoid any interference in the final results. To analyze visual features, the DINO foundational foundation is based on an ensemble architecture of transformer modules. Each transformer splits the image into a set of subregions, which preserve spatial information with positional embeddings analyzed through attention mechanism. In AI, such attention mechanisms have demonstrated strong capabilities to recover complex and nonlocal patterns, allowing to be more efficient in training tasks, i.e., the localization of objects. Each transformer module is then coupled in series, extracting from coarse-to-fine image features such as shapes, texture, and color patterns. Thus, the grounding DINO model achieves a precise localization of fishes, being invariant to scale, magnitude and any geometric transformation of fish observation into the image.\u003c/p\u003e\n\u003cp\u003eTo improve the localization ability, Grounding-DINO was fine-tuned using the FishNet dataset (Khan et al. 2023), which includes 94,532 images from 463 fish families captured in diverse orientations, habitats, and environmental conditions. Optimization used predefined parameters, including image scaling (400\u0026ndash;600 px) to preserve detail while minimizing distortion. Feature extraction used a Swin-T-based encoder with spatial corrections, plus a 6-layer transformer network to focus on key regions. Training lasted 30 epochs with AdamW, adjusting learning rates for stability and to prevent overfitting. Once detected, Grounding-DINO outputs a bounding box defining the segmentation region.\u003c/p\u003e\n\u003cp\u003eFor morphometric analysis, the SAM isolates the fish from the background to achieve a precise segmentation of the fish body. A key advantage of SAM is its prompt-based adaptability, allowing it to segment objects in new image types without requiring additional training. For this, SAM operates through three main components: the prompt encoder, the image encoder, and the image decoder. In this case, the prompt encoder did not affect the final segmentation of the fish, using the same prompts on the inputs. In such a case, we are interested to fully carry out visual fish processing. The bounding boxes produced by Grounding DINO are first processed by the Prompt Encoder, which interprets them as instructions for segmentation. The image encoder then extracts relevant features from the entire image, capturing information about texture, shape, and contrast. Similarly to the basic DINO, the SAM model incorporates an encoder with multiple transformer modules. From the set of ensemble encoder transformers are output embedding vectors that are complex descriptors with the most salient image features. These vectors are mapped to a decoder, also formed by ensembles of transformers but dedicated to retrieving segmentation. The image decoder generates a precise segmentation mask, effectively isolating the fish from other objects in the image. Additionally, to enhance segmentation quality and ensure seamless, well-defined boundaries, morphological transformations, such as opening and closing, are applied. These operations effectively eliminate gaps and discontinuities within the masks, smooth the segmented regions, and remove small artifacts, resulting in a more precise and continuous representation of the fish body.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2.\u0026nbsp; \u0026nbsp;\u0026nbsp;Morphometric Validation\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2.1 Manual Annotations for Segmentation Validation\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eTo ensure the precision of the segmentation results, 1,749 fish images were manually annotated using the Computer Vision Annotation Tool (CVAT). These annotations precisely delineated the fish boundaries, providing a high-fidelity representation of the shape of the fish and serving as a benchmark for comparison with SAM-generated segmentations.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2.2 Segmentation performance and statistical error assessment\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eTo quantify the accuracy of segmentations generated by the SAM, the established metrics were employed: Intersection of Union (IoU) and the Dice coefficient. The IoU measures the overlap between the predicted segmentation mask and the manually annotated ground-truth mask, normalized by their union. It is calculated as IoU = (Area of Intersection) / (Area of Union), where an IoU value of 1.0 indicates perfect overlap, signifying perfect segmentation, whereas a value of 0.0 indicates no overlap. The Dice coefficient, also known as the F1 score, assesses the similarity between the predicted masks and ground truth masks. It is calculated as Dice = 2 * (Area of Intersection) / (Area of Predicted + Area of Ground Truth), where a Dice coefficient of 1.0 indicates perfect agreement and 0.0 indicates no agreement. To characterize the distribution of segmentation errors, we modeled the IoU and Dice coefficient values using a Beta distribution. The Beta distribution is appropriate for modeling bounded data, such as the IoU and Dice coefficients, which range from 0 to 1. The mean and standard deviation of the Beta distribution were estimated for both metrics. To define an error range, the thresholds of three standard deviations from the mean were calculated. Segments with IoU or Dice values falling outside this range were flagged as potential errors, indicating significant deviations from the expected segmentation accuracy. This approach allowed for the identification of outliers and ensured that the segmentation results met predefined accuracy criteria.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2.3 Validation of Segmentation Accuracy Using Morphometric Metrics\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eTo further validate the accuracy of the SAM segmentations, the area (pixel count) and perimeter (pixel length) of the segmented fish were compared with the corresponding values obtained from the manual annotations. The agreement between predicted and observed morphometric values was assessed using the following metrics: Root Mean Square Error (RMSE), Coefficient of Determination (R\u0026sup2;), and Residual Prediction Deviation (RPD). The root mean square error (RMSE) quantifies the average magnitude of the errors between the predicted and observed values, providing an absolute measure of prediction accuracy, and is calculated as RMSE = sqrt(mean((predicted - observed)\u003csup\u003e2\u003c/sup\u003e)). The coefficient of determination (R2) measures the proportion of variance in the observed values that is predictable from the predicted values, indicating the goodness of fit of the model. The residual prediction deviation (RPD) contextualizes the RMSE by comparing it to the standard deviation of the observed values, providing a measure of predictive performance relative to the variability of the data. It is calculated as RPD = standard deviation (observed) / RMSE. RPD values above 2 indicate acceptable predictive performance, while values above 3 suggest excellent performance (Helser et al. 2019).\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. \u0026nbsp; \u0026nbsp;\u003c/strong\u003e\u003cstrong\u003eMorphometric\u0026nbsp;descriptor extraction\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eTo quantitatively analyze the shape and structural complexity of fish specimens from 2D images normalized to a millimeter size pixel, a comprehensive set of morphometric descriptors was extracted from the segmented images. The descriptors included area, perimeter, diameter, compactness, and Hu and Zernike moments (Hern\u0026aacute;ndez-Serna and Jim\u0026eacute;nez-Segura 2014). Normalization ensures that measurements are consistent and comparable across images, regardless of variations in the original image size or resolution. Evaluation of the results obtained from AI-based segmentation against established morphometric descriptors aimed to validate the accuracy and reliability of automated approaches to capture meaningful shape variations between diverse species of fish. Each descriptor captures specific aspects of fish morphology, providing a robust quantitative framework for comparing species with different body shapes and structural features. Detailed information on each descriptor is provided in Table 1, and visual representations are shown in Figure S1 in Supporting Information.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eTable 1\u003c/strong\u003e Morphometric descriptors for shape analysis in fish\u003c/p\u003e\n\u003ctable border=\"1\" cellspacing=\"0\" cellpadding=\"0\" width=\"589\"\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 104px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eDescriptor\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 217px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eMeaning\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 132px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eHigher value\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 135px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eLower value\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 104px;\"\u003e\n \u003cp\u003eArea\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 217px;\"\u003e\n \u003cp\u003eTotal region occupied by the fish in the image, approximating body size.\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 132px;\"\u003e\n \u003cp\u003eLarger-bodied species with broad shapes and well-developed fins (e.g., \u003cem\u003eAequidens\u0026nbsp;\u003c/em\u003esp.\u0026nbsp;Eigenmann \u0026amp; Bray, 1894).\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 135px;\"\u003e\n \u003cp\u003eSmaller-bodied, streamlined species (e.g., \u003cem\u003eBelonion dibranchodon\u0026nbsp;\u003c/em\u003eCollette, 1966).\u003c/p\u003e\n \u003cp\u003e\u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 104px;\"\u003e\n \u003cp\u003ePerimeter\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 217px;\"\u003e\n \u003cp\u003eLength of the fish\u0026rsquo;s contour, reflecting the complexity of the boundary.\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 132px;\"\u003e\n \u003cp\u003eIrregular outlines with extended fins, barbels, or odontodes (e.g., \u003cem\u003eCtenolucius hujeta\u0026nbsp;\u003c/em\u003e(Valenciennes, 1850).\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 135px;\"\u003e\n \u003cp\u003eCompact bodies with smooth contours (e.g., \u003cem\u003eSynbranchus marmoratus\u0026nbsp;\u003c/em\u003eBloch, 1795).\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 104px;\"\u003e\n \u003cp\u003eDiameter\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 217px;\"\u003e\n \u003cp\u003eEstimated width assuming a circular equivalent shape based on area.\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 132px;\"\u003e\n \u003cp\u003eBroad, deep-bodied species (e.g., \u003cem\u003eSerrasalmus hollandi\u0026nbsp;\u003c/em\u003e\u003cem\u003eEigenmann, 1915\u003c/em\u003e).\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 135px;\"\u003e\n \u003cp\u003eNarrow, elongated species (e.g., \u003cem\u003eBelonion dibranchodon\u0026nbsp;\u003c/em\u003eCollette, 1966).\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 104px;\"\u003e\n \u003cp\u003eCompactibility\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 217px;\"\u003e\n \u003cp\u003eRelationship between area and perimeter, indicating shape roundness.\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 132px;\"\u003e\n \u003cp\u003eMore circular, symmetrical bodies (e.g., \u003cem\u003eHeros severus\u0026nbsp;\u003c/em\u003eHeckel, 1840).\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 135px;\"\u003e\n \u003cp\u003eElongated or irregularly shaped species (e.g., \u003cem\u003eFarlowella mariaelenae\u0026nbsp;\u003c/em\u003eMart\u0026iacute;n Salazar, 1964).\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 104px;\"\u003e\n \u003cp\u003eHu moments\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 217px;\"\u003e\n \u003cp\u003eShape descriptors invariant to translation, rotation, and scaling.\u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 132px;\"\u003e\n \u003cp\u003eAsymmetrical or highly elongated species (e.g., \u003cem\u003eSynbranchus marmoratus\u0026nbsp;\u003c/em\u003eBloch, 1795).\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 135px;\"\u003e\n \u003cp\u003eSymmetrical, compact species (e.g., \u003cem\u003ePoptella compressa\u0026nbsp;\u003c/em\u003e(G\u0026uuml;nther, 1864).\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 104px;\"\u003e\n \u003cp\u003eZernike moments\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 217px;\"\u003e\n \u003cp\u003eOrthogonal shape descriptors capturing morphological complexity.\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 132px;\"\u003e\n \u003cp\u003eFiner structural details like barbels, odontodes, or fin extensions (e.g., \u003cem\u003ePoptella compressa\u0026nbsp;\u003c/em\u003e(G\u0026uuml;nther, 1864).\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 135px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eStreamlined, elongated bodies with fewer localized features (e.g., \u003cem\u003eTriportheus\u0026nbsp;\u003c/em\u003esp.).\u003c/strong\u003e\u003c/p\u003e\n \u003cp\u003e\u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003e\u003cstrong\u003e4. \u0026nbsp; \u0026nbsp;Morph\u003c/strong\u003e\u003cstrong\u003eometric\u0026nbsp;Diversity Analysis\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eTo analyze the morphometric variation between fish species in the dataset, Principal Component Analysis (PCA) was applied to the extracted descriptors. PCA reduces the dimensionality of the feature space, identifying the principal axes of variation, and enabling visualization of species clustering based on their morphometric characteristics. The analysis was performed on the correlation matrix. Before analysis, the distribution of each variable was examined and logarithmic x +1 transformations were applied to approximate normality. After transformation, the variables were standardized using z-transformation to ensure equal contribution to PCA. Furthermore, Pearson\u0026apos;s correlation coefficient was calculated to assess the strength of the relationships between variables, helping to identify potential multicollinearity.\u003c/p\u003e\n\u003cp\u003eTo further explore the distribution of fish species within the morphospace, we applied Kernel Density Estimation (KDE) to the PCA-transformed data. To estimate the probability of occurrence for morphometric descriptors within a two-dimensional space defined by the first two principal component (PC) axes, two-dimensional KDE (Carmona et al. 2024) was utilized. Given that kernel density estimates are sensitive to the choice of smoothing bandwidth, unconstrained bandwidth selectors (Duong 2007) were employed to optimize the analysis. In this approach, the bandwidths for individual groups (e.g., taxonomic orders) were constrained by the overall bandwidth of the data set to ensure that the density estimates for each group remained within the morphometric descriptor space defined by the entire dataset. To visualize the probability distribution of trait combinations across the PCA space, contour plots were generated based on the two-dimensional kernel density distributions. These plots employed a color gradient and contour lines to represent the 0.5, 0.95, and 0.99 quantiles of the probability distribution, thus highlighting areas with the highest and lowest probability of occurrence for specific morphometric descriptors.\u003c/p\u003e\n\u003cp\u003eAll analyzes were performed on high performance workstations equipped with NVIDIA GPUs to accelerate deep learning model training and evaluation. The development and analysis were carried out using Jupyter Notebook in Google Colab, and deep learning frameworks such as TensorFlow and PyTorch (Paszke et al. 2019) were used for implementing the models. The extraction of morphometric features was performed using custom image processing scripts, while KDE and PCA analyses were carried out using the funspacef R package (Carmona et al. 2024).\u0026nbsp;\u003c/p\u003e"},{"header":"Results","content":"\u003cdiv id=\"Sec14\" class=\"Section2\"\u003e \u003ch2\u003eSegmentation process\u003c/h2\u003e \u003cp\u003eThe segmentation process demonstrated high accuracy, with a mean Dice coefficient of 0.98 and a mean IoU of 0.97. Both metrics exhibited narrow distributions around their respective means. The standard deviation (SD) thresholds of the Dice coefficient were \u0026plusmn;\u0026thinsp;1 SD (0.91), \u0026plusmn;\u0026thinsp;2 SD (0.95) and \u0026plusmn;\u0026thinsp;3 SD (0.97). Similarly, the IoU thresholds were: \u0026plusmn;1 SD (0.89), \u0026plusmn;\u0026thinsp;2 SD (0.93) and \u0026plusmn;\u0026thinsp;3 SD (0.97) (Fig.\u0026nbsp;\u003cspan refid=\"Fig2\" class=\"InternalRef\"\u003e2\u003c/span\u003e). These results indicate consistent and highly accurate segmentation, achieving approximately 98% agreement with manual annotations.\u003c/p\u003e \u003cp\u003eA statistical threshold analysis using a Beta distribution identified potential segmentation errors. Outliers, detected as values exceeding\u0026thinsp;\u0026plusmn;\u0026thinsp;3 SD from the mean, and Dice values below 0.91 and IoU values below 0.89 (Fig.\u0026nbsp;\u003cspan refid=\"Fig2\" class=\"InternalRef\"\u003e2\u003c/span\u003e). These outliers represented only 29 images, or 1.6% of the total dataset (Fig. S2), suggesting a low error rate for the segmentation process.\u003c/p\u003e \u003cp\u003e \u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec15\" class=\"Section2\"\u003e \u003ch2\u003eMorphometrics Trait Extraction Accuracy\u003c/h2\u003e \u003cp\u003eThe accuracy of the extracted morphometric measurements was assessed by comparing the observed and predicted values for the area of the fish (px\u0026sup2;) and the perimeter (px). The prediction model exhibited strong predictive performance, with an R\u0026sup2; of 0.995 for the area and 0.945 for the perimeter (Fig.\u0026nbsp;\u003cspan refid=\"Fig3\" class=\"InternalRef\"\u003e3\u003c/span\u003e), indicating excellent agreement between the predicted and observed values (see details in the supporting information, Fig. S3).\u003c/p\u003e \u003cp\u003eThe RMSE was calculated to quantify the accuracy of the prediction. The mean observed area was 2,922,600.91 px\u0026sup2;, with an RMSE of 162,464.64 px\u0026sup2;, representing 5.56% of the observed mean. The mean observed perimeter was 11,352.11 px, with an RMSE of 1,436.89 px, representing 12.66% of the observed mean. The higher relative RMSE for the perimeter may be attributed to increased sensitivity to boundary delineation or data variability. Given that area is a squared measure, small inaccuracies in boundary delineation result in larger cumulative errors compared to perimeter, which is a linear measure.\u003c/p\u003e \u003cp\u003eRPD was calculated to contextualize RMSE relative to the variability of the observed values. The RPD for the area was 14.695, and for the perimeter was 3.721. These values indicate a high predictive capacity for both measurements, with greater precision in area estimation compared to perimeter (Fig.\u0026nbsp;\u003cspan refid=\"Fig3\" class=\"InternalRef\"\u003e3\u003c/span\u003e).\u003c/p\u003e \u003cp\u003e \u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec16\" class=\"Section2\"\u003e \u003ch2\u003eMorphometric Diversity Analysis\u003c/h2\u003e \u003cp\u003eThe PCA revealed that 69% of the morphometric variation between the Colombian freshwater fish species is captured within the first two principal components (PCs) (Fig.\u0026nbsp;\u003cspan refid=\"Fig4\" class=\"InternalRef\"\u003e4\u003c/span\u003e, details in supporting information, Fig. S4, Table \u003cspan refid=\"MOESM1\" class=\"InternalRef\"\u003eS1\u003c/span\u003e). This indicates that the primary trends in fish shape are effectively summarized by these two axes. PC1 represents a gradient of species with large body areas and rounded contours, such as \u003cem\u003eSerrasalmus\u003c/em\u003e sp. (Characiformes), to those with smaller body areas and elongated contours, as exemplified by \u003cem\u003eSynbranchus marmoratus\u003c/em\u003e (Synbranchiformes). This axis reflects fundamental differences in body shape and size.\u003c/p\u003e \u003cp\u003eThe PC2, primarily associated with perimeter, distinguishes species with large, irregular contours from those with smaller, symmetrical contours. This axis highlights the significance of proportionality and contour irregularity (see supporting information, Table \u003cspan refid=\"MOESM1\" class=\"InternalRef\"\u003eS1\u003c/span\u003e). Species with higher perimeter values exhibit extensive fin structures, such as the well-developed dorsal fins in \u003cem\u003eAequidens\u003c/em\u003e and \u003cem\u003eGeophagus\u003c/em\u003e, or elongated caudal fin rays seen in certain Siluriformes, particularly Loricariidae (e.g., \u003cem\u003eHypostomus\u003c/em\u003e). On the contrary, species with lower perimeter values typically display reduced fin structures, with some fins absent, short, or highly reduced, as observed in certain Characidae and Trichomycteridae, where barbels and other appendages are minimal or absent.\u003c/p\u003e \u003cp\u003eThe morphometric space of Colombian freshwater fish is dominated by a single high-density node, suggesting that most species share around a common body shape (Fig.\u0026nbsp;\u003cspan refid=\"Fig2\" class=\"InternalRef\"\u003e2\u003c/span\u003eA). This group, located near the origin of the principal component space, comprises species with moderate body size and flattened elliptical bodies with dorsoventrally or laterally. These species exhibit intermediate values for the Zernike moments and the Hu moments, reflecting relatively symmetric body shapes and moderate fin development. This group is predominantly composed of Characiformes, Siluriformes, Atheriniformes, and Cichliformes, including species such as \u003cem\u003eHemibrycon\u003c/em\u003e spp., \u003cem\u003eAstroblepus\u003c/em\u003e spp., and \u003cem\u003eChaetostoma\u003c/em\u003e spp.\u003c/p\u003e \u003cp\u003eDistinct patterns of trait-space occupancy were observed among Colombian freshwater fish taxa, as illustrated in the morphometric space (see details in Supporting Information, Fig. S5). Gymnotiformes and Synbranchiformes, such as \u003cem\u003eSynbranchus marmoratus\u003c/em\u003e, occupy peripheral regions, characterized by highly specialized, elongated body shapes, as seen in electric knifefish and swamp eels. Blenniformes, such as \u003cem\u003eHeros severus\u003c/em\u003e, occupy a localized region, distinguished by compact body shapes and irregular fin configurations, specifically, deep-bodied, laterally compressed profiles with elongated rays in the dorsal, caudal, and anal fins.\u003c/p\u003e \u003cp\u003eCharaciformes and Siluriformes, the most species-rich taxa, dominate the central regions, exhibiting broad variation in traits. This pattern is similarly observed in Acanthuriformes, Gobioformes, and Atheriniformes, though with fewer species analyzed. Their morphometric diversity ranges from rounded bodies with pronounced fins to elongated, streamlined shapes, for example, \u003cem\u003eSerrasalmus hollandi\u003c/em\u003e or \u003cem\u003eHerus severus\u003c/em\u003e and \u003cem\u003eCtenolucius hujeta\u003c/em\u003e or \u003cem\u003eAstroblepus\u003c/em\u003e spp. Siluriformes exhibit the most expansive morphometric hotspot, encompassing a wide spectrum of streamlined and dorsoventrally flattened shapes.\u003c/p\u003e \u003cp\u003eThese results highlight a common predominant body shape among Colombian freshwater fish, while also revealing unique body shapes in morphospace, underscoring their morphometric specialization, as no species occupies identical regions.\u003c/p\u003e \u003cp\u003e \u003c/p\u003e \u003c/div\u003e"},{"header":"Discussion","content":"\u003cp\u003eMorphometric diversity is fundamental to understanding evolutionary trajectories, ecological adaptations, and species conservation, as morphology directly influences locomotion, feeding strategies, and habitat use (Gatz \u003cspan citationid=\"CR20\" class=\"CitationRef\"\u003e1979\u003c/span\u003e; Winemiller \u003cspan citationid=\"CR56\" class=\"CitationRef\"\u003e1991\u003c/span\u003e). This study represents the first large-scale morphological characterization of Colombian freshwater fish, analyzing 393 species of the 1,711 species of Colombian freshwater fish using an automated deep learning approach.\u003c/p\u003e \u003cp\u003eThe methodology used integrates a two-step deep learning pipeline, with the SAM playing a key role in segmenting fish from field images. The ability of SAM to generalize across a wide range of body shapes, sizes, and pigmentation patterns makes it particularly valuable for large-scale studies (Kirillov et al. \u003cspan citationid=\"CR31\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). This segmentation enables the precise extraction of morphometric traits, including area, perimeter, and invariant moments. SAM achieved more than 97% segmentation accuracy, demonstrating its potential to replace manual segmentation and streamline morphometric analyzes.\u003c/p\u003e \u003cp\u003eWhile deep learning applications in fish segmentation have predominantly focused on marine and commercially important species, freshwater taxa have been largely underrepresented. Models such as SegNet (Fernandes et al. \u003cspan citationid=\"CR15\" class=\"CitationRef\"\u003e2020\u003c/span\u003e) and Mask R-CNN (Ariede et al. \u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2023\u003c/span\u003e) have been used in fewer than 60 freshwater species (Yu et al. \u003cspan citationid=\"CR58\" class=\"CitationRef\"\u003e2020\u003c/span\u003e; Garcia-d\u0026rsquo;Urso et al. \u003cspan citationid=\"CR18\" class=\"CitationRef\"\u003e2022\u003c/span\u003e; Rocha et al. \u003cspan citationid=\"CR43\" class=\"CitationRef\"\u003e2024\u003c/span\u003e), primarily due to the scarcity of annotated image datasets. Traditional models require extensive manual labeling of body regions and keypoints (Hasegawa and Nakano \u003cspan citationid=\"CR23\" class=\"CitationRef\"\u003e2024\u003c/span\u003e), limiting their adaptability to species with diverse morphologies and complex pigmentation patterns (Ariede et al. \u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). A major challenge in fish segmentation research is the difficulty of generalizing models to morphologically distinct species, particularly in complex environmental backgrounds (Zhuang et al. \u003cspan citationid=\"CR59\" class=\"CitationRef\"\u003e2021\u003c/span\u003e). The SAM overcomes this limitation through its zero-shot segmentation capability, delineating fish morphology without requiring species-specific labeled data (Schneider et al. \u003cspan citationid=\"CR47\" class=\"CitationRef\"\u003e2024\u003c/span\u003e). This capability has been validated across various biological groups, including marine objects (Hong et al. \u003cspan citationid=\"CR28\" class=\"CitationRef\"\u003e2024\u003c/span\u003e), nematodes (Sigur\u0026eth;ard\u0026oacute;ttir et al. \u003cspan citationid=\"CR49\" class=\"CitationRef\"\u003e2024\u003c/span\u003e), and fish (Hasegawa and Nakano \u003cspan citationid=\"CR23\" class=\"CitationRef\"\u003e2024\u003c/span\u003e), confirming its effectiveness. This is the first study to apply SAM to an image data set standardized and annotated by ichthyologists, demonstrating its suitability for freshwater fish morphology analysis.\u003c/p\u003e \u003cp\u003eDespite its high accuracy, SAM exhibited segmentation errors in three main scenarios: misclassification of nonbiological elements when fish were positioned near aquarium walls or the water surface (see details in Supporting Information, Fig. S2 A\u0026ndash;C), omission of fine morphological structures such as barbels and small fins were occasionally omitted (see details in Supporting Information, Fig. S2 E), and focusing on a single individual image containing multiple fish (see details in Supporting Information, Fig. S2 D).\u003c/p\u003e \u003cp\u003eThe high performance of SAM is largely attributed to the quality of the CavFish dataset and the PhotaFish system (Garc\u0026iacute;a-Melo et al. \u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e2019\u003c/span\u003e). Unlike databases such as FishBase (Froese and Pauly \u003cspan citationid=\"CR17\" class=\"CitationRef\"\u003e2024\u003c/span\u003e) and FishNet (Khan et al. \u003cspan citationid=\"CR30\" class=\"CitationRef\"\u003e2023\u003c/span\u003e), where image variability in specimen condition, background, lighting, and tank setup limits morphometric consistency, CavFish ensures taxonomically informative images that preserve natural shape and utilize controlled backgrounds. This minimizes segmentation variability and enhances model accuracy. Although SAM has not yet been tested on other datasets, as mentioned above, adopting standardized photographic protocols is strongly recommended to improve segmentation accuracy across diverse field conditions.\u003c/p\u003e \u003cp\u003eThe integration of SAM with CavFish allowed for a comprehensive evaluation of the morphometric diversity of Colombian freshwater fish, supporting previous findings on species-level morphological variation and its ecological significance. The PC1 primarily reflects differences in overall body proportions, delineating a morphospace from larger, more robust species with rounded contours to smaller, more streamlined shapes. PC2 captures variations in body perimeter, separating species with broader, irregular shapes, often associated with larger or more numerous fins, from those with more compact, symmetrical bodies where fin structures are reduced.\u003c/p\u003e \u003cp\u003eThese morphometric patterns align with previous studies (Conde-Salda\u0026ntilde;a et al. \u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e2017\u003c/span\u003e; Caillon et al. \u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e2018\u003c/span\u003e), which emphasize body elongation as a major driver of morphometric variability with significant implications for locomotion and habitat use. Elongated, fusiform, or streamlined body shapes are widely recognized adaptations for reducing drag and maximizing sustained swimming efficiency (Blake \u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e2004\u003c/span\u003e; Langerhans \u003cspan citationid=\"CR32\" class=\"CitationRef\"\u003e2009\u003c/span\u003e; Hincapi\u0026eacute;-Cruz and M\u0026aacute;rquez \u003cspan citationid=\"CR26\" class=\"CitationRef\"\u003e2021\u003c/span\u003e). These traits improve energy-efficient locomotion, making them advantageous for species inhabiting open-water environments or high-flow habitats (Langerhans and Reznick \u003cspan citationid=\"CR33\" class=\"CitationRef\"\u003e2010\u003c/span\u003e).\u003c/p\u003e \u003cp\u003eIn Colombian freshwater ecosystems, elongated species are primarily associated with the order Synbranchiformes, represented by a single species, \u003cem\u003eSynbranchus marmoratus\u003c/em\u003e. Other species with this body shape include \u003cem\u003eCtenolucius hujeta\u003c/em\u003e (Characiformes), \u003cem\u003eFarlowella mariaelenae\u003c/em\u003e (Siluriformes), and \u003cem\u003ePotamorrhaphis\u003c/em\u003e spp. and \u003cem\u003eBelonion dibranchodon\u003c/em\u003e (Atheriniformes). Body elongation also influences feeding strategies. For species relying on suction feeding, deeper-bodied forms typically exhibit a larger cross-sectional area of the epaxial musculature, which is a key determinant of suction pressure during feeding (Holzman et al. \u003cspan citationid=\"CR27\" class=\"CitationRef\"\u003e2012\u003c/span\u003e). Additionally, highly elongated fish with numerous vertebrae tend to be more flexible (Yamada et al. \u003cspan citationid=\"CR57\" class=\"CitationRef\"\u003e2009\u003c/span\u003e), and some of these species exhibit a fossorial lifestyle, residing among rocks or within sand and mud (Claverie and Wainwright \u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e2014\u003c/span\u003e) such as \u003cem\u003eSynbranchus marmoratus\u003c/em\u003e and \u003cem\u003eFarlowella mariaelenae\u003c/em\u003e.\u003c/p\u003e \u003cp\u003eIn contrast, species with deeper, laterally compressed bodies and larger caudal peduncles are adapted for unsteady swimming, excelling in burst acceleration and maneuverability within structurally complex environments (Langerhans \u003cspan citationid=\"CR32\" class=\"CitationRef\"\u003e2009\u003c/span\u003e). These traits are advantageous for rapid predator evasion and navigating through dense vegetation or heterogeneous habitats (Webb \u003cspan citationid=\"CR54\" class=\"CitationRef\"\u003e1984\u003c/span\u003e; Schrank et al. \u003cspan citationid=\"CR48\" class=\"CitationRef\"\u003e1999\u003c/span\u003e; Langerhans and Reznick \u003cspan citationid=\"CR33\" class=\"CitationRef\"\u003e2010\u003c/span\u003e). Among Colombian freshwater fish, \u003cem\u003eHeros severus\u003c/em\u003e and \u003cem\u003eAequidens\u003c/em\u003e spp. (Blenniiformes) and \u003cem\u003eThoracocharax\u003c/em\u003e spp. (Characiformes) exhibit these morphological features. This variation in body shape may have been the result of divergent selection pressures related to differences in water flow, dissolved oxygen availability, prey abundance, and elevation gradient (Crispo and Chapman \u003cspan citationid=\"CR12\" class=\"CitationRef\"\u003e2010\u003c/span\u003e; Foster et al. \u003cspan citationid=\"CR16\" class=\"CitationRef\"\u003e2015\u003c/span\u003e; Malato et al. \u003cspan citationid=\"CR36\" class=\"CitationRef\"\u003e2017\u003c/span\u003e).\u003c/p\u003e \u003cp\u003eThe variation in fin morphology captured by PC2 further underscores the role of fins in body stabilization and locomotion. Previous ecomorphological studies of Neotropical fish have highlighted the functional importance of pectoral, pelvic, and caudal fins, particularly in relation to habitat exploitation under varying water velocities (Conde-Salda\u0026ntilde;a et al. \u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e2017\u003c/span\u003e; Hulth\u0026eacute;n et al. \u003cspan citationid=\"CR29\" class=\"CitationRef\"\u003e2024\u003c/span\u003e). Species with larger fins provide strong evidence that fin size plays a crucial role in generating escape momentum for predator avoidance (Gosline \u003cspan citationid=\"CR21\" class=\"CitationRef\"\u003e1994\u003c/span\u003e; Hulth\u0026eacute;n et al. \u003cspan citationid=\"CR29\" class=\"CitationRef\"\u003e2024\u003c/span\u003e). A notable example is \u003cem\u003eHypostomus\u003c/em\u003e spp. (Loricariidae), a group of Siluriformes commonly found in fast-flowing waters with rocky substrates (Conde-Salda\u0026ntilde;a et al. \u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e2017\u003c/span\u003e). On the contrary, species with smaller fins, such as \u003cem\u003eKnodus\u003c/em\u003e spp. or \u003cem\u003eAstyanax\u003c/em\u003e spp. (Characiformes) may benefit from reduced drag and enhanced maneuverability (Blake \u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e2004\u003c/span\u003e; Langerhans \u003cspan citationid=\"CR32\" class=\"CitationRef\"\u003e2009\u003c/span\u003e). This adaptation facilitates unstable swimming behaviors, characterized by frequent changes in velocity and direction (Webb \u003cspan citationid=\"CR55\" class=\"CitationRef\"\u003e1982\u003c/span\u003e), allowing them to forage efficiently for food resources such as insects beneath macrophytes and submerged roots, common elements in Colombian freshwater ecosystems.\u003c/p\u003e \u003cp\u003eBeyond these ecological and functional interpretations, the observed body shape diversity also reflects deeper evolutionary processes. Natural selection drives morphological divergence through environmental adaptation, with water flow, habitat complexity, and predation pressure serving as the main forces shaping body plans suited to distinct ecological roles (Manna et al. \u003cspan citationid=\"CR37\" class=\"CitationRef\"\u003e2017\u003c/span\u003e; Scharnweber \u003cspan citationid=\"CR46\" class=\"CitationRef\"\u003e2020\u003c/span\u003e). Simultaneously, adaptive radiations, such as those seen in cichlids and loricariids, illustrate how the colonization of novel ecological niches can trigger rapid morphological diversification (Lujan and Armbruster \u003cspan citationid=\"CR35\" class=\"CitationRef\"\u003e2012\u003c/span\u003e; Arbour and L\u0026oacute;pez-Fern\u0026aacute;ndez \u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e2016\u003c/span\u003e). Furthermore, functional innovations, such as jaw specialization in Loricariidae or lower lip differentiation in Cyprinidae, have allowed certain lineages to access novel food resources, expanding their ecological breadth and contributing to morphospace expansion (Lujan and Armbruster \u003cspan citationid=\"CR35\" class=\"CitationRef\"\u003e2012\u003c/span\u003e; Corse et al. \u003cspan citationid=\"CR11\" class=\"CitationRef\"\u003e2015\u003c/span\u003e).\u003c/p\u003e \u003cp\u003eContour analysis from a single-lateral view, as presented in this study, offers valuable insights for trait-based ecological research and has great potential for broader applications in fish morphology studies. However, this method captures only the general shape of the body defined by the outline, omitting key structural traits such as the position of the pectoral fin and the placement of the eyes, which play critical functional roles in locomotion, respiration, and sensory perception (Caillon et al. \u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e2018\u003c/span\u003e). To achieve a more comprehensive understanding of the morphospace diversity of Colombian freshwater fish, future research should address several challenges. First, it is essential to expand the representation of species to better encompass the remarkable richness of Colombian freshwater fish. Second, future studies should integrate additional localized morphometric traits, including eye position, body height, dentition, gill-raker and fin morphology, caudal peduncle dimensions, and head and mouth shape, to capture functionally relevant attributes associated with habitat use, locomotion, and trophic functions. Third, incorporating three-dimensional (3D) analyses of body structures would allow researchers to examine traits not visible in two-dimensional contours, such as body depth, while integrating coloration patterns could further reveal ecological and behavioral adaptations that are not captured by shape alone.\u003c/p\u003e"},{"header":"Conclusions","content":"\u003cp\u003eThis study demonstrates the effectiveness of AI-driven segmentation using foundation models for large-scale morphometric analysis of Colombian freshwater fish, representing the first application of a deep learning pipeline to quantify morphological diversity directly from standardized field photography of live specimens. Using Segment Anything\u0026rsquo;s (SAM) zero-shot segmentation capability, our workflow achieves over 97% segmentation accuracy, accurately delineating fish morphology across a wide range of body shapes and sizes. These results establish SAM's capacity to replace manual segmentation, dramatically reducing annotation effort while preserving the precision required for quantitative morphological analyses.\u003c/p\u003e \u003cp\u003eBeyond its technical advances, our study provides the first comprehensive assessment of the natural morphometric diversity of Colombian freshwater fish, using data derived from live images rather than preserved specimens. By identifying key gradients of body shape variation, such as body proportions, contour complexity, and fin morphology, closely related to locomotion and habitat use, we offer novel insights into the functional morphology of one of the most diverse geographical regions of freshwater fish.\u003c/p\u003e \u003cp\u003eImportantly, our workflow enables the scalable, noninvasive, and standardized collection of morphometric data from living organisms in natural environments. This methodology offers a scalable and efficient solution for researchers. By facilitating rapid, high-throughput analyses of morphological traits, this contribution not only addresses current limitations in data availability but also opens avenues for the advancement of comparative morphology, functional ecology, evolutionary drivers of variation, and ecosystem monitoring in freshwater systems.\u003c/p\u003e"},{"header":"Declarations","content":"\u003cp\u003e\u003cstrong\u003eConflict of Interest statement\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe authors declare that they have no conflict of interest.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAcknowledgements\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eWe thank the Field Museum of Chicago, WWF, Fundación Omacha, Universidad del Tolima, and Universidad de Ibagué for their support during expeditions enabling the photographic documentation of Colombian fish species.\u0026nbsp;We also acknowledge the Universidad Industrial de Santander, particularly the School of Biology for their funding and assistance in this research. Likewise, Biomedical Imaging, Vision and Learning Laboratory, Biotechnology (Bivl\u003csup\u003e2\u003c/sup\u003eab), Environmental Management Research Group (iBGA), and the CavFish Scientific Committee, for providing computational resources, species identification, and valuable insights. Special thanks to Marlon Camilo Herrera for his dedication at the Visual Science Lab. The authors wish to thank anonymous reviewers, and Editors for valuable revision to improve manuscripts.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAuthors' Contributions\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eAll authors contributed to the conception, design of the research, and interpretation of the results, integrating their perspectives according to their areas of expertise. Efforts were made to consider the scientific literature relevant to Colombia. Data analysis was performed by JLPC; DMD; and FMC, who also participated, along with JGM; SMR; and BR, in the review and preparation of the manuscript. Fish photographs were taken by JGM using the Photafish system and archived in the CavFish database. The manuscript was primarily written by JLPC and DMD. All authors approved the final manuscript.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eFunding\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThis work was supported by the Universidad Industrial de Santander (UIS), Colombia, through a forgivable loan for doctoral studies in Biological Sciences awarded to Jose Luis Poveda Cuellar\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAvailability of Data and Code\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eData, CavFish data set, supporting the findings of this study are available from the corresponding author upon reasonable request (https://cavfish.unibague.edu.co/catalogo). The morphometric database, and the R and Python code used for analysis will be publicly available on GitHub upon publication.\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\n \u003cli\u003eArbour JH, L\u0026oacute;pez-Fern\u0026aacute;ndez H (2016) Continental cichlid radiations: functional diversity reveals the role of changing ecological opportunity in the Neotropics. Proc R Soc B 283:20160556. https://doi.org/10.1098/rspb.2016.0556\u003c/li\u003e\n \u003cli\u003eAriede RB, Lemos CG, Batista FM, et al (2023) Computer vision system using deep learning to predict rib and loin yield in the fish \u003cem\u003eColossoma macropomum\u003c/em\u003e. Animal Genetics 54:375\u0026ndash;388. https://doi.org/10.1111/age.13302\u003c/li\u003e\n \u003cli\u003eBakış Y, Wang X, Altıntaş B, et al (2023) On Image Quality Metadata, FAIR in ML, AI-Readiness and Reproducibility: Fish-AIR example. BISS 7:e112178. https://doi.org/10.3897/biss.7.112178\u003c/li\u003e\n \u003cli\u003eBarrag\u0026aacute;n KS, Chuctaya J, Escobar-Camacho D, et al (2024) Fresh \u003cem\u003evs.\u003c/em\u003e Preserved Specimens: Length‐Weight Relationships of Fishes from the Western Amazon (Napo Basin, Ecuador). Journal of Applied Ichthyology 2024:2430326. https://doi.org/10.1155/2024/2430326\u003c/li\u003e\n \u003cli\u003eBlake RW (2004) Fish functional design and swimming performance. Journal of Fish Biology 65:1193\u0026ndash;1222. https://doi.org/10.1111/j.0022-1112.2004.00568.x\u003c/li\u003e\n \u003cli\u003eCaillon F, Bonhomme V, M\u0026ouml;llmann C, Frelat R (2018) A morphometric dive into fish diversity. Ecosphere 9:e02220. https://doi.org/10.1002/ecs2.2220\u003c/li\u003e\n \u003cli\u003eCarmona CP, Pavanetto N, Puglielli G (2024) funspace: An R package to build, analyse and plot functional trait spaces. Diversity and Distributions 30:e13820. https://doi.org/10.1111/ddi.13820\u003c/li\u003e\n \u003cli\u003eClaude J (2008) Morphometrics with R. Springer, New York\u003c/li\u003e\n \u003cli\u003eClaverie T, Wainwright PC (2014) A Morphospace for Reef Fishes: Elongation Is the Dominant Axis of Body Shape Evolution. PLoS ONE 9:e112732. https://doi.org/10.1371/journal.pone.0112732\u003c/li\u003e\n \u003cli\u003eConde-Salda\u0026ntilde;a CC, Albornoz-Garz\u0026oacute;n JG, L\u0026oacute;pez-Delgado EO, Villa-Navarro FA (2017) Ecomorphological relationships of fish assemblages in a trans-Andean drainage, Upper Magdalena River Basin, Colombia. Neotrop ichthyol 15:. https://doi.org/10.1590/1982-0224-20170037\u003c/li\u003e\n \u003cli\u003eCorse E, Tarkan AS, Emiroğlu \u0026Ouml;, et al (2015) Covariation of trophic and habitat‐related traits in chondrostoms ( C yprinidae): implications for repeated and diversifying evolutionary processes. Journal of Zoology 295:294\u0026ndash;305. https://doi.org/10.1111/jzo.12212\u003c/li\u003e\n \u003cli\u003eCrispo E, Chapman LJ (2010) Geographic variation in phenotypic plasticity in response to dissolved oxygen in an African cichlid fish. J of Evolutionary Biology 23:2091\u0026ndash;2103. https://doi.org/10.1111/j.1420-9101.2010.02069.x\u003c/li\u003e\n \u003cli\u003eDoNascimiento C, Agudelo-Zamora HD, Bogota-Gregory JA (2024) Lista de especies de peces de agua dulce de Colombia/Checklist of the freshwater fishes of Colombia.v2.17. https://doi.org/10.15472/numrso\u003c/li\u003e\n \u003cli\u003eDuong T (2007) ks : Kernel Density Estimation and Kernel Discriminant Analysis for Multivariate Data in R. J Stat Soft 21:. https://doi.org/10.18637/jss.v021.i07\u003c/li\u003e\n \u003cli\u003eFernandes AFA, Turra EM, De Alvarenga \u0026Eacute;R, et al (2020) Deep Learning image segmentation for extraction of fish body measurements and prediction of body weight and carcass traits in Nile tilapia. Computers and Electronics in Agriculture 170:105274. https://doi.org/10.1016/j.compag.2020.105274\u003c/li\u003e\n \u003cli\u003eFoster K, Bower L, Piller K (2015) Getting in shape: habitat-based morphological divergence for two sympatric fishes: Habitat-based morphological divergence. Biol J Linn Soc Lond 114:152\u0026ndash;162. https://doi.org/10.1111/bij.12413\u003c/li\u003e\n \u003cli\u003eFroese R, Pauly D (2024) FishBase.World Wide Web electronic publication. https://www.fishbase.se/search.php. Accessed 11 Aug 2024\u003c/li\u003e\n \u003cli\u003eGarcia-d\u0026rsquo;Urso N, Galan-Cuenca A, P\u0026eacute;rez-S\u0026aacute;nchez P, et al (2022) segmentation, classification,. Scientific Data\u003c/li\u003e\n \u003cli\u003eGarc\u0026iacute;a-Melo JE, Garc\u0026iacute;a-Melo LJ, Garc\u0026iacute;a-Melo JD, et al (2019) Photafish system: An affordable device for fish photography in the wild. Zootaxa 4554:. https://doi.org/10.11646/zootaxa.4554.1.4\u003c/li\u003e\n \u003cli\u003eGatz AJ (1979) Community organization in fishes as indicated by morphological features. Ecology 60:711\u0026ndash;718\u003c/li\u003e\n \u003cli\u003eGosline WA (1994) Function and structure in the paired fins of scorpaeniform fishes. Environ Biol Fish 40:219\u0026ndash;226. https://doi.org/10.1007/BF00002508\u003c/li\u003e\n \u003cli\u003eHan B, Hu Z, Su Z, et al (2022) Mask_LaC R-CNN for measuring morphological features of fish. Measurement 203:111859. https://doi.org/10.1016/j.measurement.2022.111859\u003c/li\u003e\n \u003cli\u003eHasegawa T, Nakano D (2024) Robust Fish Recognition Using Foundation Models toward Automatic Fish Resource Management. JMSE 12:488. https://doi.org/10.3390/jmse12030488\u003c/li\u003e\n \u003cli\u003eHelser TE, Benson I, Erickson J, et al (2019) A transformative approach to ageing fish otoliths using Fourier transform near infrared spectroscopy: a case study of eastern Bering Sea walleye pollock ( \u003cem\u003eGadus chalcogrammus\u003c/em\u003e ). Can J Fish Aquat Sci 76:780\u0026ndash;789. https://doi.org/10.1139/cjfas-2018-0112\u003c/li\u003e\n \u003cli\u003eHern\u0026aacute;ndez-Serna A, Jim\u0026eacute;nez-Segura LF (2014) Automatic identification of species with neural networks. PeerJ 2:e563. https://doi.org/10.7717/peerj.563\u003c/li\u003e\n \u003cli\u003eHincapi\u0026eacute;-Cruz JP, M\u0026aacute;rquez EJ (2021) Variaci\u0026oacute;n fenot\u0026iacute;pica de los peces \u003cem\u003e\u0026nbsp;Curimata mivartii\u0026nbsp;\u003c/em\u003e(Characiformes: Curimatidae) y \u003cem\u003e\u0026nbsp;Pimelodus grosskopfii\u0026nbsp;\u003c/em\u003e (Siluriformes: Pimelodidae) en h\u0026aacute;bitats l\u0026oacute;ticos y l\u0026eacute;nticos. Revista de Biolog\u0026iacute;a Tropical 69:\u003c/li\u003e\n \u003cli\u003eHolzman R, Collar DC, Mehta RS, Wainwright PC (2012) An integrative modeling approach to elucidate suction-feeding performance. Journal of Experimental Biology 215:1\u0026ndash;13. https://doi.org/10.1242/jeb.057851\u003c/li\u003e\n \u003cli\u003eHong Y, Zhou X, Hua R, et al (2024) WaterSAM: Adapting SAM for Underwater Object Segmentation. JMSE 12:1616. https://doi.org/10.3390/jmse12091616\u003c/li\u003e\n \u003cli\u003eHulth\u0026eacute;n K, Vinterstare J, Nilsson PA, Br\u0026ouml;nmark C (2024) Finotypic plasticity: Predator‐induced plasticity in fin size, darkness and display behaviour in a teleost fish. Journal of Animal Ecology 93:1135\u0026ndash;1146. https://doi.org/10.1111/1365-2656.14130\u003c/li\u003e\n \u003cli\u003eKhan FF, Li X, Temple AJ, Elhoseiny M (2023) FishNet: A Large-scale Dataset and Benchmark for Fish Recognition, Detection, and Functional Trait Prediction. In: 2023 IEEE/CVF International Conference on Computer Vision (ICCV). IEEE, Paris, France, pp 20439\u0026ndash;20449\u003c/li\u003e\n \u003cli\u003eKirillov A, Mintun E, Ravi N, et al (2023) Segment Anything. In: 2023 IEEE/CVF International Conference on Computer Vision (ICCV). IEEE, Paris, France, pp 3992\u0026ndash;4003\u003c/li\u003e\n \u003cli\u003eLangerhans RB (2009) Trade‐off between steady and unsteady swimming underlies predator‐driven divergence in \u003cem\u003eGambusia affinis\u003c/em\u003e. J of Evolutionary Biology 22:1057\u0026ndash;1075. https://doi.org/10.1111/j.1420-9101.2009.01716.x\u003c/li\u003e\n \u003cli\u003eLangerhans RB, Reznick DN (2010) Ecology and Evolution of Swimming Performance in Fishes: Predicting Evolution with Biomechanics. In: Domenici P, Kapoor BG (eds) Fish Locomotion, 1st edn. CRC Press, pp 200\u0026ndash;248\u003c/li\u003e\n \u003cli\u003eLiu S, Zeng Z, Ren T, et al (2024) Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection\u003c/li\u003e\n \u003cli\u003eLujan NK, Armbruster JW (2012) Morphological and functional diversity of the mandible in suckermouth armored catfishes (Siluriformes: Loricariidae). Journal of Morphology 273:24\u0026ndash;39. https://doi.org/10.1002/jmor.11003\u003c/li\u003e\n \u003cli\u003eMalato G, Shervette VR, Navarrete Amaya R, et al (2017) Parallel body shape divergence in the Neotropical fish genus Rhoadsia (Teleostei: Characidae) along elevational gradients of the western slopes of the Ecuadorian Andes. PLoS ONE 12:e0179432. https://doi.org/10.1371/journal.pone.0179432\u003c/li\u003e\n \u003cli\u003eManna LR, Rezende CF, Mazzoni R (2017) Effect of body size on microhabitat preferences in stream-dwelling fishes. J Appl Ichthyol 33:193\u0026ndash;202. https://doi.org/10.1111/jai.13320\u003c/li\u003e\n \u003cli\u003eMartinez PA, Berbel-Filho WM, Jacobina UP (2013) Is formalin fixation and ethanol preservation able to influence in geometric morphometric analysis? Fishes as a case study. Zoomorphology 132:87\u0026ndash;93. https://doi.org/10.1007/s00435-012-0176-x\u003c/li\u003e\n \u003cli\u003eOu L, Liu B, Chen X, et al (2023) Automated Identification of Morphological Characteristics of Three \u003cem\u003e\u0026nbsp;Thunnus\u0026nbsp;\u003c/em\u003e Species Based on Different Machine Learning Algorithms. Fishes 8:182. https://doi.org/10.3390/fishes8040182\u003c/li\u003e\n \u003cli\u003ePaszke A, Gross S, Massa F, et al (2019) PyTorch: An Imperative Style, High-Performance Deep Learning Library. In: Wallach H, Larochelle H, Beygelzimer A, et al. (eds) Advances in Neural Information Processing Systems. Curran Associates, Inc.\u003c/li\u003e\n \u003cli\u003ePelicice FM, Agostinho AA, Azevedo-Santos VM, et al (2023) Ecosystem services generated by Neotropical freshwater fishes. Hydrobiologia 850:2903\u0026ndash;2926. https://doi.org/10.1007/s10750-022-04986-7\u003c/li\u003e\n \u003cli\u003ePetrellis N (2021) Measurement of Fish Morphological Features through Image Processing and Deep Learning Techniques. Applied Sciences 11:4416. https://doi.org/10.3390/app11104416\u003c/li\u003e\n \u003cli\u003eRocha WS, Da Fonseca TFC, Watanabe CYV, et al (2024) Automatic measurement of fish from images using convolutional neural networks. Multimed Tools Appl. https://doi.org/10.1007/s11042-024-19180-1\u003c/li\u003e\n \u003cli\u003eSabaj P\u0026eacute;rez MH (2009) Photographic Atlas of Fishes of the Guiana Shield. Bulletin of the Biological Society of Washington 17:52\u0026ndash;59. https://doi.org/10.2988/0097-0298-17.1.52\u003c/li\u003e\n \u003cli\u003eSaleh A, Jones D, Jerry D, Azghadi MR (2023) MFLD-net: a lightweight deep learning network for fish morphometry using landmark detection. Aquat Ecol 57:913\u0026ndash;931. https://doi.org/10.1007/s10452-023-10044-8\u003c/li\u003e\n \u003cli\u003eScharnweber K (2020) Morphological and trophic divergence of lake and stream minnows ( \u003cem\u003ePhoxinus phoxinus\u003c/em\u003e ). Ecology and Evolution 10:8358\u0026ndash;8367. https://doi.org/10.1002/ece3.6543\u003c/li\u003e\n \u003cli\u003eSchneider J, Meske C, Kuss P (2024) Foundation Models: A New Paradigm for Artificial Intelligence. Bus Inf Syst Eng 66:221\u0026ndash;231. https://doi.org/10.1007/s12599-024-00851-0\u003c/li\u003e\n \u003cli\u003eSchrank AJ, Webb PW, Mayberry S (1999) How do body and paired-fin positions affect the ability of three teleost fishes to maneuver around bends? 77:203\u0026ndash;210. https://doi.org/10.1139/z98-209\u003c/li\u003e\n \u003cli\u003eSigur\u0026eth;ard\u0026oacute;ttir AR, Sveinsd\u0026oacute;ttir HI, Schultz N, et al (2024) Sequence Segmentation of Nematodes in Atlantic Cod with Multispectral Imaging Data. Foods 13:2952. https://doi.org/10.3390/foods13182952\u003c/li\u003e\n \u003cli\u003eSotola VA, Craig CA, Pfaff PJ, et al (2019) Effect of preservation on fish morphology over time: Implications for morphological studies. PLoS ONE 14:e0213915. https://doi.org/10.1371/journal.pone.0213915\u003c/li\u003e\n \u003cli\u003eSu G, Vill\u0026eacute;ger S, Brosse S (2019) Morphological diversity of freshwater fishes differs between realms, but morphologically extreme species are widespread. Global Ecol Biogeogr 28:211\u0026ndash;221. https://doi.org/10.1111/geb.12843\u003c/li\u003e\n \u003cli\u003eTonella LH, Ruaro R, Daga VS, et al (2023) NEOTROPICAL FRESHWATER FISHES : A dataset of occurrence and abundance of freshwater fishes in the Neotropics. Ecology 104:e3713. https://doi.org/10.1002/ecy.3713\u003c/li\u003e\n \u003cli\u003eTseng C-H, Hsieh C-L, Kuo Y-F (2020) Automatic measurement of the body length of harvested fish using convolutional neural networks. Biosystems Engineering 189:36\u0026ndash;47. https://doi.org/10.1016/j.biosystemseng.2019.11.002\u003c/li\u003e\n \u003cli\u003eWebb PW (1984) Body Form, Locomotion and Foraging in Aquatic Vertebrates. American Zoologist 24:107\u0026ndash;120\u003c/li\u003e\n \u003cli\u003eWebb PW (1982) Locomotor patterns in the evolution of actinopterygian fishes. American Zoologist 22:329\u0026ndash;342\u003c/li\u003e\n \u003cli\u003eWinemiller KO (1991) Ecomorphological Diversification in Lowland Freshwater Fish Assemblages from Five Biotic Regions. Ecological Monographs 61:343\u0026ndash;365. https://doi.org/10.2307/2937046\u003c/li\u003e\n \u003cli\u003eYamada T, Sugiyama T, Tamaki N, et al (2009) Adaptive radiation of gobies in the interstitial habitats of gravel beaches accompanied by body elongation and excessive vertebral segmentation. BMC Evol Biol 9:145. https://doi.org/10.1186/1471-2148-9-145\u003c/li\u003e\n \u003cli\u003eYu C, Fan X, Hu Z, et al (2020) Segmentation and measurement scheme for fish morphological features based on Mask R-CNN. Information Processing in Agriculture 7:523\u0026ndash;534. https://doi.org/10.1016/j.inpa.2020.01.002\u003c/li\u003e\n \u003cli\u003eZhuang F, Qi Z, Duan K, et al (2021) A Comprehensive Survey on Transfer Learning. Proc IEEE 109:43\u0026ndash;76. https://doi.org/10.1109/JPROC.2020.3004555\u003cstrong\u003e\u003c/strong\u003e\u003c/li\u003e\n\u003c/ol\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Fish morphology, foundation models, field photography, image-based morphometrics, PhotaFish system","lastPublishedDoi":"10.21203/rs.3.rs-6552537/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-6552537/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eNeotropical freshwater fish are among the most morphologically diverse vertebrates, but their study has long depended on preserved specimens, limiting our understanding of their natural body shapes due to preservation-induced distortions. Field photography provides a powerful, noninvasive alternative to capture fish morphology as it occurs in nature. However, automatically extracting accurate shape information from these images remains a major challenge, especially for highly diverse taxa. Here, we present an AI-based workflow that integrates Segment Anything, to automate fish segmentation and shape extraction from field photographs. We applied this workflow to CavFish-Colombia, a curated dataset of 1,749 images representing 393 Colombian freshwater fish species, obtained using the PhotaFish standardized imaging system. Achieving more than 97% segmentation accuracy, our workflow enables precise and consistent extraction of natural fish body shapes. We provide the first structured morphospace of Colombian freshwater fish based on natural body shapes, quantified through descriptors such as area, perimeter, and invariant moments. This morphospace reveals distinct gradients in body size and contour complexity, spanning from large, robust species with rounded forms to small, elongate species related to locomotion and habitat use. Our results demonstrate that AI-driven field photograph analysis can transform large-scale morphological studies, delivering accurate, rapid, and scalable data for biodiversity evaluations, functional trait analyses, and ecological research. This noninvasive morphological monitoring, directly from field images, opens new opportunities to assess fish morphology and analyze shape variation as it naturally occurs, capturing more accurate representations of living specimens.\u003c/p\u003e","manuscriptTitle":"Deep Learning on field photography reveals the morphometric diversity of Colombian Freshwater Fish","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-05-07 09:19:06","doi":"10.21203/rs.3.rs-6552537/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"84275b03-3e20-41a3-a97e-5514ba90cb14","owner":[],"postedDate":"May 7th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2025-05-07T17:53:31+00:00","versionOfRecord":[],"versionCreatedAt":"2025-05-07 09:19:06","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-6552537","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-6552537","identity":"rs-6552537","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.