The Riverine Organism Drift Imager: A new technology to study organism drift in rivers and streams

Drift or downstream dispersal is a fundamental process in the life cycle of many riverine organisms. In the face of rapidly declining freshwater biodiversity, there is a need to enhance our capacity to study the drift of riverine organisms, by overcoming the limitations of traditional labour‐intensive sampling methods that result in data of low temporal and spatial resolution. To address this need, we developed a new technology, the Riverine Organism Drift Imager (RODI), which combines in situ imaging with machine‐learning classification. This technique expands on the traditional methodology by replacing the collection cup of a drift net with a camera system that continuously images riverine organisms as they drift through the device. After being imaged, organisms are released into the environment unharmed. A machine‐learning classifier is used after field sampling to identify drifting organisms. Therefore, RODI provides a non‐invasive sampling method that can quantify organism drift at unprecedented temporal resolution. Multiple deployments have served to validate the performance of the technology in the field. In its current implementation, images are captured continuously for 1.5 h at 50 frames per second. We demonstrate that the quality of the resulting images enables a convolutional neural network classifier to identify organisms to the family level. The weighted F1 score, a metric for the performance of the classifier, was 94%, based on training and testing on a field‐collected dataset consisting of 4598 images of 285 organisms belonging to seven classes (one species, five families and one order). In conclusion, this work provides a proof of concept, demonstrating the viability of the deployment of RODI as an automated, in situ organism drift sampler. This novel approach offers the possibility to advance our fundamental understanding of the drift of riverine organisms and how this is affected by human impacts in natural streams while, at the same time, can serve as a cost‐effective tool for biodiversity monitoring.


