dataesr/scientific-paragraphs-categorization huggingface dataset:
Targeting 26 animal species or higher-order taxonomical groups We restricted our dataset and model to 26 animal species or higher-order taxonomical groups that were common enough and well sampled in our original dataset. Our model was trained on the following 19 species: European badger (Meles meles), bear (Ursus arctos), cow (Bos Taurus), dog (Canis familiaris), red fox (Vulpes vulpes), common genet (Genetta genetta), goat (Capra sp. ), hedgehog (Erinaceus europaeus), ibex (Capra ibex, alpine only), lynx (Lynx lynx), marmot (Marmota marmota), mouflon (Ovis gmelini), nutria (Myocastor coypus), red deer (Cervus elaphus), roe deer (Capreolus capreolus), sheep (Ovis aries), squirrel (Sciurus vulgaris), wild boar (Sus scrofa) and wolf (Canis lupus lupus), and 7 higher-order taxa: bird, chamois (Alpine, Rupicapra rupicapra, and Pyrenean, Rupicapra pyrenaica), cat (domestic and wild Felis catus), equidae, lagomorph, micromammal, mustelidae.
Finally, we tested whether the trained CNN model's performance was maintained when it was used to classify images that were quite different from those used for training and validation. These novel images are commonly called 'out-of-sample' and allow for the robust assessment of model performance on new datasets. Along the modelling process, we paid attention to common biases and pitfalls that are common when dealing with ecological datasets and followed technical tips to deal with such issues  (Desprez et al. 2023).
Training and validation datasets Avoiding shortcut learning. We prepared the training and validation datasets using MegaDetectorV5, developed by  Beery et al. (2019)  (model v5a), on our original dataset to filter out empty images and images containing humans and/or vehicles. MegaDetector v5a is based on the image detection model YOLOv5  (Redmon et al. 2016 ) and allowed us to produce one cropped image per animal that was detected (there were potentially multiple individuals in a given image). We retained cropped images that had a confidence score higher than 0. 8 to decrease the risk of false detection. Since the images in the original dataset were annotated, it was possible to annotate any cropped image in the training and validation datasets using the annotation of its parent image. For instance, if MegaDetectorV5 detected two animals in an image originally annotated as 'wild boar', we considered that the two resulting cropped images contained a wild boar to train the model.
After this step, we remained with a dataset of 787 575 cropped animal images. In addition to often having images taken in dozens of different settings thanks to the numerous contributors, for most species, the 'cropping' step described above also enabled us to avoid shortcut learning  (Geirhos et al. 2020)  as we trained and validated our CNN classification model on annotated images for which the background had been mostly removed. Avoiding data leakage. CNN models require independent training and validation datasets to learn successfully  (Kapoor and Narayanan 2022) , and as commonly done, we split the whole image dataset into a training dataset containing 90 % of the images, and a validation dataset containing the remaining 10%. One issue that could arise during this split is that pictures collected within the same sequence are used in both the training and validation datasets, which would threaten their independence  (Desprez et al.
2023 ). As our original dataset contained pictures and videos collected with many different camera trap models, there was no consistency in how the date and time stamps were stored. We thus chose to identify sequences through image filenames instead. We used a heuristic based on text mining in the R package stringdist (van der Loo 2014) to compare filenames to each other. We considered that two files were not independent if their filenames were too similar, i. e. if their similarity was above 0. 9. This conservative threshold ensured that no image, from the same sequence or video, was present both in the training and the validation datasets. Dealing with class imbalance. Class imbalance may occur when the number of images differs between classes and it is known to affect both training and validation  (Johnson and Khoshgoftaar 2019).
Training and validation phases We used transfer learning starting from a ConvNext-Base model  (Zhuang et al. 2022 ) that was pre-trained on Imagenet 22K, with a resolution of 224 × 224, using PyTorch. We performed image augmentation using the imgaug Python library (https://github. com/aleju/imgaug) during the training phase. Each image in each batch was modified with a random set of transformations such as horizontal flip, affine transformations, gray scale transformation, blurring, brightness or contrast changes. We used the softmax output as a prediction score. We used the SGD optimizer with a learning rate of 4e-4. We then estimated the model for a maximum of 100 epochs, monitored the overall balanced validation accuracy and stopped the estimation when it did not increase with a patience of 10 epochs.
Estimating classification performance on out-of-sample data using sequences Building an out-of-sample dataset. We investigated the ability of the pipeline (i. e. the detection model followed by the classification model) to perform an accurate identification of species in an out-of-sample dataset, i. e. on images taken in contexts that have never been seen during the training stage  (Schneider et al. 2020). Our out-of-sample dataset originated from five partners plus a public dataset from the Peneda-Gerês National Park in Portugal  (Zuleger et al. 2023). We explored the classification accuracy of the CNN-based classification step after using MegaDetector V5 (model v5a) to retrieve cropped images around animals using a threshold of 0. 8. The final out-of-sample contained 213 059 cropped animal images of 23 of the 26 species or higher taxonomic groups on which the Deepfaune pipeline focuses (lynx, hedgehog and nutria were lacking).
Using sequence information to enhance prediction. We predicted the species present at the level of the sequence and not at the level of the individual image. We remained with an out-of-sample dataset of 36 033 sequences. We chose to predict on the sequence level for two reasons: camera traps are now often set to take images in bursts, and animals commonly stay several seconds near the camera, triggering it multiple times in a row. To do so, we extracted the date and time of each image of the out-of-sample dataset using the EXIF information. We obtained the prediction score at the sequence level by first computing the prediction score for each image of the sequence that was not predicted as empty. We then summed these scores and considered that the class with the highest total prediction score was the predicted class for the sequence.
The DeepFaune software We found that MegaDetectorV5 created a bottleneck in terms of speed when used on a CPU (about 2 to 3 seconds per image in our experiments on various personal computers) due to its high image resolution  (1280)  and large model size based on YOLOv5x (https://github. com/ultralytics/ultralytics). We therefore developed a much faster alternative using YOLOv8s (https://github. com/ultralytics/ultralytics), which is a highperformance medium-sized detection model with a resolution of 640. We trained the YOLOv8s-based detector using the cropping information given by MegaDetectorV5 in images previously used in this study (to limit the computing needs, we took a subset of our full dataset). We obtained a detection performance that is generally similar to the one of MegaDetectorV5, but at a much higher speed (see Online Resource 1 Table  S.
1). We then implemented this alternative detector (which needs only about 0. 3 second per image) and our CNN classifier inside a free, user-friendly and independent software. The detector automatically crops the image around the animal if one is detected, so users can upload their full-size images, stored locally, directly in the software, and classify these images either as empty, human, vehicle or one of the 26 animal classes on which the CNN classifier was trained. Users can decide on a threshold on the prediction score below which the images will not be classified and will be set aside in a 'undefined' class for visual inspection. The software only requires the installation of Python v3 and its PyTorch module. To overcome the common difficulties associated with the installation of Python libraries on Windows operating systems, we created a standalone and ready-to-use.
exe program for these systems. The software processing time depends on the machine's CPU, and is linear with the number of images to be processed. In our experiments, it processed 1000 images in 2 minutes with an Intel Octa-Core i7-10700 CPU. Its memory footprint is also small (around 2 GB) as images are loaded on the fly in small batches. Consequently, there is no memory limit with respect to the number of images to treat in one run. The software is available on the project's website: https://www. deepfaune. cnrs. fr.
Performance of the classification model on the validation dataset We obtained an overall balanced validation accuracy of 97. 3%. Recall and precision were >0. 9 for most classes (Table  1 ), and notably above 0. 95 for many classes for which the number of training images was high (e. g. cow or wild boar). Interestingly, we obtained high performance scores for lynx regardless of the small training sample size (806 images) for this species. This may be due to its characteristic coat color and spotted pattern which facilitates recognition and classification. We did not observe many identification mismatches between the different ungulate species (Online Resource 1, Fig. S. 1). For instance, performance for red deer and roe deer was excellent, despite some objective visual similarities. Precision for mouflon was not great (0.
Performance of the classification model on the out-of-sample dataset The classification model achieved an overall accuracy of 93. 6% on individual images and 96. 7% on the outof-sample dataset when predicting at the level of image sequences. Class-specific results were also generally significantly better when identification was done at the sequence level (Table  2 ). For instance, the recall for roe deer increased from 0. 92 to 0. 96 using sequences. This suggested that fine-grained species identification was facilitated by having different views of the same moving animal (see an example in Fig. 1 ). The performance using sequences is overall close to those obtained on the validation dataset (without sequences). High performance was achieved for large ungulates, with precision and recall being about 0.
95 for red deer, roe deer, chamois, and wild boar (Table  2 ), with the exception of ibex and mouflon for which the model made some confusion with other species (e. g. goat). There remained some mismatches between classes (Online Resource 1 Fig. S. 2), for instance 155 sequences of roe deer that were classified as red deer. Performance remained excellent for smaller animals, including marmots, lagomorphs, micromammals and birds. As in the validation dataset, inspection of the confusions revealed that they mostly occurred in nighttime images or when the animal was partially visible (see examples in Fig. 2 ).
Discussion The DeepFaune initiative represents a successful multi-partner collaboration to build a large-scale camera trap image dataset and develop a machine learning model, fully tested and evaluated, readily available to automatically classify camera trap images collected in Europe. Our current model allows for predicting the presence of 26 different species or higher order taxa in camera trap images, with an emphasis on mammals. Although we did use the standard approach of transfer learning, we implemented a combination of heuristics to deal with class imbalance and the independence of training and validation datasets that could be useful to others. Ultimately, our species classification model performed extremely well on the validation dataset and provided robust results on out-of-sample data.
Additionally, we built a graphical user interface (GUI) that is freely available online (https://www. deepfaune. cnrs. fr) so that practitioners can easily run the model locally on a personal computer and automatically sort their images or videos based on the model predictions. The model is also available as a software component to be integrated in other tools, in particular management of camera trap images online platforms, such as Agouti (www. agouti. eu) for instance, in which the Deepfaune classification model can already be used.
Model performance and relevance for ecological studies There are currently few species-recognition models available for the European fauna and our results could therefore be used to benchmark future studies. The quality of our model appears very good, even by deeplearning classification standards, and compares favorably with results from similar exercises conducted on fauna from other continents. For instance, overall accuracy of 0. 97, 0. 78 and 0. 94 on validation datasets were respectively reported in studies on North American fauna  (Tabak et al. 2019) , Central African fauna  (Whytock et al. 2021)  and East African fauna  (Norouzzadeh et al. 2018). Our model also performs better than those reported by  Carl et al. (2020)  and  Simões et al. (2023)  (0. 71 accuracy and 0. 74 mAP respectively), which are the rare published models focused on European fauna and for which performance metrics are available.
We note however that these performance metrics were computed on different datasets than ours, so that direct comparison between performance values across studies should be interpreted with caution. We managed to obtain good results with a moderately sized dataset (by deep-learning standards), by overcoming a number of obstacles. Firstly, the large imbalance (e. g. two orders of magnitude more images of chamois than ibex) would have biased the classification towards the most common species. We therefore implemented an original approach combining downsampling and upsampling techniques that successfully prevented the emergence of a relationship between identification performance and the number of images per class. Secondly, deep learning models are known to be able to learn 'shortcuts'  (Geirhos et al.
9 for most species (as explained in the Results section, performance for ibex and mouflon are low, but will likely improve as new pictures are continuously added in the database). These results suggest that our model could be a useful tool to facilitate studies investigating the effects of management practices on locally abundant ungulates (e. g. can wild boar population dynamics be controlled by hunting?) or the dynamics of prey under predation (e. g. do roe deer populations decrease as wolves return?); (2) monitoring large mammalian communities. Although model accuracy levels were generally lower for classes other than ungulates, the model's performance and taxonomic coverage suggest that it could be useful to automatically sort out hundreds of thousands of pictures for a range of taxonomic groups.
This could prove especially useful in studies looking at the impact of anthropization on large mammal communities for example. A human intervention would still be required to manually verify the pictures for which prediction scores are low or to identify the species present in images where the model classifies at a higher taxonomic level (e. g. mustelidae), but this effort should be dramatically reduced when using our model; (3) quantifying human disturbance levels, as our pipeline is able to distinguish images containing humans, vehicles and/or domestic animals such as cattle (sheep, cow) and dogs. The current model performances should therefore enable us to build reliable metrics estimating human activities along wide gradients. Importantly, the general high quality of the model results was conserved when applied to out-ofsample datasets.
It is a common error to take model results on validation datasets at face value and assume similar accuracies will be observed in new applications. Previous studies  (Whytock et al. 2021 ) have shown that this is not the case and observed dramatic declines in accuracy when tested on out-of-sample datasets, to the point where the usefulness of the model could sometimes be called into question. Our out-of-sample tests, based on heterogeneous images from new and unseen locations, suggests that our model performances are robust to new applications. Additionally, these out-of-sample tests were designed to test the applicability of our model to real-world scenarios. It revealed that using the average prediction score over temporallyclose pictures (i. e. sequence) can improve classification results if classification at the sequence-level is sufficient.
Lessons Building the original database clearly revealed the intricacies of dealing with multiple, high-volume data transfers as well as with the strong heterogeneity in data acquisition and organization among the partners. The devil is in the details, and harmonizing directory, file and species names were all very time-consuming tasks that had to be dealt with by combining automatic and manual interventions. Partner-specific data management appears as one of the strongest barriers to creating efficient large-scale datasets that do not depend on a single monitoring program (as opposed to the Serengeti Snapshot  (Swanson et al. 2015)  dataset for instance). Interestingly however, some of our individual partners were members of the same institution but worked in different sites. For example, we received data from several national parks that all belonged to the same institution (Parc Nationaux de France).
Expectations shared by all partners were that the machine learning approach should be easy to implement and run on a standard personal computer. This is a long-standing issue regarding deep-learning models, as even when training is not required and only predictions are expected, the installation of libraries necessary for computation (e. g. Tensorflow, PyTorch) can be difficult. Uploading pictures on an online platform running its own servers naturally solves this issue. We however found that many partners were reluctant to follow this approach either because of the need to upload gigabytes of images online or because the data-sharing policies were too stringent. We thus decided to implement our approach in a freely available, cross-platform (Windows, macOS, Linux), Python-based software whose developments can be followed at https://www.
Conclusion In conclusion, our work provides a rather successful classification model of the European fauna in camera trap images, which can be easily used by practitioners through the DeepFaune software on self-hosted images using a standard personal computer. Such an approach contrasts with some recent developments that favor cloud-computing. Our work however remains a work-in-progress and feedback on the use of the model and the associated software, as well as annotations of images for which the model failed, should allow us to improve the model's performances and increase the number of taxa that are recognized in the near future.
Acknowledgments This work was performed using the computing facilities of the  CC LBBE/PRABI. This work has benefited from discussions initiated within meetings of the  GDR 'Ecologie Statistique ' of the  CNRS. V. Miele would like to thank the  LECA laboratory  for having hosted him in Chambéry, and  L. Humblot  for insightful discussions about the software. Also, for many partners, field technicians and students contributed largely to data collection, and they are acknowledged for their critical work. Some partners could not share images at the time of our study but actively participated in the discussions around future model developments:  PNR des Ardennes ,  PNR de Chartreuse ,  PNR du Haut-Languedoc, PNR du Haut Jura, PNR du massif des Bauges, PNR de Préalpes d'Azur, PN de la Vanoise and PN des Calanques, FNC.
Funding The DeepFaune team is funded by the  CNRS , the  university Lyon 1 , the ' Ecole Normale Supérieure de Lyon ' and the ' Programme National de Recherche en Intelligence Artificielle'. The  CNRS  provided additional financial support through its ' Mission pour les Initiatives Transverses et Interdisciplinaires '. The following funders supported data collection through various programs (supported partners in parenthesis):  Région Auvergne-Rhône-Alpes  ( FDC Drôme ,  Ain ,  Jura ;  CREA  ;  PNR Baronnies Provençales) ,  Région Sud-PACA (NR Baronnies Provençales) ,  Réseau de Transport d'Electricité (CEFE) ,  Fédération Nationale des Chasseurs (FDC Ain ,  Jura ,  Office Français de la Biodiversité  (through the Ecocontribution,  FDC Ain, Jura) ,  Conseils Départementaux de l'Ain et du Jura (FDC Ain, Jura) ,  Fonds européens FEDER/POIA (CREA) ,  Département de la Haute Savoie (CREA) ,  Département de la Drôme (PNR Baronnies Provençales) ,  Département des Hautes-Alpes (PNR Baronnies Provençales) ,  Communauté de Communes Vallée de Chamonix (CREA) ,  DREAL Bourgogne-Franche-Comté (FDC Jura) ,  DREAL Auverge-Rhône-Alpes (FDC Ain) ,  DREAL Normandie (PNR Perche) ,  DREAL Centre-Val-de-Loire (PNR Perche) ,  DREAL Occitanie (UMR GEODE) ,  Fondation François Sommer (UMR GEODE) ,  Fédération Départementale des Chasseurs de la Marne (CERFE) ,  Réseau SNCF (CERFE) ,  Autoroutes SANEF (CERFE) ,  Nottingham Trent University and Fauna & Flora International  ( B.
Availability of data and materials The pictures used in this study are available upon request to each partner. The DeepFaune software code and the model parameters are freely available at https://plmlab. math. cnrs. fr/deepfaune/software/. The code is released under the CeCILL licence. The model parameters are protected by the CC BY-NC-SA 4. 0 license (Attribution-NonCommercial-ShareAlike 4. 0 International).
learned from a successful multi-partner initiative One of the main strengths of the DeepFaune initiative lies in the creation of a nation-wide network among key actors in French and European biodiversity research, conservation and management. Under the lead of an academic research group originating from two distinct laboratories, over 50 partners have shared camera trap pictures and videos allowing to build what is likely to be one of the largest databases of camera trap medias in France, in both, number of files (more than 2 million annotated pictures and 20 thousand annotated videos) and location heterogeneity (e. g. mountains, wetlands).
Since the Stokes parameters are additive for any selection criterion  (Kislat et al. 2015) , those referring to a given energy band are obtained by simply summing the parameters of all the events in the energy range of interest weighted by the modulation factor. The data products are archived at the High-Energy Astrophysics Science Archive Research Center (HEASARC; at the NASA Goddard Space Flight Center), for use by the international astrophysics community. IXPE observed Tycho twice, from 2022 June 20 to 2022 July 4 (observation ID 1001401) and from 2022 December 21 to 2022 December 25 (observation ID 02001601), for a total exposure time of ∼990 ks. We carried out the polarization analysis of the data with the publicly available software package ixpeobssim  (Baldini et al. 2022) , a simulation and analysis toolkit developed by the IXPE Collaboration that includes a tool for generating realistic Monte Carlo simulations of IXPE observations, as well as a full suite of post-processing applications able to select and process data to produce Stokes maps and spectra.