Sizing mudsnails: Applying superpixels to scale growth detection under ocean warming

The expansion of scientific image data holds great promise to quantify individuals, size distributions and traits. Computer vision tools are especially powerful to automate data mining of images and thus have been applied widely across studies in aquatic and terrestrial ecology. Yet marine benthic communities, especially infauna, remain understudied despite their dominance of marine biomass, biodiversity and playing critical roles in ecosystem functioning. Here, we disaggregated infauna from sediment cores taken throughout the spring transition (April–June) from a near‐natural mesocosm setup under experimental warming (Ambient, +1.5°C, +3.0°C). Numerically abundant mudsnails were imaged in batches under stereomicroscopy, from which we automatically counted and sized individuals using a superpixel‐based segmentation algorithm. Our segmentation approach was based on clustering superpixels, which naturally partition images by low‐level properties (e.g., colour, shape and edges) and allow instance‐based segmentation to extract all individuals from each image. We demonstrate high accuracy and precision for counting and sizing individuals, through a procedure that is robust to the number of individuals per image (5–65) and to size ranges spanning an order of magnitude (<750 μm to 7.4 mm). The segmentation routine provided at least a fivefold increase in efficiency compared with manual measurements. Scaling this approach to a larger dataset tallied >40k individuals and revealed overall growth in response to springtime warming. We illustrate that image processing and segmentation workflows can be built upon existing open‐access R packages, underlining the potential for wider adoption of computer vision tools among ecologists. The image‐based approach also generated reproducible data products that, alongside our scripts, we have made freely available. This work reinforces the need for next‐generation monitoring of benthic communities, especially infauna, which can display differential responses to average warming.