| INTRODUC TI ON
In river ecosystems, drift or downstream dispersal is a fundamental part of the life cycle of many fish (Lechner et al., 2016;Pavlov & Mikheev, 2017) and benthic invertebrates (Brittain & Eikeland, 1988). The drift of eggs or fish larvae provides the means to disperse from spawning or nursery habitats to suitable rearing habitats (Pavlov, 1994). Due to the specific environmental needs of fish larvae, early life-stage survival, and hence population recruitment, is dependent upon drift (Humphries et al., 2020).
Benthic invertebrate drift is an essential trophic pathway in river ecosystems. The drift of benthic invertebrates can be a process of individual microhabitat selection to optimise resource acquisition or to avoid predation (Naman et al., 2016). At the same time, entering drift increases the risk of being predated by drift-feeding specialised guilds of fish (Grossman, 2014). Therefore, the biomass and species diversity of drifting benthic invertebrates can be considered indicators of the productive capacity of streams and rivers to support fish populations (Naman et al., 2016).
Human activity, including the construction of barriers, pollution and artificial flow alterations, has significantly altered the environmental conditions experienced by many riverine organisms, leading to drastic declines in freshwater invertebrate and fish populations over the last decades (Albert et al., 2021;Deinet et al., 2020). In Switzerland, for example, 65% of all fish species are threatened or have become regionally extinct, and so are 50% of benthic invertebrate species belonging to the orders of mayflies (Ephemeroptera), stoneflies (Plecoptera) and caddisflies (Trichoptera; FOEN, 2022). To improve freshwater biodiversity management and minimise the negative impacts of human activity, it is vital to enhance our capacity to monitor aquatic biota, particularly through non-invasive, broadly deployable methods that generate data with the appropriate temporal and taxonomic resolution. More specifically, long-term (months to years) and continuous (hourly to daily) data on species presence, abundance, and movement patterns. Such approaches have been increasingly applied in terrestrial (Zwerts et al., 2021) and marine environments (Francescangeli et al., 2023) with innovative imaging systems, but are still scant in freshwater ecosystems (Struthers et al., 2015).
Riverine organism drift has, to date, been studied predominantly using drift nets (Brittain & Eikeland, 1988;Lechner et al., 2016), most commonly in wadeable streams and rivers or from boats or bridges. Drift nets work by guiding organisms into a collection cup.
Sampled organisms are collected from the cup at regular intervals, usually 15 min to 3 h, and preserved (i.e. killed) for post-processing (Elliott, 1970). This is an invasive, labour-intensive process, especially for long-term studies, further complicated by the fact that invertebrate and fish drift densities peak at night (Brittain & Eikeland, 1988;Elliott, 1970;Pavlov & Mikheev, 2017). Nets, moreover, integrate organisms over time and distances because it pools all individuals in the same sampling cup for a specific exposure time, resulting in low sample resolution (Lechner et al., 2016), hindering our capacity to temporally resolve (second or minute scale) drift patterns at the individual level (Naman et al., 2016). The post-processing step compounds this bottleneck as the taxonomic identification of the organism samples is very time-consuming and requires specialised expertise, a skill that has been declining globally (Hopkins & Freckleton, 2002). As a result, data on organism drift remains sparse, consisting only of limited measurement campaigns of low temporal resolution.
Recent advances in camera and machine-learning technologies have enabled novel image-based methods, which provide vast amounts of data and enable ecologists to study organisms costeffectively and non-invasively Lürig et al., 2021).
Machine-learning-based identification methods for benthic invertebrates are well established (Ärje et al., 2020;Høye et al., 2022;Lytle et al., 2010;Raitoharju et al., 2018). However, they rely on preserved organisms to allow detailed image generation in laboratory conditions, and hence depend on labour-intensive, net-based sampling. In situ imaging has the potential to streamline this process, yet to date, systems developed to study riverine organisms have focussed on larger fish (Castañeda et al., 2020;Holter et al., 2020). A system that can image and identify smaller organisms (in the mm to cm range) in rivers has been lacking.
To overcome the limitations of traditional drift-net sampling, we are developing an underwater imaging system called the Riverine Organism Drift Imager (RODI). RODI provides a non-invasive, fieldgoing, flow-through sampling method that images drifting organisms and uses a machine-learning classifier to provide taxonomic identification of imaged individuals. By continuously imaging over time, the number of drifting organisms belonging to each of a set of classes can thus be quantified with high temporal resolution and reduced effort. Here, we describe a proof of concept for RODI's technology, including the field deployments used for testing and the machinelearning approach to classify imaged organisms. The camera is equipped with a 12 mm objective (Edmund Optics, 12 mm UC Series fixed focal length lens, f/8 to f/11) and is installed at a working distance of 170 mm ( Figure S5), resulting in a field of view of 100 mm × 61 mm and a depth of field of 35 mm. The camera housing is powered and operated by a weatherproof land station ( Figure S1) that houses a laptop collecting images from the camera and a transformer (Meanwell LPC-35-1400, 24 V, 1400 mA output) for the LED lights. The land station is connected to the camera box through two cables-a USB 3.1 cable and a 2 × 1 mm 2 power cable, of length 15 m-combined within a flexible plastic protective sleeve. RODI operates from the regular power grid (230 V). The design plans, parts use, and construction process are described in Appendix S1. The Gadmerwasser has a managed minimum residual flow of 350 L s −1 at the deployment site (Schweizer et al., 2012). The river substrate is predominantly a mix of gravel (2.5-25 mm in size) and cobbles (25-250 mm), with scattered larger boulders (>250 mm; Figure 1c). On 5 April 2022, freshly hatched (less than 1 day old) brown trout fry (Salmo trutta) were collected and released in the area between the metal fences, eventually drifting downstream through the system to be imaged. A night deployment from 10 May 2022, 21:00 until 11

