dataesr/scientific-paragraphs-categorization huggingface dataset:
Model evaluation and metrics The validation set was used for models' comparison and evaluation, and all analyses reported share the same validation set, for a total of 5 runs for each experiment. The hold-out testing set was further applied to evaluate the performance of the best-chosen model to an unseen set. To evaluate the overall performance of the different proposed methods, balanced accuracy (average of recall obtained on each class) was calculated. Performance per class was assessed using confusion matrices and corresponding F1-score. The F1-score is the harmonic average of the precision and recall, calculated as follows: 𝐹1 𝑠𝑐𝑜𝑟𝑒 = 2 × 𝑝𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 ×𝑟𝑒𝑐𝑎𝑙𝑙 𝑝𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛+𝑟𝑒𝑐𝑎𝑙𝑙 , where  =   ( + ) and  =   ( + ). These metrics are better suited to deal with imbalanced datasets.
Real-time control system The entire control system consists of software and hardware modules configured to create an automated closed-loop tool. It is made of five main components: the control computer, the interface board, the control software, the video camera and the maze hardware modules (Fig. 1 ). Frames acquired by a depth camera are fed into the trained deep learning models, which will automatically detect both behavioral events and the animal's position in the maze. The network outputs are sent to the interface board that, together with existing sensor outputs (e. g. , buttons, maze sensors), controls circuit actuators (e. g. , maze feeders, light-emitting diodes (LED)s). The computer is used to operate the entire circuit by a graphical user interface (GUI), either sending messages to the interface board or acting directly on the maze hardware modules.
Interface board An Arduino microcontroller (Mega 2560) was used as the interface board between the computer and the hardware modules, and the communication is established using a communication (COM) port. The microcontroller board has 16 MHz clock speed, and 54 digital input/output ins that can be connected to different maze hardware components, such as animal feeders, LEDs, maze sensors, and buttons. After being connected to the computer, the Arduino board communicates via Arduino integrated development environment (IDE). The user writes the Arduino code for the automated control in the IDE, uploads it to the microcontroller which executes the code to interact with the input and output hardware modules. Notice that, once uploaded, the code can run regardless of the connection between the Arduino and the computer.
Automation control code Arduino code is written within the Arduino IDE (in a language very similar to C++) and it was carefully organized to segregate the code for specific logic state implementations (automated control) from all other maintenance code (such as reading and writing data to the communication port (COM). To do so, a specific user-defined function was created, which has access to all critical variables for the control, such as sensors' and actuators' states, and animal's position and behavior. Inside this function, the user can easily define the conditions of stimuli-response that characterize each behavioral test experiment.
Statistical methods Statistical analysis was performed using GraphPad Prism version 7. 00 (GraphPad Software Inc. , CA, USA). The method of D'Agostino & Pearson was used as a normality test, and parametric or nonparametric tests were chosen as appropriate. Statistical significance was considered for p < 0. 05. Parametric data are expressed as mean ± standard deviation (SD), and non-parametric data are expressed as median and 95% confidence intervals. using surface normals, periphery pixels seem to have a stronger influence on model's prediction (gradient colored as black pixels), when compared to pixels from networks trained with raw depth frames (gradient colored as green pixels). Overall, behavioral learning does not seem to benefit from any of these typical depth input representations.
Acknowledgments This work was partially financed by  FEDER-Fundo Europeu de Desenvolvimento Regional  funds through the  COMPETE 2020-Operacional Programme for Competitiveness and Internationalisation (POCI) ,  Portugal 2020 , and by  Portuguese funds through FCT-Fundação para a Ciência e a Tecnologia/Ministério da Ciência, Tecnologia e Ensino Superior  in the framework of the projects  PTDC/EMD-EMD/31540/2017  ( POCI-01-0145-FEDER-031540 ). We acknowledge the support of the i3S Animal House facility. Ana Gerós  was funded by  FCT -Fundação para a Ciência e a Tecnologia , grant contract  SFRH/BD/137385/2018.
Raw depth video inputs are the most informative for the learning process Depth data encodes distance from the sensor to the captured scene and the information of each pixel is of a different nature, when compared to RGB images which were originally directly used as input for the CNNs. Thereby, the questions that arise are will CNNs learn as effectively when using raw depth images without any encoding, and, if not, how should a depth image be encoded to be used as inputs in CNNs so that it can learn more meaningful features for rodents' classification challenge. Networks were then trained with varying input depth encoding (Supplementary Figure  3b ). Regarding per-class recognition, the negative effect on network's learning when using surface normal encoding is even more pronounced. One possible explanation is that when using a colorization method based on the calculation of surface normal, the reflexes on the walls of the open-field during, for example, grooming events (which are always near open-field's periphery) are more visible and may be interfering with networks' learning.
, 2005; Nichols & Williams, 2006 ). An ecological indicator can be defined as a metric reflecting one or more components of the state of ecological systems. An ecological indicator can either be measured directly or result from the simplification of several fieldestimated values  (Niemi & McDonald, 2004). The Marine Strategy Framework Directive referred to the abundance/ density of targeted species (e. g. seabirds and cetaceans) as ecological indicators to fulfil for national reporting. At large spatial scales, logistical and financial constraints often prevent a detailed coverage of the targeted population using a single collection effort, and different monitoring programmes coexist  (Lindenmayer & Likens, 2010; Zipkin & Saunders, 2018; Isaac et al. , 2019). The multiplication of monitoring programmes over the same conservation context has fostered the development of statistical models that can estimate ecological quantities while accommodating several, possibly heterogeneous, datasets  (Besbeas et al.
, 2018). Integrated modelling holds promise for species occurring over large areas that are likely to be the target of multiple monitoring protocols. Besides, working at large geographical scales requires encapsulating spatial dimensions in the estimation of ecological quantities. Integrated spatial models allow to assess spatialized ecological inference, for example, density of individuals. To date, integrated spatial models have been developed and used on open populations to estimate temporal variation in population dynamics and vital rates such as survival and recruitment  (Chandler & Clark, 2014; Chandler et al. , 2018; Sun, Royle, & Fuller, 2019). These applications rely on long-term datasets that are not always compatible with conservation objectives. In many cases, ecological information is needed quickly, and data to investigate temporal variation are unavailable  (Nichols & Williams, 2006; Lindenmayer & Likens, 2010).
The protected status of bottlenose dolphins within the French seas (listed in Annex II of the European Habitats Directive) led to the development of specific programmes to monitor Mediterranean bottlenose dolphins within the implementation of the European Marine Strategy Framework Directive, which requires assessing the conservation status of this species every 6 years over the large extent of the French Mediterranean Sea  (Authier et al. , 2017). Increasing efforts are dedicated to develop monitoring programmes in the Marine Protected Areas (MPA) network that mainly implements photo-identification protocols locally, while governmental agencies perform large-scale line transect programmes to monitor marine megafauna and fisheries. Hence, multiple data sources coexist about bottlenose dolphins in the French Mediterranean Sea.
In this study, we analysed DS data collected by aerial line transect surveys over a large area covering coastal and pelagic seas  (Laran et al. , 2017) , which we combined with SCR data collected by a photo-identification monitoring programme restricted to coastal waters  (Labach et al. , 2021). We compared the abundance and density of bottlenose dolphins estimated from DS model, SCR model, and integrated spatial models to highlight the benefits of the integrated approach in an applied ecological situation. We discussed the promising opportunities of using integrated spatial models in the context of marine monitoring planning in the French Mediterranean. Eventually, we underlined the conservation implications of using such a model to a wider extent to make the best use of available datasets.
Materials and methods Monitoring bottlenose dolphins in the French Mediterranean Sea bottlenose dolphins in the French Mediterranean Sea. In the context of the Marine Strategy Framework Directive, the French government implemented large-scale aerial transects to monitor marine megafauna  (Laran et al. , 2017). However, the large spatial coverage of the aerial monitoring is impaired by the low resolution of such data (i. e. one campaign every 6 years). Then, to collect detailed data, the French agency for biodiversity funded a photo-identification monitoring programme to investigate the ecological status of the bottlenose dolphins in the French Mediterranean Sea. This coastal boat photo-identification monitoring has been performed between 2013 and 2015. Coastal photo-identification monitoring represents a promising opportunity to produce high-resolution information because data can be collected routinely by Marine Protected Areas at a high time frequency.
Study area and datasets We focused on an area of 255,000 km 2 covering the North-Western Mediterranean Sea within which we considered two monitoring programmes about bottlenose dolphins. We used SCR data from at-sea boat surveys over 21,464 km of the French continental shelf. Observers performed monitoring aboard small boats to locate and photo-identify bottlenose dolphins all year long between 2013 and 2015, always at a constant speed and with three observers. Taking pictures of the dorsal fin of each individual in the group makes possible the construction of detection history and hence the analysis of the population through capture-recapture methods  (Labach et al. , 2021). Boat surveys were restricted to the coastal waters of France and adopted a search-encounter design covering approximately all the continental shelf every 3 months.
We divided the duration of the monitoring programmes into eight equal sampling occasions that length for 3 months each, following a previous analysis by  Labach et al. (2021). We also used DS data that were collected during winter and summer aerial line transect surveys covering 24,624 km of both coastal and pelagic NW Mediterranean Sea between November 2011 to February 2012 and May to August 2012  (Laran et al. , 2017). Two trained observers collected cetacean data following a DS protocol (i. e. recording species identification, group size, and declination angle). Aerial surveys were conditional on a good weather forecast. We divided the study area into 4356 contiguous grid cells creating a 5' × 5' Mardsen grid (WGS 84). To model the density of individuals, we used depth as an environmental covariate, which is expected to have a positive effect on bottlenose dolphins' occurrence  (Bearzi, Fortuna, & Reeves, 2009; Labach et al.
, 2021). To estimate the sampling effort of aerial and boat surveys, we calculated the transect length (in km) prospected by each monitoring protocol within each grid cell during a time period. Typically, entire transects are split into segments as they overlap multiple grid cells  (Miller et al. , 2013). Sampling effort was therefore cell and occasion specific in the case of the SCR model, and cell specific for the DS model. Sampling efforts ranged from 0. 047 km to 308 km per grid cell and per occasion for the photo-id dataset, and from 1. 33 to 54560 km per grid cell for the aerial line transect dataset. We used subjective weather conditions recorded by plane observers during the line transect protocols as a discrete variable ranging from 1 to 8. The good weather condition was expected to be positively related to the detection probability.
Spatial integrated models for closed populations To integrate DS and SCR data, we used the hierarchical model proposed by  Chandler et al. (2018). However, while initially developed for open populations and due to the lack of temporal depth in our datasets, we adapted the model to estimate abundance and density without accounting for demographic parameters (Fig. 1 ). We performed a closed population estimation of bottlenose dolphin density over the 2011-2015 period, assuming that (1) the population was demographically closed during the study period, (2) all individuals were correctly identified at each capture occasion and marks were permanent during the sampling period and (3) no migratory events occurred during the sampling period. Although being strong assumptions, bottlenose dolphin deaths and recruitments between 2011 and 2015 were likely small considering the long life cycle of bottlenose dolphins  (Bearzi et al.
The effect of habitat covariates could be further explored (e. g. by considering other covariates such as sea surface temperature or prey availability, or by accounting for non-linear effects). Then, the estimated population size is derived by integrating the intensity function over the study area: E N ð Þ ¼ Z S λ s ð Þds: (2) As we discretized the study area, we estimated λ j the intensity process describing density for each grid cell j with j = 1,. , J = 4356, hence E N ð Þ ¼ ∑ J j¼1 λ j. The latent ecological process defined by equation 1 is an inhomogeneous point process that is common to both the SCR and DS models. SCR and DS data are linked to density λ and informed the parameters of equation 1. To account for unseen individuals, we used the data augmentation technique and augmented the observed datasets to reach M = 20,000 individuals  (Royle & Dorazio, 2012).
Capture-recapture data To link capture-recapture data with the ecological process, we built a SCR model  (Royle et al. , 2014). Detection history of individuals was collected over T = 8 sampling occasions and capture locations were recorded. Grid cells j in which sampling effort was positive during an occasion were considered as active detectors for this sampling occasion, hence reflecting that animals could be observed. We stored observations in a three-dimensional array y with y ijt indicating whether individual i was captured at grid-cell j during sampling occasion t. We assume that observation y ijt is an outcome from a Bernoulli distribution with capture probability p ijt , y ijt ∼ Bernoulli p ijt z i. We model capture probability with a half-normal detection function p ijt ¼ p 0 exp À d 2 ij 2σ 2 SCR , where d ij is the Euclidian distance between the activity centre of individual i and the grid cell j, σ SCR is the scale parameter of the half-normal function and p 0 is the baseline encounter rate  (Royle et al.
Bayesian implementation To highlight the benefit of integrating data for the estimation of bottlenose dolphin density, we compared (i) the output of the spatial DS model, (ii) the SCR model and (iii) the integrated spatial model. We ran all models with three Markov Chain Monte Carlo chains with 100,000 iterations each in the NIMBLE R package  (de Valpine et al. , 2017). We checked for convergence calculating the R-hat parameter  (Gelman et al. , 2013)  and reported posterior mean and 80% credible intervals (CI) for each parameter. We considered as important the effect of a regression parameter whenever the 80% CI of its posterior distribution did not include 0. We also calculated the predicted density of bottlenose dolphins (i. e. λ). Data and codes are available on GitHub (https://github.
Discussion Integrated spatial model benefits from both distance sampling and capture-recapture data With our integrated spatial model, we estimated bottlenose dolphin abundance within the range of what was found in previous studies in nearby areas  (Gnone et al. , 2011; Lauriano et al. , 2014) , and found that densities were more likely to be higher in coastal areas  (Bearzi et al. , 2009). A striking result was the higher abundance estimated by DS compared to abundance estimated by the integrated and SCR models, which estimates were also found in previous studies analysing the same datasets in isolation. Using CR data only,  Labach et al. (2021)  estimated 2350 dolphins (95% confidence interval: 1827; 3135) inhabiting the French continental coast where our integrated model predicted 2451 dolphins (95% confidence interval: 2306; 2602).
Analysing DS data,  Laran et al. (2017)  estimated 2946 individuals (95% confidence interval: 796; 11,462) during summer, and 10,233 (95% confidence interval: 4217; 24,861) during winter where our DS model estimated 11,531 (95% confidence interval: 9784; 13,478) all year long. Recent aerial campaigns performed in 2018-2019 on the same study area and following the same distance sampling protocol do not suggest a seasonal difference in bottlenose dolphins' abundance  (Laran et al. , 2021). We see several reasons that might explain the discrepancy in estimates obtained from SCR and DS models. First, although the Mediterranean bottlenose dolphins' population is clustered in coastal sub-units  (Carnabuci et al. , 2016) , groups can be encountered offshore  (Bearzi et al. , 2009). In the DS dataset, large dolphin groups were detected in the pelagic seas at the extreme south of the sampling design (Appendix S1).
, 2021; Lee-Yaw et al. , 2021). As the photo-id surveys did not sample greater depths, our SCR model is likely to underestimate abundance because the relation linking dolphin density to depth was not correctly specified. Thus, we emphasised the relevance of aerial surveys that collected data in the pelagic seas, which helps to quantify the habitat-density relationship. To perform a detailed analysis of the NW Mediterranean bottlenose dolphin populations, one should consider additional environmental covariates to better capture spatial variation in density (e. g. sea surface temperature, distance to coast or 200 m contour,  Lambert et al. , 2017). Besides, because Sardinian and Balearic populations and offshore groups can be sampled in the aerial surveys, the DS model drives upwards abundance compared to the SCR model which is unlikely to account for animals that are members of the Southern neither the Eastern nor offshore populations.
Overall, both DS and SCR data affected the estimates of the integrated spatial model. Using SCR data brought more information about population size (e. g. more detections, more individuals) than the DS data to inform the intercept of density (μ 0 ), making the integrated spatial model abundance estimate closer to the SCR model estimate (Table  1 ; Fig. 2 ). However, the DS data that were collected throughout the range of the habitat predictor informed the slope of the inhomogeneous point process (μ 1 ), that is, the effect of depth on dolphin density. Then, in the integrated spatial model, the SCR data informed the estimated population size and the DS data informed spatial repartition of individuals by correcting for the geographic sampling bias in the SCR data. The integrating approach helped to reduce the sampling limitations of each dataset and can improve the ecological inference as illustrated here about bottlenose dolphins.
, 2017; Pettex et al. , 2017; Lambert et al. , 2020). However, funding constraints make aerial monitoring hardly applicable at a high frequency, and it is planned to be implemented every 6 years. In parallel, the French office for biodiversity develops and supports local monitoring programmes in the French MPA network to perform photo-id data continuously; such detailed datasets represent an important asset to inform the abundance of marine mammals populations  (Evans & Hammond, 2004). Ecological indicators required by the Marine Strategy Framework Directive for bottlenose dolphins would benefit from integrating aerial line transect with more data when available  (Lauret et al. , 2021). In addition, the French Research Institute for Exploitation of the Sea (i. e. IFRE-MER) collected yearly bottlenose dolphins' data during line transects surveys for pelagic fisheries  (Baudrier et al.
, 2018). Ultimately, several monitoring programmes will be available for bottlenose dolphins in the Mediterranean context and integrated spatial models makes it possible to include existing datasets that have been discarded so far to inform public policies  (Cheney et al. , 2013; Isaac et al. , 2019). We acknowledge that our model has limitations due to several ecological features lacking, for example, spatial autocorrelation, effect of other environmental covariates, accounting for non-linear covariate effect and group behaviour of bottlenose dolphins that may generate non- independent individual detection probabilities. One might also consider extending the activity centre process to include a movement model of individuals  (Gowan, Crum, & Roberts, 2021). Moreover, ecological closure assumptions we assumed are likely to be violated but we assumed the bias introduced bias would be minimal.
However, we emphasize that integrated spatial models are highly relevant considering the future monitoring planning by the French biodiversity agency that will perpetuate the coexistence of photo-identification with aerial line transect. Analysing the collected data in an integrated framework will lead to a more comprehensive understanding of how the monitoring programmes can work together and what exactly it is that they achieve in unison. It is our hope that the ability of integrating different datasets contributes to the ongoing monitoring efforts developed in the Mediterranean context and fits within the scope of what managers expect from statistical developments to inform environmental policies  (Lauret, 2021). Line transect and capture-recapture surveys are widely used monitoring methods to assess the population dynamics of marine mammals  (Hammond et al.
, 2021). Our work provides a promising modelling baseline to deal with the bottlenose dolphin evaluation but also opens perspectives for other conservation challenges about marine species that are subject to similar monitoring situations in the French Mediterranean context (e. g. fin whale and seabirds) and elsewhere. Last, adding complementary long-term datasets to the aerial surveys would make it possible to access the demographic parameters (e. g. recruitments and survival  (Chandler et al. , 2018) ), which would represent a major opportunity for the knowledge about French Mediterranean bottlenose dolphin populations and to produce reliable conservation status. The use of integrated spatial models for the French Mediterranean bottlenose dolphin population also enables to extend the modelling approach exploring seasonality in density and to measure immigration and dispersal between bottlenose dolphin populations  (Zipkin & Saunders, 2018).