| INTRODUC TI ON
Imaging data have proliferated throughout studies of ecology and evolution (Høye et al., 2021;Schürholz & Chennu, 2023;Weinstein, 2018).Digital images are data-rich, conventionally represented as matrices of pixel intensities across three colour channels (red, green and blue; RGB) with millions of colour variations possible for each pixel in a 24-bit image.Instance segmentation (object detection) is a core computer vision task to locate and extract embedded objects from images.Advances in computer vision have made segmentation widely applicable across aquatic ecology to detect objects from images, ranging from microalgae and marine snow (Irisson et al., 2022;Orenstein, Ayata, et al., 2022) to whales (Fretwell et al., 2014).Analysing objects in digital images has enabled quantification of fundamental properties (e.g., species identity, abundance and size) towards describing global biogeographic patterns (Biard et al., 2016), broad-spectrum animal behaviour (Dell et al., 2014), ephemeral river plume controls on coastal fish communities (Axler et al., 2020), novel feeding strategies by planktonic heterotrophs (Mars Brisbin et al., 2020), cryptic parasitism (Orenstein, Saberski, et al., 2022) and discovering new life (Mordret et al., 2016).However, less attention has been given to imaging marine benthic organisms, despite these ecosystems harbouring a substantial portion of global biodiversity and whose members are critical in nitrification, cycling carbon and other nutrients, and filtering water pollutants (Herbert, 1999;Snelgrove, 1997).
Benthic ecosystems are generally data-poor compared with pelagic zones (Hughes et al., 2021).Benthic habitats classifications with acoustics (Brown et al., 2011;Mehler et al., 2018), scanning images or videos on coral reefs (e.g., Pizarro et al., 2017;Schürholz & Chennu, 2023), or direct observations of epifauna (e.g., Piechaud et al., 2019) all help access species behaviour and interactions, but also omit infaunal groups that possibly comprise the greatest fraction of biodiversity and biomass on Earth (Snelgrove, 1998).Here, extractive sampling (e.g., sediment cores) to monitor specimens under controlled conditions still carries great value for high-frequency and repeated measurements of individuals.But after the difficulty of typical species collection-bulk sediment acquisition, core subsampling, sieving, washing, chemical preservation and sorting-the issue of taxonomically identifying, counting and sizing individuals is a forbidding undertaking.An improvement would be to collect and image disaggregated sediments, automatize counting and sizing of individuals, and store image records to be quickly reproducible, abiding by the now widely adopted FAIR (Findable, Accessible, Interoperable and Reusable) data protocols (Wilkinson et al., 2016).
Coastal ecosystems are prime candidates for increased exploration of benthic communities.Coastal zones encompass the most productive marine regions on the planet (Behrenfeld et al., 2006;Field et al., 1998), which have experienced profound depletion and rearrangement of living resources driven by the density of human settlement (Jackson et al., 2001;Lotze et al., 2006).Coastal tidal mudflats are highly productive ecosystems that provide essential habitat for seagrasses, support large bird populations, alongside breeding and nursery grounds for coastal fishes (Dissanayake et al., 2018).Tidal mudflats also support diverse assemblages of benthic macroinvertebrates (>1 mm) that modify sediments through bioturbation-altering the fabric of species-to-species and speciesenvironment interactions, thereby creating or rearranging habitats (Meadows et al., 2012;Meysman et al., 2006).The infaunal hydrobiid (Hydrobiidae, Stimpson, 1865) mudsnails exhibit several species distributed throughout European coastal waters, which can achieve high numerical abundance and biomass in tidal sediments (Barnes, 1999;Blanchard et al., 2000;Schückel & Kröncke, 2013), imparting significant contributions to ecosystem functions including sediment stabilization and water quality improvement owing to their filtering potential (Andersen & Pejrup, 2002;Gresens et al., 2009;Reynoldson & Metcalfe-Smith, 1992).Detecting changes in abundance or morphology in these or in other intertidal ectotherms on fine temporal scales can clarify the relative role of environmental conditions on growth.Temperature shapes individual growth across life stages (O'Connor et al., 2007) and accelerated warming potentially favours an earlier onset of smaller-size individuals (Pörtner et al., 2014) or drives population abundance shifts due to heatwaves (Pansch et al., 2018).Given the effects of environmental changes in coastal ecosystems, establishing image-based workflows for assessing the growth responses of important infaunal groups can help advance benthic monitoring towards next-generation approaches.
In this work, we apply a segmentation approach to extract hydrobiid mudsnails from stored images and automatically estimate multiple morphological properties, including assessing their size-distribution responses to experimental warming treatments.
Segmentation is based on clustering of superpixels-grouped representations of underlying pixels with similar colour, texture, edges and other low-level features (Ren & Malik, 2003) that has achieved accuracy and efficiency across benchmark datasets in computer vision (Achanta et al., 2012;Stutz et al., 2018).This method expedited hydrobiid size measurements tremendously, tallying >40k individuals, reducing the need for manual measurements, limiting human measurement bias and generated reproducible data that could be inspected for segment quality.Computer vision tools more broadly can make quantitative monitoring possible for benthic population bioindicators combining abundances or functional diversity (e.g., Salas et al., 2006) to assess impacts by species invasions, acute environmental stressors and broader climate changes.Advances in computer vision will continue to improve and modernize ecological studies and here we demonstrate a fast method for accurately automatic size measurement, Hydrobiidae, image segmentation, mesocosm experiment, superpixels, Wadden Sea scaling a crucial step in benthic ecology research, revealing a consistent growth response of an important invertebrate group under anticipated ocean warming.

| Sediment collection and mesocosm setup
Located on the European shelf of the North Atlantic Ocean (Figure S1), the Wadden Sea ecosystem contains the largest continuous intertidal flats (sand mudflats) on Earth (UNESCO, 2011).We collected bulk sediment samples at low tide (09:00-11:00 CET) on 22 March 2022 from an intertidal bed (54°31′55.83″N, 8°42′40.36″E) next to Pellworm, a German island in the Schleswig-Holstein Wadden Sea National Park (Figure S1).Bulk sediments were randomly assorted to mesh-lined baskets and introduced to a mesocosm setup, located at the Alfred Wegener Institute for Polar and Marine Research Wadden Sea Station (55°01′19.28″N, 118 8°26′17.43″E), on the northwest coastal island of Sylt, Germany.A full overview of the mesocosm tank configurations, tidal simulation system, physico-chemical sensors and evaluation under warming, acidification and nutrient treatments has been published (Pansch et al., 2016).
Briefly, we used 12 cylindrical mesocosm tanks (height × width, water volume; 170 cm × 85 cm, 1800 L) covered with a translucent lid permitting 90% photosynthetically active radiation.The tanks are supplied with non-filtered seawater pumped from 50 m offshore in the Sylt-Rømø Bight with tank flushing achieved every 18 h (1.67 L min −1 ), and a sinusoidal tidal scheme allowing stepwise vertical gain (70-20 cm depth) of the 1 m 2 sampling platform at a 6-h tidal cycle.Tidal currents are simulated with compressed air supplied from opposing sides of the lower 30 cm of each tank through two porous rubber ventilation hoses (90 cm long, 10 mm diameter) with 1 mm holes at 1 cm intervals (OSAGA, Glandorf).A multi-sensor monitoring system is equipped for pairs of tanks, using a Hydrolab DS5X Probe (OTT Messtechnik GmbH, Kempten Germany) to measure a suite of environmental variables every minute-this work focused on temperature as the primary factor driving differences between tanks.
Experimental warming was simulated using three heaters per tank (Titanium heater 500 W; Aqua Medic, Bissendorf, Germany) and cooling to balance overheating (Titan 2000 or Titan 4000; Aqua Medic, Bissendorf, Germany); both aspects are regulated automatically by a software program (Labview based, version 4.1.0.30; 4H-Jena engineering, Jena, Germany).Temperatures were manually adjusted twice a week to correct for seasonal changes and maintain temperature treatment conditions based on field measurements collected through the Sylt Roads Marine Observatory time series in Königshafen, Sylt, Germany (55°02′17.88″N, 8°26′17.88″E; Rick et al., 2023).For our analyses, the in-tank sensor data were aggregated to median hourly values.Independent manual temperature (Testo 110 thermometer) measurements were taken weekly around noon (12:00 CET).
The warming experiment was conducted using four tanks per treatment: Control tanks at ambient seawater temperature, +1.5°C and +3.0°C above ambience.Temperature treatments were randomly assigned across the 12 tanks conditional that adjacent tanks must contain different treatment conditions.Sediments were exposed continuously to the experimental treatments, including diurnal variation from inflowing seawater, from 23 March through 20 June 2022.To analyse infauna throughout this period, four sampling events were used to collect sediment cores (x̄ = 664.32cm 3 , σ = 53.07cm 3 ) from one mesocosm basket per tank, per event: (1)   30 March, (2) 25 April, (3) 24 May, (4) 20 June.Cores were immediately washed and sieved (1 mm mesh size) to disaggregate sediments and collect benthic invertebrates.The sieved material was promptly placed in 250 mL PVC bottles, filled with 5% buffered formalin and stored until further sample processing.The invertebrates were sorted and identified to the lowest possible taxonomic resolution.All image processing and analysis were conducted in the R programming language (R Core Team, 2022).Raw images were processed using the package EBImage (Pau et al., 2010;Figure S2):

| Image dataset and processing
Images were blurred with a low-pass Gaussian filter to remove background noise and normalized (0-1) to flatten irregularities in pixel intensity.The standard deviation for the Gaussian filter was set at a high value (σ = 8) to reduce the occasionally substantial background noise due to reflected light on the plate edges.

| Object segmentation
To detect hydrobiids from images, we used a clustering approach in the package SuperpixelImageSegmentation (Mouselimis, 2022a), which combines a simple linear iterative clustering algorithm (SLIC) with affinity propagation and mini-batch K-means clustering (Zhou, 2015; Figure S3).Clustering partitioned images semantically based on superpixels, which were generated by SLIC to group pixels by low-level properties (Ren & Malik, 2003).In our approach, we tested segmentation using 600 (default; Zhou, 2015) and 1500 superpixels per image, while keeping a small colour radius argument constant (sim_color_radius = 20) to create more finely detailed segments of hydrobiid individuals, which were complex in shape, size and colour (Figure 1).A comparison between each setting (600 and 1500 superpixels per image) and manual measurements suggested that 1500 superpixels generated more accurate representations of mudsnail sizes (Figure S4) and was therefore applied to the larger dataset presented below.
Segmentation followed four steps: (1) SLIC divided processed images into superpixels, (2) a negative Euclidean distance computed a similarity matrix of superpixel features, (3) affinity propagation clustered superpixels based on similarity and (4) vector quantization of clusters using mini-batch K-means qualitatively refined clusters.
The resultant clusters were extracted as an image array and segmented using three different algorithms including threshold-based (binary), edge-based (Frei & Chen, 1977;Mouselimis, 2022b) and a region-based algorithm (watershed; Beucher & Meyer, 1993) to test for sensitivity in defining each segment as an individual (i.e., instance).Segments were filled to remove holes or inner gaps to create final, complete segments.The result was that mudsnails occupied multiple clusters (object masks in Figure 1) and were segmented in rich detail as compositions of multiple clusters.Morphological parameters from each hydrobiid contour (Pau et al., 2010;Supporting Information) were calculated, converting pixels to millimetres, where the maximal diameter was considered an approximation of hydrobiids' elongated shape.
To evaluate predicted versus observed size distributions for each image, we quantified distribution overlap using kernel density estimations from the package overlapping (Pastore, 2018) S1).The variation in five additional morphological parameters (perimeter, area, roundness, elongation and complexity, e.g., Vilgrain et al., 2021) was also explored using a principal component analysis (PCA; Jolliffe & Cadima, 2016) across events and temperature treatments (Figure S9, Table S2).

