# Multivariate Functional Data Analysis Uncovers Behavioral Fingerprints in Invertebrate Locomotor Response to Micropollutants

George Ruck, Jean-Baptiste Aubin, Alexandre Delétang, Didier Neuzeret, Olivier Geffard, Arnaud Chaumot

► To cite this version:

George Ruck, Jean-Baptiste Aubin, Alexandre Delétang, Didier Neuzeret, Olivier Geffard, et al. Multivariate Functional Data Analysis Uncovers Behavioral Fingerprints in Invertebrate Locomotor Response to Micropollutants. Environmental Science and Technology, 2025, 10.1021/acs.est.5c10192. hal-05379636

HAL Id: hal-05379636

https://hal.science/hal-05379636v1

Submitted on 24 Nov 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
"This document is the Accepted Manuscript version of a Published Work that appeared in final form in Environmental Science & Technology, copyright © 2025 The Authors - Published by American Chemical Society, after peer review and technical editing by the publisher. To access the final edited and published work see https://pubs.acs.org/articlesonrequest/AOR-XFUTU5FS8QZCR5YDFWJN"

# Multivariate Functional Data Analysis Uncovers Behavioural Fingerprint in Invertebrate Locomotor Response to Micropollutants

## Authors:

George Ruck<sup>1,2</sup>, Jean-Baptiste Aubin<sup>3</sup>, Alexandre Delétang<sup>2</sup>, Didier Neuzeret<sup>2</sup>, Olivier Geffard<sup>1</sup>, Arnaud Chaumot<sup>1*</sup>

DOI: https://doi.org/10.1021/acs.est.5c10192

## Synopsis

Functional Data Analysis and machine learning interpret locomotor responses of three aquatic invertebrates, revealing multispecies behavioural fingerprints for micropollutants in both lab tests and WWTP surge events.

## Subjects

Data Science, Ecotoxicology, Wastewater monitoring

## Keywords

Functional Data Analysis, Biomonitoring, Behavioural fingerprinting, Machine Learning

<figure><img src="image_2.png" /></figure>

<footnote n="1"><sup>1</sup>INRAE, UR RiverLy, Laboratoire d'écotoxicologie, F-69625 Villeurbanne, France</footnote>

<footnote n="2"><sup>2</sup>Viewpoint, 67 rue Copernic, F-01390 Civrieux, France</footnote>

<footnote n="3"><sup>3</sup>University of Lyon, INSA Lyon, Laboratory DEEP - EA 7429, 11 rue de la physique, F-69621 Villeurbanne</footnote>

<footnote>*corresponding author: arnaud.chaumot@inrae.fr</footnote>
Abstract

The need for effective biomonitoring in wastewater has become clear due to the impracticality of continuously tracking all chemicals and emerging contaminants in the aquatic exposome. Effect-based biomonitoring provides a cost-effective solution. The ToxMate device, which uses videotracking of locomotor behavior in aquatic invertebrates, has proven efficient for real-time detection of micropollutant surges in effluents. To extend the approach, this proof-of-concept study evaluates the potential to formalize behavioral fingerprints from real-time videotracking data to characterize qualitative variations in effluent contamination. We present the first application of a functional data analysis (FDA) framework in ecotoxicology. Data were obtained by simultaneously tracking three sentinel organisms from distinct taxa (a crustacean, an annelid, and a gastropod) during pulse exposures to four chemicals in the laboratory (two metals, one pharmaceutical, and one insecticide). Individual and multispecies responses were analyzed to determine whether combining species enhances the resolution of contamination fingerprints through multidimensional FDA. Applying the same data-driven approach to field data from a wastewater treatment plant (WWTP) revealed four recurring types of micropollution events. This proof of concept demonstrates the potential of behavioral fingerprints to improve wastewater monitoring and reduce pollutant transfer to the environment.

1. Introduction

Wastewater treatment plants (WWTPs) are the converging point of the majority of urban and industrial micropollutants, designed for the elimination of harmful contaminants prior to discharge to the aquatic environment.¹ Despite efforts to remove micropollutants, concentrations vary greatly at both WWTP inlets and outlets, and micropollutant surge is repeatedly observed through sampling campaigns and across European studies.²,³ Pulse like episodes of micropollutant surge, which pose known threats to biodiversity and human health,⁴,⁵ can occur over timeframes as short as a couple of hours, making them particularly difficult to identify.⁶⁻⁸ The passage of such events may either go unnoticed or show up through latent effects,⁹ once already present in the aquatic environment. To address this problem, behavioural biomonitoring has been shown as an effective real-time alerting system at WWTP outlets, making use of sublethal organism sensitivity and quick response times to toxic compounds.¹⁰⁻¹² Whilst such biomarkers have long been identified, recent advances in technologies such as Machine Learning and videotracking software have opened the door to more detailed interpretation.¹³⁻¹⁴ Our previous work presented an effective bioassay for micropollutant surge detection and its real-time biomonitoring application,¹⁴ developed to tackle the problems associated with the dynamic nature of micropollutant surge, with the device ToxMate.¹⁵ The ToxMate is currently operational at wastewater monitoring sites in France, and whilst alerting indicates the presence of potential issues, it provides limited information on the chemical nature of the pollution.

In a pioneering behavioural study on high-throughput screening for psychoactive drug discovery, Rihel et al. showed that locomotion responses of the model species *Danio rerio* could be clustered into groups of distinct behavioural phenotypes: behavioural fingerprints.¹⁶ More recent studies with *D. rerio* have also shown behavioural sensitivity to low concentrations of other micropollutants common to WWTPs, such as pharmaceuticals, metals and even PFAS.¹⁷⁻¹⁹ As pointed out in our first study,¹⁴ there were distinct differences between the *Gammarus fossarum* avoidance response to metal and pesticide contamination, which could similarly be used to reveal information on the nature of unknown surge toxicity events at monitoring sites. Behavioural profiling in zebrafish offers a cost-effective way to classify neuroactive drugs and predict biological targets of novel compounds, and we hypothesise that the same approach could be a cost effective way for characterising surge contamination at effluents.

By means of advanced data science approaches, the present study looks to develop previous work by assessing the feasibility of such a behavioural profiling of contaminated waters. As the ToxMate device
was developed with three parallel tracking panels (16 individual chambers per panel), this study
extends our previous single species *G. fossarum* approach, to a multispecies approach, incorporating
two other novel species of macroinvertebrate: the leech *Erpobdella testacea* and the aquatic snail
*Radix auricularia*. The new taxa were specifically selected for their compatibility with the experimental
apparatus and their taxonomic distance from *Gammarus*, which is anticipated to provide contrasting
sensitivities to various contaminants. It is expected that adding different phyla to complement the
crustacean model broadens detection scope through varying species sensitivities, will make the
biotest more suited to diverse effluents that may contain any groups of commonly evaluated
compounds such as metals and pesticides as well as contaminants of emerging concern (CECs).<sup>20,21</sup>
Furthermore, the presence of multiple species adds signal multidimensionality that is shown to be
advantageous for clustering algorithms and toxicity evaluation.<sup>16,22</sup> To be clear, the reference
definition in this paper's context of a behavioural fingerprint is therefore the multivariate trajectory
of locomotor behavioural patterns over time, across the multiple invertebrate species. Our study's
primary objective was to establish a data-driven statistical framework to formalize this behavioural
fingerprinting based on videotracking data. First, we provide a proof of concept using single-substance
laboratory exposures to develop the statistical framework, define relevant metrics, and introduce a
novel multivariate approach adapted to the problem (multidimensional Functional Data Analysis).
Second, we apply the developed statistical framework to field data collected on a WWTP effluent
(completely independently from the lab-based fingerprint data), demonstrating that this multivariate
analysis of multi-species behavioural signals enables forming behavioural fingerprinting of the effluent
that captures temporal variability of chemical contamination.