| Field deployments
May 2022, 04:30 was performed to test the system's capacity to sample naturally drifting organisms. Finally, on 11 May from 10:00 to 14:00, benthic invertebrates were systematically released into the drift net. For this trial, we collected local benthic invertebrates by dipping large river boulders in buckets containing river water to release attached invertebrates. Collected invertebrates were carefully divided on-site into classes of likeliness (i.e. similar body morphology, F I G U R E 1 Field deployment of the Riverine Organism Drift Imager (RODI). (a) RODI installed in the riverbed and kept in place with boulders. The black arrow indicates the flow direction. (b) RODI's camera housing. Drifting organisms are guided through the flow tube (white dashed outline), where a colour camera takes multiple images of each organism in rapid sequence through a polycarbonate window. High-intensity LED lights provide sufficient light to avoid motion blur. (c) RODI in place within the river bed behind the two metal fences. The area upstream was fenced off with red-white tape to protect brown trout spawning habitats and to prevent the induction of organism drift by human activity. (d-f) The deployment location in Switzerland (46°42′28.2″ N 8°13′33.3″ E). The Gadmerwasser stream (e) is an alpine tributary of the Aare River. RODI was installed 200 m upstream of the Gadmerwasser's confluence with the Aare (f). size and colouring). Sampled invertebrates were then released individually within the drift net and captured upon exiting. Several random organisms per likeliness class were preserved for taxonomic identification. Using a stereomicroscope (Nikon SMZ-U zoom 1:10) and taxonomic keys (Bauernfeind & Humpesch, 2001;Waringer & Graf, 2013;Zwick, 2004), these organisms were identified to the following taxonomical groups (order, family): Ephemeroptera, Heptageniidae and Baetidae; Plecoptera, Perlodidae and Capniidae; Trichoptera, Rhyacophilidae. We used data from the 5 April 2022 and 11 May 2022 (daytime) experiments to generate an annotated image dataset to be used with the machine-learning classifier. Data from the natural drift experiment, 10 May 2022, were identified by a human and were not analysed using the machine-learning classifier (described in more detail below). Lastly, in agreement with the local wildlife authority (Fishereiinspektorat Kanon Bern), a permit was not required to run these experiment. During data processing, the bounding box of each drifting organism or object is determined, that is, a region is defined within the image that contains the organism or object of interest so that it (and not the whole image) can subsequently be used for classification ( Figure 2a). Bounding box extraction consists of several steps.

| Data acquisition and processing
The first temporary backup file (i.e. the first 1000 frames) from a given acquisition interval is converted into a video with a conventional video format (.avi). Next, using Fiji (Schindelin et al., 2012), a median background frame is calculated using the first 20 frames of the video.
The extraction of bounding boxes uses several OpenCV functions (Bradski, 2000), hereafter described as cv::function. For each frame in an acquisition interval, the absolute difference (cv::absdiff) with respect to the median background is calculated to remove stationary objects and minimise camera noise. Next, a Gaussian blur filter (cv::blur; 3 × 3 kernel size) is applied to reduce pixel noise. The resulting frame is binarised (cv::threshold), transforming all objects into white pixel regions, which are then saved as vectors of points (cv::findContours). The area of each object is calculated (cv::contou-rArea), and an area threshold is applied (typically, 2 mm 2 ) to remove noise and very small objects, such as individual sediment grains. The vector of points for each object that is retained is transformed into a polygon (cv::aproxPolyDP), around which an initial tight-fitting, rectangular bounding box (cv::boundingRect) is generated.
The coordinates and size of this tight-fitting, rectangular bounding box are used to define a loose-fitting, square bounding box, with each side equal to 1.5 times the longest side of the tight-fitting, rectangular bounding box. Finally, the square bounding boxes are extracted from the original raw image and saved as individual TIF files. Each drifting organism or object is imaged multiple times (typically, 10-15 times in the experiments described here) upon drifting through RODI, generating an equal number of bounding boxes. The ensemble of all bounding boxes belonging to an individual organism or object will be referred to as a 'drift event' hereafter ( Figure 2b).
Bounding boxes are sorted (currently this occurs manually) to retain drift events of interest, here drifting organisms, and discard other drift events (e.g. debris or air bubbles). Each drift event of interest is then given a unique identifier. Finally, all bounding boxes are converted to PNG format with a resolution of 250 × 250 pixels (Figures 2c and 3) in order to be used in the machine-learning classifier. The code to acquire images in the field and generate bounding boxes during processing can be found in Appendix S1.6.