| RE SULTS
Throughout our experiment, the temperature sensors recorded nearly 700k observations.Manual weekly measurements for tem- manual measurements (Figure 2).Each trend described here also held for each individual tank, with varying degrees of temperature dictated by the warming treatment (Figure S5).
The principal result of this work demonstrates that hydrobiid mudsnails were generally segmented reliably from the plate background, enumerated accurately and measured end-to-end with a high degree of accuracy and precision (Figure 3).The performance of our segmentation approach appears robust to the choice of segmentation algorithm (Figure 3).The number of individuals estimated was highly similar to manual counts (n threshold = 4689, n edge = 4493, n region = 4568, n obs = 4595), and their size distributions matched likewise (Figure 3).Kernel density estimates reveal consistently high overlap between observed and estimated length measurements from segmentation, averaging >90%, while the median values and variance (i.e., the overall shape) of our segmented estimates matched compellingly to observed values (Figure 3).For both counting and size estimation, our results provided generally conservative estimates that were flexible against the number of individuals per image and the wide size distributions, which spanned an order of magnitude, <750 μm to >7.4 mm.After evaluating our segmentation method, we applied it onto the remaining 44 samples containing 918 images to count mudsnails and estimate their size distribution.Our approach to implement segmentation consecutively for all images in each sample allowed each to be visually checked for segment quality after completion.The entire segmentation process took approximately 2 min per image and totalled roughly 40 h of computational time for all samples.In our experience, manual measurements of all individuals in an image (median mudsnails per image in manual samples = 54) took roughly 10 min, suggesting our workflow offered at least a fivefold increase in efficiency.This efficiency gain was even greater in high-density images, which were laborious to complete manually.
In total, 42,042 hydrobiid mudsnails were estimated across all images by our segmentation method (watershed algorithm; median mudsnails per image = 41, median size = 3.88 mm).The estimated growth response of hydrobiids across time points, temperature treatments and mesocosm tanks is presented in Figure 4.
Although growth was evident, the overall trend from March (x̄ = 3.65 mm) through June (x̄ = 3.89 mm) was marginal (Figure 4).Size differences were insignificant across temperature treatments, with only sampling events (time) indicating a significant relationship to mudsnail sizes (Table S1).Size distributions within tanks revealed most clearly that average size increased throughout the sampling period except in two tanks (C3 and D4).The raw, processed (blurred and normalized), and segmented images including metadata are accessible in PANGAEA (MacNeil et al., 2024) and the resulting features combined with R script are also available (MacNeil, 2024).