The data science framework chosen to cluster behavioural fingerprints is functional data analysis (FDA),<sup>23,24</sup> never employed in ecotoxicology to our knowledge. FDA deviates from traditional multivariate statistics by treating observations as functions, such as curves or surfaces, where each function portrays a continuous and often smooth process as random variables. This is well suited to time series data, as it preserves the sequential nature of the data in extracted features, typically through a set of functions in a basis domain, such as B-spline polynomials or Fourier functions.<sup>23</sup> Where FDA was once computationally heavy, the calculation of intrinsic mathematical properties such as the functional covariance and Eigen functions has become straightforward with modern computing, making FDA well suited to exploratory techniques like dimension reduction (functional principal component analysis (fPCA)) and unsupervised classification methods such as k-means clustering. The availability of robust packages in R and the emergence of Python packages like scikit-fda, mirroring popular machine learning packages such as scikit-learn, have contributed to the increasing adoption of FDA.<sup>24</sup> Furthermore, recent FDA research has largely extended univariate techniques to multivariate data,<sup>25,26</sup> making it suitable for a multispecies approach.

To demonstrate the observation of distinct behavioural fingerprints between WWTP relevant
micropollutants, in addition to the previously tested copper (Cu) and methomyl, the metal zinc (Zn)
and the pharmaceutical verapamil were also tested in the laboratory with the spike exposure
methodology described in Ruck et al (2023).<sup>14</sup> Zn was chosen for its high industrial use and known
concentration surge in influents and effluents.<sup>2,27,28</sup> Verapamil, a pharmaceutical compound previously
shown to trigger locomotor behavioural response,<sup>16</sup> represents the pharmaceuticals class of
micropollutants. Pharmaceuticals are often identified as the most abundant micropollutants in
effluents,<sup>29,30</sup> and known for their persistence in treatment processes,<sup>20</sup> mass industrial production,<sup>31</sup>
and toxicity at lower concentrations than previously thought.<sup>32</sup> In the second part of this study, we
applied the same functional machine learning methodology on field data from a long-term on-site
WWTP effluent monitoring site in north western France. By first characterising distinct behavioural
fingerprints in controlled laboratory conditions, we then tested the transferability of this data-driven
statistical approach to real-time field monitoring, aiming to identify recurring types of micropollutant
surges in urban effluents. As a complementary exploratory step, automatic grab samples were
triggered by spikes in the bioactivity signal to examine the chemical coherence of grouped field events.
Without a device such as the ToxMate, sampled concentrations of measured compounds are bound to inferior to true maximum values at effluents, as the sampling is performed without real-time indication of the micropollutant transfer. Each grab sample was analysed for a total of 803 organic micropollutants (semi-quantitative analysis), primarily based on pesticides, pharmaceuticals and their associated transformation products (TPs), known by local water authorities to be prevalent in this area. We explore the possible alignment of similarities in micropollutant mixture chemical profiles with overlapping behavioural fingerprints.

## 2. Methods

### 2.1 Experimental design and setup