| Machine-learning classifier
The bounding boxes extracted from in situ acquired images (Figure 3) form the input of a machine-learning classifier. For the classification process, an annotated dataset was obtained from the images recorded in the experiments on 5 April 2022 (brown trout) and 11 May 2022 (daytime benthic invertebrates releases). After completing the bounding box extraction, drift events containing organisms from these experiments were sorted into the following classes: Heptageniidae, Baetidae, Perlodidae, Capniidae, Rhyacophilidae and Salmo trutta. Annotation was performed using Label Studio (Tkachenko et al., 2020). Additionally, several bounding boxes revealed the presence of true fly (Diptera) larvae. Although Diptera larvae were not preserved for taxonomic classification, we included this class in the machine-learning classification, with their identity determined based on visual inspection of the images themselves.
The Res-Net18 architecture (He et al., 2016), a deep convolutional neural network with 18 deep layers, was used for classification. Non-overlapping cross-validation datasets were created, each containing training (~55%), test (~25%) and validation (~20%) drift events. The unique identifier for each drift event was used as a grouping variable, ensuring that each drift event occurred only once in a test set across all cross-validation datasets. Since the image dataset was unevenly distributed among the seven classes, we generated only four unique crossvalidation sets to ensure that all seven classes were present in the training, test and validation sets. A Res-Net18 network was trained (AdamW optimiser, learning rate finder and earlystopping activated) for each cross-validation set using its training and validation drift events. This resulted in an array of model weights that were subsequently used to perform classification on the test set drift events for that cross-validation dataset.
Since each drift event generated multiple bounding boxes, probabilistic image augmentation techniques were applied to the drift events used for training to prevent model overfitting (Shorten & Khoshgoftaar, 2019). The classification of test set drift events was repeated for each cross-validation dataset, using the respective model weights for each dataset. Classification results were aggregated as each test set was unique and represented From these scores, we computed a weighted precision, a weighted recall and a weighted F1 score as overall performance metrics suitable for datasets with unbalanced class distributions. Each weighted metric is calculated as the sum of that metric over all classes, where the sum is weighted for each class by the support for that class, that is the proportion of all drift events belonging to that class (Table S1: Proportion of drift events). A confusion matrix was generated to provide insights into the types of misclassification. The code for the machine-learning classifier can be found in Appendix S1.7. F I G U R E 2 Overview of the Riverine Organism Drift Imager (RODI) data acquisition and bounding box extraction. (a) The camera's field of view shows one image of an organism as acquired by RODI. A bounding box is generated for any object or organism within each frame. (b) The sequence of all images acquired for a given organism (shown overlaid on the size of the camera's field of view) is referred to as a 'drift event'. (c) All bounding boxes for each drift event are rescaled to 250 × 250 pixels for use in the machine-learning classifier.
To ensure that the applied machine-learning classifier was the suitable approach to our dataset, we performed a principal

| Natural organism drift at night
Natural drift was measured from 21:00 to 04:10 during the night of 10-11 May 2022 during four measuring intervals, each 1.5 h long.
During short time periods between measuring intervals (20-30 min), data were transferred from the laptop to an external hard drive, and the system (drift net and metal fences) was cleaned of debris.
In the images from this experiment, the bounding boxes resulting from image processing were sorted manually, discarding drift events F I G U R E 3 Example of bounding boxes (resized to 250 × 250 pixels) for each of the seven classes used in the machine-learning classification presented in this work. Each bounding box represents one image from one drift event (i.e. each bounding box is a unique organism), and an individual scale bar was added for illustration. The length of the scale bar is fixed on a per-class basis and is thus an approximation that does not account for the water-magnification effect.
containing debris or bubbles. The remaining drift events were identified by eye into six classes: Ephemeroptera, Plecoptera, Trichoptera, Diptera, Exuviae (discarded exoskeletons after moulting) and non-Benthic-Invertebrates. A unique identifier was assigned to each drift event, along with a time stamp. In these samples, organisms returned directly to the river environment and were not preserved for laboratory identification. Therefore, taxonomic identification was performed by a human using the bounding boxes, resulting in a lower resolution. During this process, we detected several drifting organisms with different morphologies within the orders Ephemeroptera and Plecoptera that were not present in the annotated dataset used for the machine-learning classifier. As a result, we did not use data from the natural organism drift measurements for the validation of the machine-learning classifier.

| Device operation
During all deployments, RODI was able to produce continuous sets of images during each acquisition interval without hardware or software issues, and the camera housing remained waterproof even

| Machine-learning classification
The weighted precision, weighted recall and weighted F1 score for the dataset collected on 5 April 2022 and 11 May 2022 (images from both days were aggregated into a single dataset) all had the value of 94% (Figure 4a; Table S1). When considering the classifier's per-class performance (Figure 4a; Table S1), precision, recall and F1 score values ranged between 87% and 100% for all but one class, the Perlodidae. The full details of the inter-class classification performance can be found in the confusion matrix (Figure 4b).