| DISCUSS ION
Using abundant mudsnails from a well-studied intertidal ecosystem, this work demonstrated the ability of computer vision tools to rapidly harvest quantitative morphological properties with high accuracy and precision.The efficiency gains far surpassed manual measurements and our data products support reproduction (see Data Availability Statement).As a segmentation tool to delimit semantic information of biological traits (i.e., shape, size, colour), superpixels appear highly generalizable across faunal groups, including many infauna typically sampled from sediments (Figure S10), and using relatively simple segmentation algorithms that can suffer from oversegmentation (Bai & Urtasun, 2017).
Accelerating digital imaging collection for groups of ecological relevance such as coastal mudsnails-and molluscs more broadly-is a promising path towards unifying monitoring and conservation efforts in tidal mudflats, where there are natural alignments with seagrass restoration through their importance in facilitation and mutualism in the rhizosphere (Levin et al., 2001).Image-based monitoring will benefit from tools beyond the relatively lowresolution stereomicroscopy used here, including higher resolution or three-dimensional scanning approaches (e.g., tomography), Improving image segmentation and analysis more broadly in ecology will first require generating annotations of big image datasets, which are difficult to acquire on brief field surveys or research cruises.The mesocosm setup provided access to repeated samples from a controlled environment with high-resolution sediment coverage.As a mesocosm receiving seawater directly from the Wadden Sea, we expect environmental conditions to have simulated near-natural conditions withstanding systematic diminution of light levels due to tank enclosure, wall effects and lower primary productivity (Pansch et al., 2016).Although this work focused on methodological advances for quantifying species abundance and size structure, limits of our mesocosms towards holistic community experiments include the incomplete representation of the intertidal communities upon introduction, for example, the absence of coastal fish communities as important contributors to biogeochemical budgets through feeding and excretion (Allgeier et al., 2013;Saba et al., 2021).Lessened productivity could explain the insignificant difference in sizes across treatments, where heatstressed individuals required greater food to grow.It is also possible that high mortality under +3.0°C was not registered during discrete sampling events, artificially lowering size estimates and obscuring patterns in other morphological traits.Moreover, hydrobiids might have exhibited acute resilience to +3.0°C average warming during springtime owing to physiological plasticity and a diversity of life history strategies across species (Barnes, 1999).
Our segmentation approach could also be improved to analyse other traits.For example, colour is a central eco-evolutionary trait among others for predator avoidance, regulating UV exposure, and a signal of key life stage developments (Martini et al., 2021).
Colour is explicitly incorporated into superpixel calculation in combination with other low-level features.But in doing so, unique colour information is lost as an analysable trait.Although we currently do not extract colour categorizations of superpixels, recolorizations might be possible for a broad set of images and support wider trait-based analysis in biology (Weller et al., 2022).Many different algorithmic approaches are possible to segment and extract features from mudsnails or other infauna.Deep learning models are a clear option because they have established benchmarks for accuracy and precision across computer vision domains (LeCun et al., 2015;Minaee et al., 2021).A transferlearning approach using pre-trained convolutional neural networks could adequately segment hydrobiid mudsnails from our images (e.g., Razavian et al., 2014); a recent package has compiled several transfer-learning tools for segmentation and classification in the R programming language (Niedballa et al., 2022) (Stutz et al., 2018).
Perhaps most relevant to the uptake of computer vision techniques in ecology is that the R programming environment, ecology's most popular (Lai et al., 2019), lags behind Python in functionality and community engagement (e.g., OpenCV;Bradski, 2000).It is therefore important that our workflow was developed exclusively in R, except manual measurements, and that new R packages are integrating the array of computer vision tools (e.g., Garnier & Muschelli, 2022).
Assessing infaunal growth responses with computer vision opens greater possibilities to characterize benthic community structure in space or time, and to relate these patterns to shifts in ecosystem stability and functioning (Brose et al., 2017).More generally, future applications of digital imaging tools for monitoring should include combinations with multi-omic toolkits to bridge morphologically resolved, quantitative records with broad-spectrum surveys of hidden molecular diversity (Martini et al., 2021).Still, in an ideal setting with all data types available, interpreting community dynamics remains difficult, but improving imaging analysis in specific tasks and extracting data-rich records can help reconcile patterns of species abundance and size structure.These records would be valuable indicators for the continued restoration of the Wadden Sea in response to its millennium-long traces of human-driven activities (Lotze et al., 2005;Weijerman et al., 2005), where mudsnail abundances and growth rates are strongly associated with nutrient runoff, seagrass density and habitat quality (Gräfnings et al., 2023), while also relevant for assessing competition and threat from invasive benthic invertebrates (e.g., Pacific oyster Magallana gigas; Reise et al., 2017).
More broadly, quantitative records of the macrozoobenthos give important baselines for the effects of climate or environmental change on coastal ecosystems (Harley et al., 2006), portending consequences for species ranges, phenology, abundances and the structure of community composition.