All experimental conditions remain unchanged from the procedure outlined in our previous study,¹⁴ and the presented results are extended for all three species of invertebrate. Briefly, the experimental device comprises a compact, cubic monitoring unit equipped with three vertical observation panels, each integrating a 4 × 4 array of individual behavioural chambers, enabling high-throughput, continuous monitoring under dynamic flow conditions (Fig. 1). The 48 chambers are hydraulically connected to a central reservoir, forming a closed-loop recirculating system in laboratory experiments with a total water volume of 15 L. Each individual arena has internal dimensions of 55 × 50 × 18 mm. For online monitoring of WWTP effluents, the system is modified with dedicated inlet and outlet ports allowing continuous bypass flow-through of raw effluent. Additionally, the setup incorporates a temperature control module with a cooling chamber and a pre-filtration unit prior to water distribution within the ToxMate device. The calibration and normalisation applied for *E. testacea* and *R. auricularia*, as well as a reminder of the spike exposure protocol are given in Appendix 0 of the supplementary information. The amphipod *G. fossarum*, the freshwater leech *E. testacea* and the aquatic snail *R. auricularia*, were all sampled in a former watercress farm near Saint-Maurice-de-Rémens in Central Eastern France (45°57'25"N 5°15'42"E). Hence, the gammarids used in this study originate from the reference source population that has been used in all ecotoxicological experiments conducted by the INRAE laboratory since 2015. Although not specifically characterized for this study, this population has been genetically analyzed on multiple occasions. COI barcoding identified the majority of individuals as *Gammarus fossarum* lineage B (MOTU 2), with a minor co-occurrence of individuals from lineage C (MOTU 6), following the nomenclature from Wattier et al (2020).³³ No genetic information is available for the two other species. All species adapted well to the previously described acclimatisation conditions at the laboratory in Lyon, France. Each of the three species is placed in one of the three panels of the ToxMate device, with each panel allowing the monitoring of 16 individuals housed in separate chambers. The four tested molecules were copper (CAS 10125-13-0; 8 replicated experiments), methomyl (CAS 16752-77-5; 7 replicated experiments), zinc (CAS 7446-20-0; 4 replicated experiments), verapamil (CAS 52-53-9; 3 replicated experiments), adopting the same 2h spike exposure experimental design outlined in Ruck et al (2023).¹⁴ Concentrations (100 µgL⁻¹ for copper, 125 µgL⁻¹ for methomyl, 325 µgL⁻¹ for zinc, 120 µgL⁻¹ for verapamil) were tested to remain sublethal, and when possible approximated to be a fifth of the LC50 for *G. fossarum* (as in ¹⁴), the goal being to trigger behavioural response rather than reproduce realistic field conditions. For the data described relative to operational WWTP monitoring, ToxMate biomonitoring has been in operation at the site since January 2022, which is a municipal WWTP in the north western region of France serving an equivalent population of 170,000. Alert triggered grab sampling was activated at the site for two different month-long periods: November 2022 and April 2023, where organisms are continuously exposed to the undiluted effluent. For all field monitoring periods, organisms are replaced monthly across all species to ensure responsiveness is maintained.

The locomotor data collected for behavioural fingerprinting was of the same nature as the data described in our previous work.¹⁴ For each repetition, the trajectories of *N*=16 individuals of each of the three species were exported from the videotracking software developed by Viewpoint, the
ToxMate developers. Experimental conditions and water flow setup remained unchanged from Ruck et al (2023).¹⁴ For all repetitions, an initial acclimation of 72 hours in the ToxMate was carried out, and videotracking took place from 24 hours prior to spike exposure, until 48 hours post exposure. In this study, only the two hours post exposure were retained. Of all the retained observations, the dataset is comprised of a total M=22 behavioural response assays, encompassing the individual locomotor activity tracking of 1056 organisms (three species, 22 assays). Cu and methomyl, previously tested in ¹⁴, contain twice as many assay repetitions, as these chemicals were used heavily in the initial development of the ToxMate spike assay protocol. Any organisms that showed mortality prior to spike testing were automatically filtered through inactivity monitoring.

## 2.2 Data Pre-processing

For each invertebrate species, time series data is composed of distance measures, travelled over 20 second intervals, $X_i(t_j)$, where i represents each of the N=1-16 individuals per species, and j the j=[0,20,..., T=7200]-second sampling points in the 2-hour time domain T. The cumulative distance measure are automatically calculated from centre of gravity coordinates at 10 frame per second (fps) sampling using in-house software of the company Viewpoint (ToxMate supplier). The mean locomotor response ($\mu(t_j)$) and avoidance response ($\alpha(t_j)$ as in Ruck et al (2023)¹⁴ were then computed for each of the species. It is noted that "avoidance" remains the variable name for consistency with the metric naming developed in ¹⁴, but the movement patterns are simply referred to as hyper or hypo-activity to minimise confusion. Control and spike-exposed individuals were processed identically in this described calculation of $\mu(t_j)$:

$$ \mu_{km}(t_j) = \frac{1}{N} \sum_{i=1}^{N} X_{kmi}(t_j), \quad t_j \in T, \qquad (1) $$

the multidimensional codomain is threefold, denoted by k=1-3, corresponding to each distinct invertebrate species, giving m multivariate time series observations of the M=22 experimental observations ($\mu_{km}(t_j)$ and $\alpha_{km}(t_j)$). Control samples serve as a baseline to ensure observed variations reflect variation and not experimental noise. Prior to B-Spline approximation, data was smoothed via Gaussian mean averaging, and for multidimensional FDA, scaling was performed from the species specific upper quartiles (Q₀.75) of the distinct locomotion distributions for each species.

## 2.3 Functional Data Analysis

Each time series data observation $\mu_k(t)$ is converted to a functional basis using cubic B-spline basis functions denoted $B_l(t)$, as described:

$$ \mu_k(t) = \sum_{l=1}^{L} c_{kl} \cdot B_l(t), \qquad (2) $$

where l represents the index of each basis function and $c_{kl}$ is the associated basis coefficient matrix (in this study separated by knots at t = [0,10,20,30,60,90,120] minutes). For functional principal component analysis in the case of univariate data (fPCA of individual species), the eigenvalue problem is solved as described,

$$ C(t, s) = \frac{1}{M} \sum_{m=1}^{M} Y_m(t) \cdot Y_m(s), \quad Y_m(t) = X_m(t) - \mu_m \qquad (3) $$

where each observation $X_m(t)$ is first centred by subtracting the functional mean as in (1) to give $Y_m(t)$. C(t,s) is the covariance function describing covariance between two time instances t and s (where t and s represent any two points in T), used in the integral problem described, to calculate the Eigen functions $\phi_p(t)$ and Eigen values $\lambda_p$:

$$ \int_{0}^{T} C(t, s) \phi_{p}(t) dt = \lambda_{p} \phi_{p}(s), \qquad (4) $$
which describe the functional principal components (fPCs) calculated in (4). The fPC coefficients $a_{mp}$ are the scores of observations summed on each of the Eigen functions denoted in (5). These fPC scores described:

$$Y_m(t) = \sum_{p=1}^{P} a_{mp} \phi_p(t), \qquad (5)$$

$$X_i(t) \approx \mu(t) + \sum_{p=1}^{p'} a_{ik} \phi_{km}(t), \quad p' < M, \qquad (6)$$

are used for interpretation of individual points and outliers (later visualised in various fPCA scoreplots). Similarly to standard PCA, the $p'$ number of required fPCs is determined to satisfy (6) to a chosen threshold of explained functional variance. Throughout this paper, only two fPCs are required for explained functional variance > 0.8, and thus $p'=2$, leaving two principal components: fPC1 and fPC2. The functional data packages and machine learning packages used throughout this study are the python package `scikit-fda` and `scikit-learn`,²⁴ as well as the R package `fda` and `mfPCA`.³⁴,³⁵ The dataset for mean and avoidance data is available online.³⁶ K-means clustering was applied to the fPCA scores derived from the behavioural responses to field alert events, enabling the classification of points into distinct clusters based on similarity in their functional profiles (the number of clusters was determined based on analysis using both the elbow method and the silhouette plot). In the case of laboratory assays, points are regrouped using bounding ellipse functions as the chemicals are known, estimated through Khachiyan optimisation.³⁷

## 2.4 Chemical Analysis of Grab Samples

The raw data obtained during chemical analysis were processed to identify 803 target molecules specified by the method as detailed in the Supporting Information, carried out by LODIAG Company in France, by means of suspect screening LC-MS/MS analysis. Of the 803 molecules analysed, 8 categories of chemicals were searched for: pharmaceuticals, pesticides, narcotics and their respective metabolites categories. Grouped substances in the same chemical use category are simply ordered alphabetically in later sections, where data is equally available on line.³⁶ For each chemical, a concentration estimate fell in one of five pre-defined categories, which are described in Table S1. Simply for visualisation purposes, retained concentrations in Table S1 are used to evaluate chemical presence in a semi-quantitative manner. The exact concentrations are presented in the Supporting Information.
## 3. Results

### 3.1 Behavioural Response for Multiple Invertebrate Species

When comparing locomotor response between the three species (*E. testacea*, *G. fossarum* and *R. auricularia*), response to some chemicals was ubiquitous across species, whilst other chemicals triggered species specific sensitivity. Copper for example triggered immediate response for all macroinvertebrate species (Figure 1). This shows that quasi-instantaneous response can be observed at relevant effluent concentrations for a range of invertebrate phyla (in this case 100µgL⁻¹). The full range of responses for the other compounds, as seen for Copper in Figure 1, are presented in Appendix C of the Supporting Information.

For the other compounds, an interesting observation is the immediate locomotor inhibition seen for *E. testacea* in response to methomyl (Figure 2A). Visual inspection of the video files confirmed no mortality and confirmed hypoactivity (locomotor inhibition), whereby *E. testacea* curls up into a ball shape (Appendix B of the Supporting Information). Overall, locomotor activity changes occurred anywhere between 1 minute post-spike (in the case of Cu response) to several hours post-spike

<figure><img src="image_3.png" /><figcaption>**Figure 1** Copper mean locomotor response for 8 spike repetitions of Copper at 100 µgL⁻¹, shown for (A) *E. testacea*, (B) *G. fossarum* and (C) *R. auricularia* (each organism form shown with associated figures). Each curve is the mean of the 16 individual activity curves (μ(t)) recorded for each Cu assay repetition.</figcaption></figure>

(depending on compound and species), occasionally with no notable response at the chosen concentrations (such as *E. testacea* in response to Zn exposure at 300µgL⁻¹ seen in Figure 2). It thus appears that locomotor response dynamics are repeatable between assays, and exhibit various patterns – rapid, slow, transitory, induction or inhibition of locomotor activity) that differ between contaminants and between species.
## 3.2 Functional Data Modelling of Single Species Responses

<figure><img src="image_4.png" /><figcaption>**Figure 2** (A) Raw data of behavioural mean response curves of *E. testacea* to the four distinct micropollutants (one mean curve per independent repetition). (B) The same time series data in its smoothed functional basis form (using cubic B-Splines), with nodes for B-Spline approximation marked by dashed vertical intersects. (C) The fPCA scoreplot for *E.testacea*; where each point represents one observation in (B). Centres marked in the bounding ellipses are used to define the approximate behavioural fingerprints (superposed bold curves in (B)). The scale of variability is not consistent between fPCs for readability. The overlaid plot (top right C) illustrates the two principal functions derived from the functional principal component analysis (fPCA). Each point is related to these functions by the extent of projection onto the fPCs, which reflects the degree of correlation or contribution these principal functions make to the behavioural patterns observed across measurements.</figcaption></figure>

FDA interpolation of locomotion curves demonstrated efficient functional approximations of the individual curves, as illustrated for *E. testacea* in passage from **Figure 2A** to **Figure 2B**, with optimal fitting using cubic order B-splines. Shorter node intervals in the first 30 minutes post spike exposure permitted better smoothing and enhanced recreation of sudden changes (**ERREUR ! Source du renvoi**
**introuvable.**B). Through unsupervised exploratory data analysis, FDA reveals behavioural fingerprints in *E. testacea* in the grouped datapoints shown in the fPCA scoreplot in **Figure 2C**. Furthermore, the overlaid fPCs **Figure 2C** provide insight into temporal dynamics that characterise each cluster, so-called behavioural fingerprints. Formed through Eigen decomposition, the fPCs for *E.testacea* show that the first fPC captures the largely dominant functional mode of variation in the locomotor response, explaining 95% of the temporal variance from the mean response curve. This dominant behavioural mode is seen to be characterised by initial positive gradient over the first 30 minutes of the observation window; followed by sustained high movement amplitude. In this context, fPC1 can be interpreted as representing the general intensity of the locomotor response, while fPC2 captures more subtle species-specific variation. The fPCA scoreplot (**Figure 2C**) depicts the projection of each time series observation onto the first two fPCs. This gives a visual representation of the similarities and differences in the behavioural responses to the four micropollutant spike exposures. For Cu, the scoreplot indicates induced hyperactivity that peaks after 30 minutes and is sustained thereafter. This hyperactivity is reflected in a positive correlation with the dominant behavioural mode, as shown in the scoreplot to the right of the fPC1 axis. In contrast, for Methomyl, the behavioural fingerprint is characterised by an inverse correlation with the dominant mode, aligning with the discussed hypoactivity. The consistent negative projection in **Figure 2C** illustrates this.

Univariate behavioural fingerprints, shown for *E. testacea* in **Figure 2** and *G. fossarum* and *R. auricularia* in Figure S1, are therefore defined through functional principal components and confined by their bounding ellipse functions.³⁷ Fingerprint cluster centres were projected to visualise each fingerprint as a behavioural response; shown for *E. testacea* in **Figure 2B**. For *G. fossarum* and *E. testacea* each fingerprint gives the characteristic profile of the distinct micropollutant response, whilst for *R. auricularia* the only distinct fingerprint is for Cu (Figure S6). Overall, there is a high degree of separation between Cu and methomyl response, particularly in *E. testacea*. Explained variance of the first Eigen function (fPC1) is consistently high, showing a dominant behavioural mode characterising fingerprints for the three species.
3.3 Multivariate FDA – a Multispecies approach

In addition to univariate behavioural fingerprinting, we evaluated expanding the analytical scope to
multivariate FDA (mFDA) to account for parallel observations across the three species. As expected
from the multidimensionality that comes from the multispecies response, the principal component
decomposition with mean locomotor response reveals more distinct clusters of data that corroborate
the fingerprints observed for single species, with the same underlying dominant behaviour mode
(Figure 3A). To go further, the same framework was applied to the avoidance metric, as developed in
Ruck et al (2023),¹⁴ in the multivariate case (univariate fPCA and fingerprints are shown in Appendix D
of the Supporting Information for the avoidance metric). The clear separation reinforcing the
multispecies metric for Figure 3A is not as clear in the avoidance metric, as the fPC 2 differences are
insignificant. Nevertheless, given that the avoidance metric has been shown to be more robust in field

<figure><img src="image_5.png" /><figcaption>**Figure 3** Multidimensional fPCA for all species for (A) mean locomotor response and (B) avoidance response. The three fPC plots above each fPCA scoreplot show the species contribution to the first two multivariate fPCs. The scale of variability is not consistent between fPCs for readability.</figcaption></figure>
conditions,¹⁴ this an encouraging result for on-site behavioural fingerprinting in effluent environments, and the avoidance metric is used for the following analysis of real-time alerts.

## 3.4 Field Study functional clustering

At the field site in north western France, operational since January 2022, 14 micropollutant surge events were accompanied by automatic grab samples over two month-long periods at the WWTP effluent (similarly to observed micropollutant events in our previous study).¹⁴ Overall explained variance decreased to 0.79 with two fPCs (Erreur ! Source du renvoi introuvable.), when compared to lab tests in **Figure 3B**. This perhaps reflects the wider array of micropollutants in more complex water medium and micropollutant mixtures. Nevertheless, within the data, unique fingerprints are also observed at the effluent, grouped here with 4 k-means clusters. Interestingly, when analysing dates associated with grouped clusters, similarity in locomotor profiles is shown between alerts up to 6 months apart, although a global separation is noted for both the chemical nature and behavioural profile of events sampled between the two periods (as detailed in the Supporting Information). Appendix E of the Supporting Information presents the locomotor responses for each point in **Figure 4A**, along with the corresponding chemical profiles, as detailed for the four highlighted samples in **Figure 4B**. Determining a definitive global seasonal trend would require longitudinal data over multiple years. **Figure 4B** shows that when nearby points in common behavioural fingerprints are compared, the chemical profiles are strikingly similar. Furthermore, the control sample (collected outside of any behavioural alert) is the only sample to show minimal to no concentration for all dosed chemicals.

<figure><img src="image_6.png" /><figcaption>**Figure 4** mfPCA of the behavioural alerts accompanied by grab samples for chemical screening analysis. (A) The mfPCA shows 4 k-means defined fingerprints, describing the functional variability within the alert profiles uniquely for the behavioural similarity. (B) Shows the chemical screening profiles of four grab samples collected during four behavioural alerts falling into two distinct fingerprints (cyan and green clusters 2 and 4); semi-quantitative abundance of 803 chemicals is shown with barplots, grouped by chemical categories with their corresponding groups below. (C) Shows a control sample in the absence of avoidance. The ensemble of the chemical samples is shown in the Supporting Information.</figcaption></figure>

# 4. Discussion

## 4.1 Biological findings and Sensitivity to 3 Classes of Micropollutants

The first significant finding was the successful extension of our developed biotest to two new species, where we saw clear locomotor response to three classes of micropollutants. With regards to inter-species variability, the observation of hypoactivity in *E. testacea* in response to methomyl is
particularly interesting. This is coherent with various findings for locomotor inhibition in behavioural exposure studies, especially for similar anticholinesterase neurotoxic insecticides in aquatic vertebrate larvae.³⁸ This form of bioactivity response may be referred to as a stress-induced defensive posture, which may either serve as a protective mechanism to reduce vulnerability or a posture to induce drift like avoidance.³⁹⁻⁴¹ Previously, we assumed that carefully conditioning towards a minimal activity state of organism movement may only channel bioactivity through hyperactivity.¹⁴ It is thus shown that hypoactivity can also be captured through this bioassay in response to certain chemicals.

Locomotor response is observed not only for insecticides, but also for a pharmaceutical and two commonly used metals. The concentration levels used in laboratory assays to detect relevant changes in organism locomotor activity may raise questions about the method's sensitivity in relation to environmental realism. Compilations of available data for French urban wastewater treatment plant effluents⁴² demonstrate that average concentrations of many trace metals exceed µg/L levels (e.g., copper: 4 µg/L, zinc: 35 µg/L), a pattern also observed for various pharmaceuticals and pesticides. Furthermore, contaminant surge events in effluents can result in concentrations significantly higher than these averages. For copper and methomyl, the concentrations tested in the laboratory align with maximum concentrations reported in certain effluent monitoring campaigns.¹⁴ In the French dataset of WWTP effluent monitoring,⁴² maximum measured concentrations of micropollutants are approximately ten times higher than median values. These ten-fold ratios are likely underestimates, as traditional effluent grab sampling often misses surge concentrations. In industrial effluents, concentrations of specific contaminants can be much higher than those in urban wastewater effluents. Additionally, studies indicate that contaminant cocktails present in real effluents can exhibit additive toxic effects. Finally, the relevance of behavioural responses observed in mono-substance laboratory tests to real effluent monitoring is supported by our field study (Figure 4), where detected bioactivity is similar in magnitude to laboratory responses.

The distinct fingerprints for the different classes of micropollutant adds further evidence that the multi-species biotest as a good approach for non-targeted micropollutant detection, sensitive to a range of compound types at sublethal concentrations relevant for environmental monitoring.²,¹⁴,⁴³ On top of previously tested classes, the behavioural distinction for locomotor response to a commonly found pharmaceutical is promising, as these are a common class of CEC shown to routinely bypass elimination during secondary WWTP treatment.³² Interestingly, the two micropollutants closest in the multi-species functional space (Figure 3) were not the two metals Cu and Zn, but rather Zn and the pharmaceutical verapamil. The clear difference in the signature of Cu and Zn, shows that fingerprinting goes further than simply classifying chemicals by micropollutant type. As expected, other factors must explain the complex interactions that govern behavioural response. These merit further investigation, such as targeted biological pathways that could be revealed to trigger certain behavioural phenotypes. The variety in the locomotor response patterns across species suggests that for a larger number of micropollutants, fingerprinting would not be limited to only a handful of profiles. A complementary open question for the broader practical application of this method concerns the extent to which behavioural response patterns are transferable between phylogenetically related species. Are there taxonomically equivalent species that could be used interchangeably? Behavioural ecotoxicology has already shown that this may raise challenging scientific questions, as behavioural differences can exist even between closely related species (see ⁴⁴ for a recent findings in gammarids) or even more subtle changes between different populations of the same species.⁴⁵

## 4.2 FDA implementation for Behavioural Fingerprinting

In the presented functional framework, response curves are reduced to finite points in space through fPCA, which provides a framework for clear behavioural fingerprinting. This allows for a nuanced understanding of the temporal patterns in invertebrate responses to different micropollutants. The fPCs highlight common and dominant modes of behaviour, while the scoreplot facilitates the comparison of individual trajectories, revealing variations and correlations with the identified intrinsic behavioural modes captured. Indeed, fingerprinting exists in many different fields, such as in audio
fingerprinting for extract recognition,⁴⁰,⁴¹ weather pattern identification,⁴³ and computational analysis of biological behaviour.¹⁷,⁴⁶⁻⁴⁸ There are common themes in the machine learning clustering methods used to define fingerprints, however something that appears more common in behavioural analysis and research, particularly in ecotoxicology, is the use of overly simplistic temporal descriptors for clustering, such as those defined for hierarchical clustering.¹⁷ Simple descriptors such as number of bouts of activity and inactivity for example, as highlighted by Egnor and Branson,⁴⁶ often face significant limitations. Beyond the bias associated with predefining the metrics, it is usually an oversimplification of complex interactions that discards temporal information, losing nuance in behavioural dynamics.

Our proposed framework shows high interpretability and flexibility, with the use of irregular knot spacing for optimised data smoothing, and even the ability to combine non-uniform data structures in mFDA if necessary (images and univariate data for example).³⁵ FDA should be considered more often for interpreting functional like data in ecotoxicology and time series data in biological sciences. A recent issue dedicated to Data Science in environmental science showcased papers from the last seven years of relevant contributions in the field.⁴⁶ Critical reviews stressed the associated difficulty with models lacking in interpretability,⁴⁷⁻⁴⁸ however despite over hundreds of cited machine learning keywords in one review,⁴⁹ there was no mention of FDA despite various other papers that would be well suited to the framework.⁵⁰,⁵¹ Ironically, FDA's departure from conventional multivariate statistics, treating observations as continuous functions, aligns well with the chronic and sequential nature of biological behavioural tests used in typical ecotoxicology, providing a framework that merits further attention in the field.

Further testing of micropollutants, as well as the extensive data collection from field monitoring, may open perspectives for more complex machine learning FDA applications. For example, mean response points display greater spread along the second fPC in the multivariate approach (Figure 3), showing that this component could capture subtle differences that could be exploited through supervised approaches in the future. It helps to think of the first functional principal component (fPC1) as capturing the most dominant shape of the behavioural response. For example, in *E. testacea*, fPC1 shows an increasing activity pattern in Figure 3. When we look at the actual corresponding data in Figure 2, we see that copper triggers just such a hyperactive response, which explains why it appears on the positive side of this plot and Figure 3b. Conversely, methomyl shows a drop in activity and sits on the negative side of fPC1. The second component (fPC2), while less dominant, can still help us pick up smaller differences, but in Figure 4 where it has higher statistical significance it captures cases where one species react differently to another across the response, thus becoming a part of fingerprint we're trying to identify.

In this study, there was little interest for complex machine learning classification methods given the size of the dataset. However, with increased data points for 100 or so micropollutants, machine learning methods already exist that may help distinguish behavioural response, such as unsupervised functional clustering²⁵ or even supervised methods such as linear discriminant analysis.⁵²

## 4.3 Outlook for Real-Time Monitoring

In our previous study, the methomyl reaction for *G. fossarum* was shown to be triggered only after several hours,¹⁴ which contrasted the sub-half-hour reaction time of *E. testacea* observed in this study. Thanks to the incorporation of a multispecies approach, and the sometimes striking differences in the times for onset hyperactivity surge, it was possible to reduce the observation window for behavioural fingerprinting to 2-hours post the moment of spike exposure. The advantage of this in the context of real-time monitoring is the potential to characterise ongoing pollution surge events in real-time, which could revolutionise the way operational wastewater management occurs. This is encouraging for the incorporation of fingerprinting to real-time monitoring of WWTP effluents, where the idea of accompanying alerts with characterisation of the pollution nature is novel.
At WWTP effluents, where episodic pollution is common, recurring events of similarly natured pollution can be expected. This could take the form of repeated discharge from a single upstream industrial polluter or of recurring pesticide surge for example.⁵³ Field monitoring data taken from the north west of France was used to demonstrate the ability of an FDA framework to classify these alerts based on behavioural similarity. The chemical analysis of corresponding samples provided convincing evidence that behavioural fingerprints in WWTP effluents are made up of similar natured micropollutant mixtures that trigger alerts. If such similarities are successfully characterised, it could revolutionise the way in which operational water treatment can limit critical events of micropollutant transfer, through enhanced understanding of the passing pollutants. Whilst it is not proposed that this biotest will identify specific contaminants, let alone their concentrations, behavioural profiles could effectively describe the dynamics of surge chemical cocktail discharge of varying natures in urban and industrial effluents, even in the case of poorly characterised CECs. A further chance to improve the impact of such detection would be to monitor earlier in the WWTP process (such as after primary treatment). This work is ongoing in parallel to effluent studies, with a focus on addressing the practical challenges of operating the bypass system with semi-treated influent - particularly in terms of organism viability and system maintenance. Whether behavioural fingerprints are transferable from water matrix type to type or geographical site remains an unexplored topic in this research. While variation is expected due to site-specific pollutant mixtures, the underlying statistical methodology is transferable which is key. This will allow operators to build site-specific libraries of behavioural profiles that improve over time, perhaps with transferability between certain sites.

This study has established the relevance of a locomotor multispecies biotest as a non-targeted approach to rapid micropollutant detection, through behavioural response to four distinct micropollutants observed for three phyla of aquatic invertebrates. We have demonstrated the effectiveness of FDA as a framework to determine interpretable behavioural fingerprints of contaminants. The methodology proved well suited for grouping surge contamination events of different natures via similar behaviour profiles, extracted from on-site WWTP effluent monitoring data. In order to fully test the discrimination potential of behavioural fingerprinting within the chemical diversity of environmental contamination, one next step is to expand the testing scope for the massive testing of one hundred or so micropollutants in the laboratory. The application of the approach to dozens of active ToxMate field case studies is also relevant in the comparison of bioactivity reactions in varied effluents. As WWTPs are poorly equipped to deal with real-time micropollutant monitoring, on-line behavioural fingerprinting implementation - potentially coupled with piloted grab sampling - appears as a new solution to better characterise contamination transfers within WWTPs, and potentially develop innovative strategies to adapt real-time treatment and re-use of wastewater.

**Acknowledgment:** This research received financial support from Région Auvergne-Rhône-Alpes (projet Pack Ambition Recherche 2020 - ToxPrints), ANRT (Cifre PhD Grant of GR), and European Union (H2020-EIC-SMEInst-2018-2020 Grant#881495). Experimentation for data collection would also not have been possible without the help of A. Descamps, H. Quéau, T. Cavannah, L. Garnero, C. Grant, M. Dauphin, K. Montalbano and the Chartres metropole (Julien Pelleray and Julien Bordeaux).

## References

[1] B. P. Panda, B. K. Majhi, and S. P. Parida, 'Chapter 13 - Occurrence and fate of micropollutants in water bodies', in *Environmental Micropollutants*, M. Z. Hashmi, S. Wang, and Z. Ahmed, Eds., in *Advances in Pollution Research.*, Elsevier, 2022, pp. 271–293. doi: https://doi.org/10.1016/B978-0-323-90555-8.00005-2.
[2] INERIS and OFB, 'Substances dangereuses pour le milieu aquatique dans les rejets des stations d'épuration urbaines. Action Nationale de recherche et de réduction (RSDE STEU 3)', INERIS, Jun. 2021.

[3] L. Mutzner et al., 'A decade of monitoring micropollutants in urban wet-weather flows: What did we learn?', *Water Res.*, vol. 223, p. 118968, Sep. 2022, doi: 10.1016/j.watres.2022.118968.

[4] Y. Luo et al., 'A review on the occurrence of micropollutants in the aquatic environment and their fate and removal during wastewater treatment', *Sci. Total Environ.*, vol. 473-474, pp. 619-641, Mar. 2014, doi: 10.1016/j.scitotenv.2013.12.065.

[5] J. M. Diamond, S. J. Klaine, and J. B. Butcher, 'Implications of Pulsed Chemical Exposures for Aquatic Life Criteria and Wastewater Permit Limits', *Environ. Sci. Technol.*, vol. 40, no. 16, pp. 5132-5138, Aug. 2006, doi: 10.1021/es0604358.

[6] K. J. Hall and B. C. Anderson, 'The toxicity and chemical composition of urban stormwater runoff', *Can. J. Civ. Eng.*, vol. 15, no. 1, pp. 98-106, Feb. 1988, doi: 10.1139/l88-011.

[7] S. L. Rich and D. E. Helbling, 'Daily Monitoring at a Full-Scale Wastewater Treatment Plant Reveals Temporally Variable Micropollutant Biotransformations', *Environ. Sci. Technol.*, vol. 57, no. 28, pp. 10404-10414, Jul. 2023, doi: 10.1021/acs.est.3c02408.

[8] M. A. Colvin et al., 'Pulsed exposure toxicity testing: Baseline evaluations and considerations using copper and zinc with two marine species', *Chemosphere*, vol. 277, p. 130323, Aug. 2021, doi: 10.1016/j.chemosphere.2021.130323.

[9] T. C. Hoang and S. J. Klaine, 'Characterizing the toxicity of pulsed selenium exposure to Daphnia magna', *Chemosphere*, vol. 71, no. 3, pp. 429-438, Mar. 2008, doi: 10.1016/j.chemosphere.2007.11.019.

[10] M. G. Bertram et al., 'Frontiers in quantifying wildlife behavioural responses to chemical pollution', *Biol. Rev.*, vol. 97, no. 4, pp. 1346-1364, Aug. 2022, doi: 10.1111/brv.12844.

[11] J. Hellou, 'Behavioural ecotoxicology, an "early warning" signal to assess environmental quality', *Environ. Sci. Pollut. Res.*, vol. 18, no. 1, pp. 1-11, Jan. 2011, doi: 10.1007/s11356-010-0367-2.

[12] A. Bownik and D. Wlodkowic, 'Advances in real-time monitoring of water quality using automated analysis of animal behaviour', *Sci. Total Environ.*, vol. 789, p. 147796, Oct. 2021, doi: 10.1016/j.scitotenv.2021.147796.

[13] L. J. Soose, K. S. Hügl, J. Oehlmann, A. Schiwy, H. Hollert, and J. Jourdan, 'A novel approach for the assessment of invertebrate behavior and its use in behavioral ecotoxicology', *Sci. Total Environ.*, vol. 897, p. 165418, Nov. 2023, doi: 10.1016/j.scitotenv.2023.165418.

[14] G. Ruck et al., 'Avoidance behaviour of aquatic macroinvertebrates for real-time detection of micropollutant surge in wastewater effluents', *Water Res.*, vol. 242, p. 120228, Aug. 2023, doi: 10.1016/j.watres.2023.120228.

[15] C. P. McCahon and D. Pascoe, 'Episodic Pollution: Causes, Toxicological Effects and Ecological Significance', *Funct. Ecol.*, vol. 4, no. 3, p. 375, 1990, doi: 10.2307/2389599.

[16] J. Rihel et al., 'Zebrafish Behavioral Profiling Links Drugs to Biological Targets and Rest/Wake Regulation', *Science*, vol. 327, no. 5963, pp. 348-351, Jan. 2010, doi: 10.1126/science.1183090.

[17] S. Ali, D. L. Champagne, and M. K. Richardson, 'Behavioral profiling of zebrafish embryos exposed to a panel of 60 water-soluble compounds', *Behav. Brain Res.*, vol. 228, no. 2, pp. 272-283, Mar. 2012, doi: 10.1016/j.bbr.2011.11.020.

[18] S. Zhou, Q. Chen, C. D. Paolo, Y. Shao, H. Hollert, and T.-B. Seiler, 'Behavioral profile alterations in zebrafish larvae exposed to environmentally relevant concentrations of eight priority pharmaceuticals', *Sci. Total Environ.*, vol. 664, pp. 89-98, 2019, doi: https://doi.org/10.1016/j.scitotenv.2019.01.300.

[19] M. Ulhaq, S. Örn, G. Carlsson, D. A. Morrison, and L. Norrgren, 'Locomotor behavior in zebrafish (Danio rerio) larvae exposed to perfluoroalkyl acids', *Aquat. Toxicol.*, vol. 144-145, pp. 332-340, 2013, doi: https://doi.org/10.1016/j.aquatox.2013.10.021.
[20] J. Margot, L. Rossi, D. A. Barry, and C. Holliger, 'A review of the fate of micropollutants in wastewater treatment plants', *WIREs Water*, vol. 2, no. 5, pp. 457-487, Sep. 2015, doi: 10.1002/wat2.1090.

[21] E. Undeman et al., 'Micropollutants in urban wastewater: large-scale emission estimates and analysis of measured concentrations in the Baltic Sea catchment', *Mar. Pollut. Bull.*, vol. 178, p. 113559, 2022, doi: https://doi.org/10.1016/j.marpolbul.2022.113559.

[22] A. Catteau et al., 'Interest of a multispecies approach in active biomonitoring: Application in the Meuse watershed', *Sci. Total Environ.*, vol. 808, p. 152148, Feb. 2022, doi: 10.1016/j.scitotenv.2021.152148.

[23] J. O. Ramsay and B. W. Silverman, *Functional data analysis*, 2nd ed. in Springer series in statistics. New York: Springer, 2005.

[24] C. Ramos-Carreño, J. L. Torrecilla, M. Carbajo-Berrocal, P. Marcos, and A. Suárez, 'scikit-fda: A Python Package for Functional Data Analysis', Nov. 04, 2022, arXiv: arXiv:2211.02566. Accessed: Feb. 23, 2023. [Online]. Available: http://arxiv.org/abs/2211.02566

[25] A. Schmutz, J. Jacques, C. Bouveyron, L. Chèze, and P. Martin, 'Clustering multivariate functional data in group-specific functional subspaces', *Comput. Stat.*, vol. 35, no. 3, pp. 1101-1131, Sep. 2020, doi: 10.1007/s00180-020-00958-4.

[26] L.-H. Chen and C.-Y. Hsu, 'MFPCA: a fast package for multidimensional functional principal component analysis with GPGPU computation'.

[27] G. Rosen, M. Colvin, C. Katz, J. Munson-Decker, and N. Hayman, 'Pulsed Exposure Toxicity Testing':.

[28] A.-M. Desaulty and E. Petelet-Giraud, 'Zinc isotope composition as a tool for tracing sources and fate of metal contaminants in rivers', *Sci. Total Environ.*, vol. 728, p. 138599, 2020.

[29] C. G. Daughton and T. A. Ternes, 'Pharmaceuticals and personal care products in the environment: agents of subtle change?', *Environ. Health Perspect.*, vol. 107, no. suppl 6, pp. 907-938, 1999.

[30] R. Deo and R. Halden, 'Pharmaceuticals in the Built and Natural Water Environment of the United States', *Water*, vol. 5, no. 3, pp. 1346-1365, Sep. 2013, doi: 10.3390/w5031346.

[31] N. Collado et al., 'Pharmaceuticals occurrence in a WWTP with significant industrial contribution and its input into the river system', *Environ. Pollut.*, vol. 185, pp. 202-212, Feb. 2014, doi: 10.1016/j.envpol.2013.10.040.

[32] T. H. Miller, K. T. Ng, S. T. Bury, S. E. Bury, N. R. Bury, and L. P. Barron, 'Biomonitoring of pesticides, pharmaceuticals and illicit drugs in a freshwater invertebrate to estimate toxic or effect pressure', *Environ. Int.*, vol. 129, pp. 595-606, 2019, doi: https://doi.org/10.1016/j.envint.2019.04.038.

[33] R. Wattier, T. Mamos, D. Copilas-Ciocianu, M. Jelic, A. Ollivier, A. Chaumot, M. Danger, V. Felten, C. Piscart, K. Zganec, T. Rewicz, A. Wysocka, T. Rigaud, and M. Grabowski, 'Continental-scale patterns of hyper-cryptic diversity within the freshwater model taxon Gammarus fossarum (Crustacea, Amphipoda)', *Scientific Reports*, vol. 10(1), 16536, doi:10.1038/s41598-020-73739-0.

[34] J. Ramsay, H. Wickham, M. J. Ramsay, and S. deSolve, 'Package "fda"'. Citeseer, 2023.

[35] C. Happ and S. Greven, 'Multivariate Functional Principal Component Analysis for Data Observed on Different (Dimensional) Domains', *J. Am. Stat. Assoc.*, vol. 113, no. 522, pp. 649-659, 2018, doi: 10.1080/01621459.2016.1273115.

[36] G. Ruck, 'Behavioural Fingerprinting for Advanced Ecotoxicological Monitoring'. [Online]. Available: https://github.com/ruckapark/PhD-Resources (accessed 2024-12-01).

[37] M. J. Todd and E. A. Yıldırım, 'On Khachiyan's algorithm for the computation of minimum-volume enclosing ellipsoids', *Discrete Appl. Math.*, vol. 155, no. 13, pp. 1731-1744, 2007, doi: https://doi.org/10.1016/j.dam.2007.02.013.

[38] F. L. Watson et al., 'Organophosphate pesticides induce morphological abnormalities and decrease locomotor activity and heart rate in Danio rerio and Xenopus laevis', *Environ. Toxicol. Chem.*, vol. 33, no. 6, pp. 1337-1345, 2014.
[39] M. A. Beketov and M. Liess, 'Potential of 11 Pesticides to Initiate Downstream Drift of Stream Macroinvertebrates', *Arch. Environ. Contam. Toxicol.*, vol. 55, no. 2, pp. 247-253, Aug. 2008, doi: 10.1007/s00244-007-9104-3.

[40] M. A. Alcívar et al., 'Could Contamination Avoidance Be an Endpoint That Protects the Environment? An Overview on How Species Respond to Copper, Glyphosate, and Silver Nanoparticles', *Toxics*, vol. 9, no. 11, p. 301, Nov. 2021, doi: 10.3390/toxics9110301.

[41] G. Carli and F. Farabollini, 'Chapter 1 - Defensive responses in invertebrates: Evolutionary and neural aspects', in *Defence from Invertebrates to Mammals: Focus on Tonic Immobility*, vol. 271, G. Carli and F. Farabollini, Eds., in *Progress in Brain Research*, no. 1, vol. 271. Elsevier, 2022, pp. 1-35. doi: https://doi.org/10.1016/bs.pbr.2022.02.001.

[42] Aemig Q, Hélias A & Patureau D (2021) Impact assessment of a large panel of organic and inorganic micropollutants released by wastewater treatment plants at the scale of France. *Water Research*, 188:116524. https://doi.org/10.1016/j.watres.2020.116524

[43] M. Kafi, J. Gasperi, R. Moilleron, M. C. Gromaire, and G. Chebbo, 'Spatial variability of the characteristics of combined wet weather pollutant loads in Paris', *Water Res.*, vol. 42, no. 3, pp. 539-549, Feb. 2008, doi: 10.1016/j.watres.2007.08.008.

[44] Soose, L. J., Rex, T., Oehlmann, J., Schiwy, A., Krauss, M., Brack, W., Klimpel, S., Hollert, H., & Jourdan, J. (2024) One like all? Behavioral response range of native and invasive amphipods to neonicotinoid exposure. *Environmental Pollution*, 356, 124235. doi: 10.1016/j.envpol.2024.124235

[45] Lopes, I., Baird, D. J., & Ribeiro, R. (2004). Avoidance of copper contamination by field populations of Daphnia longispina. *Environmental Toxicology and Chemistry*, 23(7), 1702-1708. doi: 10.1897/03-231[45] Z. J. Ren et al., 'Data Science for Advancing Environmental Science, Engineering, and Technology', *Environ. Sci. Technol.*, vol. 57, no. 46, pp. 17661-17662, Nov. 2023, doi: 10.1021/acs.est.3c08700.

[46] S. E. R. Egnor and K. Branson, 'Computational Analysis of Behavior', Annu. Rev. Neurosci., vol. 39, no. 1, pp. 217-236, Jul. 2016, doi: 10.1146/annurev-neuro-070815-013845.

[47] X. Jia, T. Wang, and H. Zhu, 'Advancing Computational Toxicology by Interpretable Machine Learning', *Environ. Sci. Technol.*, vol. 57, no. 46, pp. 17690-17706, Nov. 2023, doi: 10.1021/acs.est.3c00653.

[48] Z. J. Ren et al., 'Data Science for the Transformation of Environmental and Chemical Research and Development', *Environ. Sci. Technol.*, vol. 57, no. 46, pp. 17663-17664, Nov. 2023, doi: 10.1021/acs.est.2c07679.

[49] J.-J. Zhu, M. Yang, and Z. J. Ren, 'Machine Learning in Environmental Research: Common Pitfalls and Best Practices', *Environ. Sci. Technol.*, vol. 57, no. 46, pp. 17671-17689, Nov. 2023, doi: 10.1021/acs.est.3c00026.

[50] P. Plamper, O. J. Lechtenfeld, P. Herzsprung, and A. Groß, 'A Temporal Graph Model to Predict Chemical Transformations in Complex Dissolved Organic Matter', *Environ. Sci. Technol.*, vol. 57, no. 46, pp. 18116-18126, Nov. 2023, doi: 10.1021/acs.est.3c00351.

[51] C. Song et al., 'Attribution of Air Quality Benefits to Clean Winter Heating Policies in China: Combining Machine Learning with Causal Inference', *Environ. Sci. Technol.*, vol. 57, no. 46, pp. 17707-17717, Nov. 2023, doi: 10.1021/acs.est.2c06800.

[52] J. Jacques and C. Preda, 'Functional data clustering: a survey', *Adv. Data Anal. Classif.*, vol. 8, no. 3, pp. 231-255, Sep. 2014, doi: 10.1007/s11634-013-0158-y.

[53] M. A. Stravs, C. Stamm, C. Ort, and H. Singer, 'Transportable automated HRMS platform "MS2field" enables insights into water-quality dynamics in real time', *Environ. Sci. Technol. Lett.*, vol. 8, no. 5, pp. 373-380, 2021.
# SUPPORTING INFORMATION

## Appendix 0 – Stabilisation and Spike laboratory testing with the ToxMate for a multispecies approach

The initial study [14] focused solely on *Gammarus fossarum*, a well-established bioindicator species. This study defined avoidance behaviour as an effective metric under controlled and field conditions to observe variation in surge micropollutant concentrations. In this study, a minimal activity model to distinguish between normal baseline behavioural and behavioural response, after careful acclimatisation period in the laboratory and ToxMate, was shown. This baseline model involved careful 2 week stabilisation in the lab priori to exposure to ToxMate conditions, as well as at least 72 hour stabilisation in the ToxMate to ensure a basal activity baseline, after which the 16 individuals in each assay showed reproducible locomotor patterns in the absence of contaminants (controls or control conditions), as well as with spikes of 4 methomyl and copper exposures. This data is recycled, along with new data for the current study.

In the initial study, the ToxMate system was not used to its full potential, as the ToxMate is designed with three independent chambers, each capable of hosting 16 individuals of a given species. The multispecies functionality is particularly valuable for increasing scope of pollutant type detection, and a major focus of this study.

In this study, the same methodology and experimental protocol were extended to two additional invertebrate species:

- *Erpobdella testacea* (a freshwater leech species described in the paper)

- *Radix auricularia* (a widespread freshwater gastropod)

These species were chosen on their distinct phylogenetic positions when compared to *Gammarus*, and allowing for broader biofunctional diversity in an aim to cover as many species sensitivities to micropollutant families as possible (as opposed to choice based on ecotoxicological or ecological relevance, which is not of interest in the real-time alerting operational vision of the ToxMate).

## Spike Exposure Protocol

Once the stabilisation has been carried out, a concentrated solution of the desired chemical is introduced into the ToxMate chamber as described in Figure S0-1. Each of the three chambers is linked to a pump in the basin that ensure homogenous and quasi instant mixture (as described in [14].
A

<figure><img src="image_7.png" /></figure>

Figure S0.1 Experimental mixing procedure. (A) Visualisation of the spike mixing in the 15L water tank of the closed circuit through the premix in a 300ml Erlenmeyer (B) The above view of an operating water tank with the three pumps aligned at the far end, and the oxygenation and return flow at the front end, where spike solutions are introduced.

B

<figure><img src="image_8.png" /></figure>

Scaling for Cross Species Comparison

It is noted that the quantile used in the avoidance metric remains unchanged for the two additional species. To facilitate comparison of behavioural changes across the species, all individual locomotor data were linearly scaled. Scaling was based on the species specific median activity level observed during control conditions. This preserves the relative dynamics of behavioural response while allowing standardised interpretation. This is largely sufficient in this proof of concept stage, as shown by the matching distributions post scaling in Figure S0-2.

<figure><img src="image_9.png" /></figure>

Figure S0.2 The scaled activity distributions from data 2 hours prior to spike exposure from the ensemble of data throughout the PhD, for E. testacea, G. fossarum and R. auricularia
## Appendix A – Chemical Analysis

The Table S1 details the categories used for semi-quantitative representation of chemical fingerprints in the paper.

Table S1 Chemical concentration brackets as detailed by outsourced chemical analysis, for the 803 dosed chemicals in on site ToxMate grab samples.

<table><thead><tr><th colspan="6">Concentration bracket (µgL<sup>-1</sup>)</th></tr></thead><tbody><tr><td>No detection</td><td>Unquantified</td><td>&lt;0.05</td><td>0.05-0.1</td><td>0.1-0.5</td><td>0.5-1.0</td><td>&gt;1.0</td></tr><tr><th colspan="7">Concentration retained for visualisation (and discharge estimates) (µgL<sup>-1</sup>)</th></tr><tr><td>0</td><td>0.01</td><td>0.05</td><td>0.1</td><td>0.5</td><td>1.0</td><td>1.5</td></tr></tbody></table>

The details of the chemical analysis are in the document provided by LODIAG company (France), in the attached Supplementary Materials.

## Appendix B – *E. testacea* shows hypoactive avoidance

The defence posture is visualised during a ToxMate experiment observation.

<figure><img src="image_10.png" /></figure>

<figure><img src="image_11.png" /></figure>

Minimal activity

<figure><img src="image_12.png" /></figure>

Hypoactive avoidance

Figure S1 Methomyl exposure at 125µgL⁻¹ provokes a defensive hypoactive avoidance reaction in sub 20 minutes of exposure.
Appendix C – Mean and Avoidance Plots for Four Distinct Micropollutants

Figure S2 shows the Copper observations for all species and repetitions.

<figure><img src="image_13.png" /><figcaption>Figure S2 Copper locomotor response for 8 observations of spike exposure at 100µgL⁻¹ for E. testacea (orange), G. fossarum (green), R. auricularia (blue) in comparison to control assays.</figcaption></figure>
Figure S3 shows the methomyl observations for all species and repetitions.

<figure><img src="image_14.png" /><figcaption>Figure S3 Methomyl locomotor response for 7 observations of spike exposure at 125µgL-1 for E. testacea (orange), G. fossarum (green), R. auricularia (blue) in comparison to control assays.</figcaption></figure>
Figure S4 shows the verapamil observations for all species and repetitions.

<figure><img src="image_15.png" /><figcaption>Figure S4 Verapamil locomotor response for 3 observations of spike exposure at 120µgL⁻¹ for E. testacea (orange), G. fossarum (green), R. auricularia (blue) in comparison to control assays.</figcaption></figure>
Figure S5 shows the Zinc observations for all species and repetitions.

<figure><img src="image_16.png" /><figcaption>Figure S5 Zinc locomotor response for 4 observations of spike exposure at 325µgL⁻¹ for E. testacea (orange), G. fossarum (green), R. auricularia (blue) in comparison to control assays.</figcaption></figure>
Appendix D – Univariate fPCA plots

<figure><img src="image_17.png" /><figcaption>Figure S6 fPC and fPCA plot for G. fossarum showing 95% of explained variance. (B) fPC and fPCA plot for R. auricularia showing 95% of explained variance</figcaption></figure>
The following three plots in Figure S7 represent the resulting univariate fPCA taking the avoidance signal $\alpha(t)$ as opposed to the mean functional variable shown in §3.1.

<figure><img src="image_18.png" /><figcaption>Figure S7 fPCA scoreplot and fPCS for the avoidance signal of the three invertebrate species.</figcaption></figure>
Appendix E Field Data Clusters Visualised Individually

This appendix supplies complementary details on the mfPCA performed on videotracking data during the behavioural alerts from the field WWTP monitoring (Fig4 of the main document). It serves to visualise avoidance curves behind points in Figure 4A (Figure S9-12). The fPCA figure is shown in Figure S8 with labelled data points associated to the curves in Clusters 1-4 (Figures S9-12). The upper panels of Figure S8 show the elbow plot and the silhouette plot supporting the four clusters formed. It should be noted that the selection of 4 clusters is somewhat arbitrary, as the goal is simply to demonstrate the feasibility of the developed method when treating field data. Here, the Silhouette scores are comparable for 2, 3, and 4 clusters, but decline noticeably from 5 clusters onward. Meanwhile, the inertia criterion in the elbow analysis shows clear improvement from 3 to 4 clusters. Thus, k=4 emerges as the optimal trade-off for clustering and subsequent analyses.

In the supplementary table, the LODIAG screening method targets over 800 compounds, and the subset detected in at least one sample are presented in the supplementary tables for relevance and clarity.

<figure><img src="image_19.png" /><figcaption>Figure S8 Clustering of all field events detected at the monitoring site in northern France, as in Figure 4 of the main text.</figcaption></figure>
## Cluster 1

<figure><img src="image_20.png" /><figcaption>Figure S9 Cluster 1 avoidance curves from field monitoring</figcaption></figure>

## Cluster 2

<figure><img src="image_21.png" /><figcaption>Figure S10 Cluster 2 avoidance curves from field monitoring.</figcaption></figure>
Cluster 3

<figure><img src="image_22.png" /><figcaption>Figure S11 Cluster 3 avoidance curves from field monitoring.</figcaption></figure>

Cluster 4

<figure><img src="image_23.png" /><figcaption>Figure S12 Cluster 4 avoidance curves from field monitoring</figcaption></figure>