| Natural organism drift
In total, 674 drifting benthic invertebrates, 254 exuviae and 39 nonbenthic invertebrates were imaged during the 6 h overnight sampling period from 10 to 11 May. The number of drift events increased as a function of time during the night (grouped in bins of 5 min, Figure 5a and 15 min, Figure 5b). The rate of capture of debris varied during the sampling period, with large amounts of debris that severely F I G U R E 4 Performance of the machine-learning classifier. (a) Classification report, showing, for each of the seven classes on the x-axis, the number of drift events (blue bars; total = 285) and the classification performance (yellow dots = F1 score; brown triangle = precision; orange squares = recall), as well as the performance for the model overall (dashed line = weighted precision, weighted recall and weighted F1 score all equal to 94%). (b) Confusion matrix for the machine-learning classifier, each cell representing a count of classification events. The y-axis represents the true labels, while the x-axis represents the labels predicted by the classifier. A colour gradient represents the value range, from yellow for one to deep red for seventy-nine.

| DISCUSS ION
In this work, we described the technology and first deployments of RODI, an underwater camera system to image drifting organisms, providing a proof of concept for this novel approach. Images of drifting organisms generated by RODI were of sufficient quality for organisms to be identified to the family level (for benthic invertebrates) using a machine-learning classifier (Figure 4) or to the order level (for all organisms) by a human expert ( Figure 5). Here we will discuss the results of the machine-learning classifier and natural organism drift experiments in more detail, highlight current limitations and planned developments to the system, and explore potential scientific and monitoring applications.

| Machine-learning classifier
The initial application of a machine-learning classifier to identify in situ imaged drifting organisms to the family level had an overall weighted F1 score of 94% (Figure 4a). This result was achieved despite the fact that the classifier had to deal with unevenly distributed drift events between classes, from as few as 11 events (Perlodidae) F I G U R E 5 Histograms of drifting organisms and exuviae recorded during the night-time deployment. Drifting organisms and exuviae were identified by eye to the order level from images. (a, b) Number of drift events within 5 min (a) and 15 min (b) intervals. Data acquisition intervals lasted 1.5 h, and between intervals, data was transferred (20-30 min) to an external hard drive.
to as many as 87 events (Baetidae). The unbalancedness and size of the dataset is a result of the community structure at the sampling site. Perlodidae was the only class with a lower performance (precision, recall and F1 score all equal to 73%), which was most likely due to the limited number of organisms (11) sampled for this class.
Out of 285 drift events, 17 were wrongly classified within the classes of Baetidae, Capniidae, Diptera, Heptageniidae and Perlolidae (Figure 4b). Morphological similarities between these classes and a low number of Perlolidae replicates were the major causes for classification errors (Ärje et al., 2020). Morphologically very distinct classes-Rhyacophilidae and Salmo trutta-were perfectly classified.
While the involved taxa are not the same and, thus, the results are not directly comparable, the machine-learning performance presented here is similar to that achieved for preserved benthic invertebrates (Raitoharju et al., 2018) and insects .
Albeit, RODI, in this early implementation, was applied to a lower taxonomic resolution (i.e. family level).

| Natural organism drift
Although we experienced some issues such as clogging, which are discussed below, capturing natural organism drift at night with this novel approach was straightforward and resulted in data of high temporal resolution. The drift of Ephemeroptera and Plecoptera increased with time, peaking at 04:00 during the night. The drift of these taxa is known to take place predominantly at night as a mechanism to avoid predation during dispersal (Brittain & Eikeland, 1988).
The drift of Diptera decreased over time during the night, which corresponds with observations that certain Dipteran families, such as Simulidae, peak at dusk (Adler et al., 1983;Tilley, 1989). Finally, non-benthic invertebrate drift decreased over time, most likely due to a decreased activity of day-active invertebrates (Waters, 1965).
Overall, these results provide a glimpse of the data that could be captured using RODI and underline the potential for studying organism drift with higher temporal resolution.