| CON CLUS IONS
Fast and accurate segmentation of hydrobiid mudsnails from images revealed seasonal growth under springtime conditions in a near-natural mesocosm setup and suggests resilience in size development under ocean warming up to +3°C.Our computer vision approach expedited enumeration and size-distribution estimates at least fivefold compared with manual measurements and was robust to the number of individuals and varying size distributions per image.We advocate for a wider usefulness of superpixels to explicitly incorporate colour and other low-level features towards detecting objects and traits that are ecologically or evolutionarily relevant from images.Due to the in silico design of our workflow, all data products were automatically stored for quality assessment, method improvement and accessibility.This work also illustrates the high value of mesocosm setups to boost data collection for testing the capacity of image-based analysis to scale.
The expansion of image segmentation techniques and computer vision more broadly has powerfully enriched the tools available to ecologists.This work demonstrates that a major bottleneck for the quantification of infaunal groups can be addressed using freely available tools in ecology's most popular programming language; it also underlines the importance of deeper investigation into benthic ecosystems through imaging.
Hydrobiid mudsnails were distributed across a petri plate and imaged under brightfield stereomicroscopy (Nikon SMZ18, DS-Fi3 camera 5.39 megapixels, and LED base light with oblique coherent contrast, 1× magnification).Images are 2880 × 2048 pixels with 96 pixels per inch resolution, 83 pixels per millimetre scale and at ~17 MB per image; the resultant 1008 images from 48 samples totalled ~18 GB.Due to hydrobiids' numerical abundance, counting and measuring each individual manually was prohibitive.To test an automatic workflow for image segmentation and object measurement, we manually measured hydrobiid mudsnails at their longest axis to approximate size in millimetres from four sediment samples in ImageJ (Abramoff et al., 2004), totalling 4595 individuals from 90 images.
. Comparing the overlap between kernel density estimates incorporates all the information about mudsnail sizes, rather than relying on a traditional statistical significance test which compares only group means and standard deviations.Assessing size estimation at the individual level was ignored for two reasons: First, it was impractical to generate additional annotations for individuals within each image; secondly, we focused on population-level responses to experimental warming treatments instead of individual-level variations.Subsequent methods and results are presented from the watershed segmentation algorithm, chosen due to its comparatively high performance demonstrated below.After evaluating size estimations on four manually measured samples (90 images), the segmentation approach was applied automatically to the remaining 44 samples (918 images) across treatments and time points.To test the relative effect of temperature on mudsnail size within our experiment, we constructed a generalized linear mixed model (GLMM) using temperature and sampling event (time) as fixed effects, tank identity as a random effect and a model selection procedure described in the Supporting Information (Figures S7-S8, Table perature totalled 804.Aggregating probe values to hourly resolution (30k observations) retained diurnal variation and captured seasonal trends from the Sylt-Rømø Bight: Spring warming from May through June was evident in the tanks with seawater rising from 7°C to 20°C (Figure 2).Temperature values closely tracked field values from the Sylt Roads Marine Observatory time series (Rick et al., 2023).The demarcation between temperature treatments is clearly shown in F I G U R E 1 General workflow for image segmentation.(a) Raw images (2048 × 2880 pixels; 96 dots per inch [DPI]) were processed (blurred and normalized) and then 1500 superpixels per image were generated using simple linear iterative clustering (SLIC).(b) Clusters were defined with affinity propagation, object masks were extracted from clusters, and segmentation was tested using binary thresholding, an edgebased and a watershed algorithm.Gaps within segmented objects were infilled to generate a more complete representation of hydrobiid individuals.

F
Temperature values aggregated to hourly resolution from mesocosm probes across all 12 tanks (30k observations) plotted beneath points showing manual measurements by treatment type; vertical lines indicate sediment core sampling events.F I G U R E 3 Overlap of manual versus estimated hydrobiid size distributions using superpixel-based segmentation across samples (SF: Sediment Fauna): (a) SF43 (n obs = 966), (b) SF84 (n obs = 1405), (c) SF114 (n obs = 1574) and (d) SF131 (n obs = 623).Overlap is represented as the percentage of overlapping area between manual and segmented kernel density estimates, coloured by segmentation algorithm (Pastore, 2018).

F
I G U R E 4 Quantitative profiling (empirical cumulative distribution function) of hydrobiids' response to experimental warming was possible by rapid segmentation with accurate and precise measurements.The total size distributions are shown across each sampling time point (y-axis), temperature treatment (colours) and tank (facet headers).Vertical lines indicate quartiles where the centre line represents median values.which could offer signals of population vulnerability via gastropod shell density changes under warming and acidification (Chatzinikolaou et al., 2017).Other modes of 3-D reconstruction by photogrammetry could improve feature acquisition (e.g., size, volume and shape) or microstructure detection for more reliable morphological identification and help scale ecosystem monitoring (Ferrari et al., 2021).
. Yet these techniques would typically require initial training rounds on pre-segmented examples to repurpose these models, commonly known as domain adaptation (Daumé III & Marcu, 2006).With convolutional neural networks, superpixels could replace raw 2-D images as inputs, ensuring that highly similar pixels clustering around salient objects are predefined to improve hierarchical representation of object features (He et al., 2015).However, automatic species identification and enumeration from deep learning classifiers remain challenging-aside from cryptic diversity obscuring morphological identification between molluscs and many other infauna-due to limited annotated datasets for training pattern recognition and by the propagation of training errors onto unseen samples, termed dataset drift (sensu González et al., 2018).Altogether, our approach avoided protracted model training and evaluation methods and suited our relatively straightforward task to segment and accurately measure objects with flexible outputs to segment mudsnails as composites of clusters.More sophisticated evaluation metrics are available for future works beyond counts and length measurements using superpixel-based segmentation, involving detailed inspection of segment boundary adherence, variability, superpixel compactness or other estimates of the trade-offs between runtime and performance Léa J. Joly, Maysa Ito and Marco Scotti conceived the ideas.Liam MacNeil designed the methodology and led the writing of the manuscript.Léa J. Joly, Maysa Ito, Marco Scotti, Anna Steinmann and Knut Mehler collected the data.Liam MacNeil analysed the data.All authors contributed critically to the drafts and gave final approval for publication.ACK N OWLED G EM ENTS Liam MacNeil and Marco Scotti thank the German Federal Agency for Nature Conservation (Bundesamt für Naturschutz, BfN), which provided financial support with funds from the Federal Ministry of the Environment, Nature Conservation and Nuclear Safety (BMU), under the grant agreement FKZ: 3521532201.Léa J. Joly, Maysa Ito, Anna Steinmann, Knut Mehler and Marco Scotti received financial support from the Bundesministerium für Bildung und Forschung (BMBF) through the project iSeal (grant number: 03F0913), in the framework of the Deutsche Allianz für Meeresforschung (DAM) mission sustainMare.We owe special thanks to Maja Drakula for her work imaging a preliminary dataset, and we thank Hannes Wiegand, Samuel Morsbach and Josefine Karnatz for their work processing sediment samples.All named individuals are listed as authors in the PANGAEA dataset (see Data S U PP O RTI N G I N FO R M ATI O N Additional supporting information can be found online in the Supporting Information section at the end of this article.

Figure S1 .
Figure S1.Sediment collection and preparation of the mesocosm setup.

Figure S2 .
Figure S2.The typical pixel intensities in raw images for each color channel (RGB).

Figure S5 .
Figure S5.Temperature values aggregated to hourly resolution with automated probes for each mesocosm tank; manual measurements are represented as points.

Figure S6 .
Figure S6.Distribution of mudsnail sizes across the full dataset (n est = 42042) estimated by our superpixel-based segmentation method (watershed algorithm).

Figure S9 .
Figure S9.The first three principal components (PC1-PC3) characterizing mudsnail morphological traits of shape (roundness, elongation, complexity) and size (length as size, perimeter, area) across (A) treatment conditions and (B) monthly sampling events.

Figure S11 .
Figure S11.Returned masks from each cluster during image segmentation from 1500 superpixels, defined by affinity propagation based on pairwise similarity to color-centroid exemplars, and quantized with mini-batch K-means.Table S1.The selected GLMM model coefficients and p-values (***indicates < 0.001) where mudsnail size at time zero in ambient treatment is used as a reference level.TableS2.Morphological descriptors generated by EBImage(Pau et al., 2010); the values across treatments (ambient, +1.5°C, +3°C) indicate the ratio of descriptors from June:March (Event 3:Event 0).