| Current limitations and planned developments
In this work, RODI captured organism drift in acquisition intervals of 1.5 h, determined by the hard-drive capacity of the laptop. This limitation did not prevent longer deployments, only resulting in short interruptions between acquisition intervals, yet required human intervention over the entire period of deployment. This bottleneck can be removed by using a higher-capacity computer or, more effectively, by implementing the bounding box analysis in real-time, thereby only saving bounding boxes and not full images. As a result, we expect to reduce the data volume by a factor of around 200, thus enabling continuous sampling of organism drift for nearly 2 weeks using the same hard drive capacity (1 Tb) tested here. Going further, bounding boxes could be continuously uploaded to a server (if an internet connection were integrated), thereby removing this limitation entirely. In this case, the classifier could automatically identify organisms. This relatively simple improvement would allow RODI to generate real-time data and, ultimately, even to adapt the acquisition campaign based on the generated data.
The smallest object, that is, debris, detected by the bounding box analysis measured approximately 1.5 mm in size, an estimation that does not account for the water magnification effect. A lower area threshold during the bounding box analysis would solve this issue at the cost of many more bounding boxes of debris. Alternatively, the image resolution can be increased by changing the optical train, with the trade-off of generating larger images and thus a greater computational burden. That said, we do not expect many benthic invertebrates and small-bodied fish that do engage in drift to be smaller than 1.5 mm in size (Dodrill et al., 2016;Sandlund, 1982).
A second factor that limited deployment time was clogging of the drift net and metal fences. The fact that RODI was installed downstream of the two metal fences exacerbated the problem of clogging since the fences funnelled debris into the drift net and camera housing. The metal fences were installed to maximise the chances of images drifting organisms, and will be omitted in future deployments. Clogging of the system also likely changed the upstream hydraulic conditions over time. While the many debris objects (and air bubbles) increased the time needed to curate the data, they did not hamper the acquisition of reliable images of organisms for the majority of the deployments. Engineering solutions to prevent clogging are being devised and will include a combination of an upstream filter grid and the replacement of the drift net with a funnel system that should guide debris through the device, instead of getting stuck in the net. This improvement will reduce the need for regular checks during deployments and entrain less debris in the imaging pathway, reducing the number of bounding boxes, hence increasing deployment times.
Although the initial machine-learning results are promising, we expect that system optimisations will produce higher-quality images, which-together with the collection of larger amounts of training data-will bring genus or even species-level identification within reach. Yet, classification to the family level may be sufficient for many applications. For example, monitoring programs using benthic invertebrates as bio-indicators commonly use family-level taxonomical identification (Cortes et al., 2013). A priority development to improve the machine-learning classifier's performance would be the inclusion of organism size as a training parameter. This improvement will help with the distinction of very similar-looking taxa that vary significantly in body size (e.g. Perlolidae and Capniidae). Further improvements of the classifier will be the inclusion of debris, exuviae and air bubbles in the classification scheme to achieve complete automation.
Currently, the data from RODI represents absolute numbers of drifting organisms sampled over a given time interval ( Figure S1). For a comparison of organism drift among different conditions and locations, drift densities (individuals m −3 ) or rates (individuals m −3 s −1 ) have to be estimated (Elliott, 1970). By installing a flow sensor into the system, we can measure the volume of water sampled by the camera, which is determined by the net or funnel area and the flow discharge. Adding additional sensors for temperature, light intensity and turbidity could also be valuable, depending on the application.

Tests in varying turbidity conditions have not been performed.
Therefore, it is currently unknown under what levels of turbidity the image quality and classification performance would start to deteriorate substantially. We acknowledge that if the turbidity exceeds a certain threshold, the machine-learning classifier will most likely not be able to recognise drifting organisms in its current implementation.
However, RODI images only 5 cm of water with a highly contrasting white background, which should reduce the effect of turbidity during image acquisition. Moreover, with a combination of increased training data on both organisms and debris of different origins, and data augmentation techniques mimicking turbidity conditions, machine learning is expected to be effective even with substantially cluttered images (Noh et al., 2019;Shorten & Khoshgoftaar, 2019). Future experiments will be performed to systematically vary the level of turbidity and assess the degradation in imaging and classification performance.
A further unknown scenario for the application of RODI is the case of very high flow velocity conditions. These can occur during floods, resulting from heavy rain or hydropeaking, the release of water from reservoirs used for hydropower to increase electricity production at peak demand (Bratrich et al., 2004). Very high velocity conditions will pose a double challenge: first, on the operational reliability of RODI's structure (its anchoring, shielding from large debris, maintenance of a stable drift net and level of streamlining of its shape); second, on the quality of the images, as velocities much higher than 2 m s −1 could result in image blur. Deployments in highflow discharge regimes will allow us to explore the limits at which the system can operate and engineer improvements for reliable operation and imaging.
Finally, current deployments have been performed using the power grid. We plan to design a standalone power supply based on a combination of renewable energy, such as solar or small water turbine, and battery storage. This improvement will allow RODI to be deployed in remote locations.

| Potential applications of RODI in science and monitoring
Despite numerous studies on benthic invertebrate drift (Brittain & Eikeland, 1988;Naman et al., 2016), data on drifting invertebrates remains limited in temporal resolution and scale. The ability to generate data at a high temporal resolution over long deployment times, with only modest labour, has the potential to fill this gap.
This also applies to the study of fish larval drift, a crucial process in their life cycle to disperse from nursery to rearing habitats. For example, although many studies have investigated fish larval drift (Lechner et al., 2014(Lechner et al., , 2018, little is known about the navigation and motion capacity of larvae during drift (e.g. their ability to orientate and to use active-passive drift mode; Lechner et al., 2016;Pavlov & Mikheev, 2017). The images produced by RODI could help shed light on this and similar questions by providing information on the orientation of drifting fish larvae. For example, larvae drifting with a downstream orientation and a drift velocity exceeding the local current would indicate active rather than passive drift (Lechner et al., 2016). An additional area of application is the study of how drifting organisms cope with the fast-changing conditions associated with hydropeaking events. Hydropeaking is known to induce the drift of riverine organisms (Schülting et al., 2019;Tonolla et al., 2022) and can cause fish mortality due to stranding events when the flow recedes (Schmutz et al., 2015).
Besides the generation of fundamental knowledge on the drift of riverine organisms, RODI holds great potential as a monitoring tool.
Many countries currently incentivise hydropower mitigation measures or river restoration projects to reverse the decline in freshwater biodiversity. It is beneficial to precede and follow up these initiatives with long-term impact analyses, including monitoring of aquatic organisms. Tools such as RODI make this monitoring more achievable: one such device can monitor a given location for extended periods of time, while multiple devices can provide spatial resolution; their operation is non-invasive for the organisms being monitored; and the overall effort is substantially reduced in comparison with traditional, drift net-based sampling, rendering monitoring more cost-effective.

| CON CLUDING REMARK S
This work demonstrated the viability of RODI, an in situ imagingbased system, to quantify riverine organism drift through the use of a machine-learning classifier to taxonomically identify drifting organisms from images. The machine-learning classifier showed good performance when applied to the drifting community of a river in Switzerland. Future deployments will enrich the dataset available for training, testing and validation, expanding the range of organisms that can be classified and further improving the performance of the machine-learning classifier. Based on this foundation, improvements in automation, hardware and device operation are close at hand. With their implementation, RODI will be ready for expanded use in both scientific studies and biodiversity monitoring, ultimately contributing to effective river and stream management strategies.

ACK N O WLE D G E M ENTS
We thank Kraftwerke Oberhasli for providing us with the ideal conditions to perform RODI deployments; Vicente Fernandez, Nicholas Macias, Jules Jaffe, Christopher Robinson, Daniel Braun, Zachary Landry and colleagues of the Stockerlab for their help and feedback on this project; Anne-Marie Cools and Thomas Meierhans for help with the construction of RODI; and Elzbieta Sliwerska for help with logistics. Lastly, we thank Russel Naisbit for his editorial input.

CO N FLI C T O F I NTER E S T S TATEM ENT
The authors declare no conflicts of interest.

FU N D I N G I N FO R M ATI O N
This work did not recieve any external funding. It was completely financed by the yearly lab-fund Roman Stocker recieves from ETH Zürich.

DATA AVA I L A B I L I T Y S TAT E M E N T
Instructions on the build process, how to operate the Riverine Organism Drift Imager (RODI) and the machine-learning classifier can be found in the Supporting Information and the following Github link: https://github.com/FdeSc hae/RODI (https://doi.org/10.5281/ zenodo. 7906641;de Schaetzen et al., 2023). The annotated image dataset used for the machine-learning classification can be found at: https://kaggle.com/datas ets/073b9 a4e5d 84c51 4ca78 06df9 18e09 cd35c 0c285 f28d8 dcc93 190f2 6fefe cd8a; and the image dataset resulting from the natural organism drift can be found at: https://kaggle.com/datas ets/54e0e 9bc6c c437e c8d77 e0f1c ce45d 47e7e 32635 55c9a 8ed09 c3e82 cb24f 6e26. The raw data recorded in this work is too large (~10 Tb) to be sustainably shared through a cloud server and is available upon request.