dataesr/scientific-paragraphs-categorization huggingface dataset:
4. These facial signals were therefore simpler and more stereotypical than the others. 'Fear' (0. 23) and 'anger' (0. 15) were the densest graphs, thus using the highest number of different units, making them potentially the most complex signals in this dataset. While 'surprised' faces were relatively dense, they also had a high number of closed triads (transitivity = 0. 81), indicating that the AUs that did get used, were used all together most of the time. This stood in contrast to 'happy' and 'contemptuous' faces, where only two AUs were strongly connected respectively, making strong triads unlikely. Again, 'fear' stood out by its low transitivity value, indicating that while many AUs can be active in this condition, they did not occur together, creating open triads. (d) Can we identify clusters of AUs without knowledge of the underlying conditions? Method While here we are working with a dataset where clear conditions are present in the form of seven stereotypical signals, this will not always be the case when using FACS: especially when working with non-human animals or large computercoded datasets of spontaneous signals, clear-cut categories might not be forthcoming.
In those cases, it would be useful if the connections between AUs could identify the underlying structure of the communication system. Here, we pretended that we did not know the underlying structure of the dataset, and used a community detection algorithm on the full dataset to detect clusters of AUs that cooccurred more than expected, to see whether we could identify the conditions. We used a weighted and undirected network (i. e. , connections between AUs are represented by how often they co-occur). We used the 'fast greedy' modularity optimisation algorithm for finding community structure implemented in igraph  (Clauset et al. , 2004) , which divides the network into communities based on modularity by assigning nodes to clusters that minimise the edges between clusters and maximise edges within clusters  (Newman & Girvan, 2004).
Thus, even without knowledge about the conditions underlying the facial signals, we would be able to detect that there is a highly stereotypical signal containing AU6 + 12. We would be able to distinguish between signals with lowered (AU4) Fig. 4  Network graphs for all seven conditions. Only significant connections are portrayed; thicker edges indicate higher probability of co-occurrence. Large points indicate AUs that are significantly more common than expected in this condition, small points indicate AUs that were observed but not significant, no point indicates that the AU was not observed in this condition and raised (AU1 + 2) eyebrows, which was a central distinction in this dataset. However, the results also demonstrate how the accuracy of this method relies on sufficient available data for all conditions.
Discussion In this article, we introduce network science as a tool for the analysis of facial signal data. The Facial Action Coding System (FACS) provides a way to study facial communication in immense detail, but the data it produces have many properties that make analysis difficult. As a result, the data generated from FACS measurement are often highly underused. Networks have been used widely in communication research in humans and animals  (Allen et al. , 2019; Kershenbaum et al. , 2016; Lynn et al. , 2020; Peng et al. , 2008; Weiss et al. , 2014) , due to their flexibility in answering various questions on the unit level, combination level, and the level of the whole communication system  (Lynn et al. , 2020; Newman, 2010). Here, we test their potential use for the study of facial signals, showing that they allow us to gain new insights even when applied to wellstudied datasets  (Lucey et al.
, 2012) , even though this is not a culturally universal feature  (Jack et al. , 2012). These differences can be replicated partially without knowledge of the original conditions, evidence for the ability of the network approach to recreate the structural features underlying large datasets with unknown properties. Looking beyond the use of single AUs, the network approach revealed that important information is contained in the combination of AUs and their conditional probabilities. For example, while both 'sadness' and 'surprise' show the use of AU1 and AU2, these were strongly linked in surprised faces, while AU2 is only sporadically used in sad faces. The Extended Cohn-Kanade Database  (Kanade et al. , 2000; Lucey et al. , 2010)  uses highly stereotypical signals, which is not representative of the expressivity and flexibility of human facial behaviour.
Larger, more diverse and naturalistic datasets would be needed to test whether the inclusion or exclusion of AUs and combinations represent inter-individual differences or affects the meaning of the signal  (Feldman-Barrett et al. , 2019; Julle-Danière et al. , 2020; Waller et al. , 2020). Networks can be tailored to answer different questions, but most studies will be interested in the same general patterns: which AUs are used more in some contexts than others, and how informative is their use? How do these AUs combine to form meaningful signals? Do all AUs in a context matter, or is there a core of highly specific units? Does the addition of some AUs change the meaning of a facial signal? How do inter-individual differences or other factors, such as culture, influence the use of facial signals? The NetFACS package allows users to answer these questions, and many others, in a standardised and statistically meaningful way.
, 2012; Weiss et al. , 2014). Dynamic networks and transition networks-between AUs and full signals-will be a central feature of future development of the NetFACS package. One question is sample size: the permutation and bootstrap approaches should be relatively robust, but datasets need to be representative of the complexity of facial signals in the context in question. The more varied signals in a context are, the more data will be necessary to accurately depict their probability space-especially for AU combinations beyond the dyadic (the focus here), and for dynamic signals. The other question is the validity of the AU coding-human coding is tedious and slow and often prevents the analysis of large-scale datasets, while automatic decoders still lack strong performance. However, the network approach potentially allows for the analysis of noisy data, as uncertainty of expected probability distributions is encoded and interpretable.
The code underlying the package is openly available, allowing users to develop their own algorithms for inclusion in future versions of the package. Importantly, the package is also of use to researchers studying other aspects of communication; the only requirement currently is that data can be coded as matrices of presence/absence of units at certain events. Units can be defined by the researcher as letters of the alphabet, syllables, words, or animal gestures or calls; as long as questions can be framed around the occurrence and cooccurrence of units, NetFACS can be used to conduct statistical analyses into the structure of the communication system. Facial signals are a vital aspect of the communication systems of many mammal species  (Waller & Micheletta, 2013) ; the development of Facial Action Coding Systems for different species has created the potential to directly compare the use of facial signals and the complexity and flexibility of facial communication with an evolutionary framework  (Waller et al.
We tested whether the speed and accuracy of a CNN are comparable to that of the frequently used OBITools bioinformatic pipeline. We applied the methodology on a massive eDNA dataset collected in Tropical South America (French Guiana), where freshwater fishes were targeted using a small region (60pb) of the 12S ribosomal RNA mitochondrial gene. We found that the taxonomic assignments from the CNN were comparable to those of OBITools, with high correlation levels and a similar match to the regional fish fauna. The CNN allowed the processing of raw fastq files at a rate of approximately 1 million se-quences per minute which was 150 times faster than with OBITools. Once trained, the application of CNN to new eDNA metabarcoding data can be automated, which promises fast and easy deployment on the cloud for future eDNA analyses.
2021). Taxonomic groups represent discrete classes that can be related to sequence features, including the composition and distribution of nucleobases within DNA sequences  (Helaly et al. 2019 , Busia et al. 2020). For example, k-mer summarises the counts of nucleotides within subsequences of length k and, in combination with machine classifications, have served for labelling sequences from bacteria, archaea, fungi and viruses  (Piro et al. 2020). The association between k-mer features and taxonomic classification can be trained in a neural network from a reference genetic database  (Piro et al. 2020) , to predict the label of any new sequence. Alternatively, Convolutional Neural Network (CNN) can self-learn a broader range of spatially organised DNA base-motif features existing in the DNA sequences  (Helaly et al.
2019). The neural structure subsets signal from restricted region of the input data known as the receptive field and can react to localized patterns in the sequence data. The numeric encoding of the four DNA bases allows the spatial placements of nucleotides to be interpreted by the CNN. In particular,  Busia et al. (2020)  developed a CNN, which trains a deep neural network to predict database-derived taxonomic labels directly from query sequences. Hence, preliminary use of machine learning with DNA sequence data shows their potential for taxonomic classification  (Busia et al. 2020 , Kopp et al. 2020) , but this method has been mainly used so far to label longer amplicons (16S gene, up to 250bp,  Busia et al. 2020). How it can be adapted for the taxonomic labelling of short sequence data from eDNA metabarcoding remains to be evaluated.
The most computationally costly step in the processing of eDNA metabarcoding is data cleaning  (Mathon et al. 2021) , and any computational gain from machine learning can only be reached if the CNN is robust to noisy sequencing data. Raw sequencing data can contain many errors including PCR substitutions or indel errors  (Schirmer et al. , 2015 , Schnell et al. , 2015 , Taberlet et al. , 2018). In existing eDNA bioinformatic pipelines the classification of DNA reads into taxonomic labels is applied after a long process of sequence processing and cleaning  (Mathon et al. 2021)  where only high quality reads are kept  (Boyer et al. 2016). Thus data augmentation by artificially introducing variation in sequences within the reference database has been proposed to build a more robust CNN  (Busia et al.
Here we evaluated the training of a CNN on a reference database of genetic sequences and its ability to rapidly and accurately process raw eDNA metabarcoding data. More precisely, we aim to adapt CNNs to the short sequences produced by eDNA metabarcoding and test whether accuracy and speed of CNNs are comparable to that of OBITools, a widely used bioinformatic pipeline  (Boyer et al. 2016). As a case study, we used one of the largest standardized eDNA data set currently available for fishes corresponding to a multi-year campaign effort to sample the tropical South American rivers of French Guiana  (Murienne et al. 2019 ). This eDNA data set is associated with a quasi-exhaustive reference database covering most of the known species of the region for the "teleo" region of the 12S rRNA mitochondrial gene  (Cilleros et al.
2019 , Coutant et al. 2020). The freshwater ecosystems of French Guiana are among the most species-diverse ecosystems for riverine fishes globally  (Albert & Reis 2011) , and among the least human impacted rivers on earth  (Su et al. 2021). A demonstration of a good performance in such diverse ecosystems would provide a robust test for application in other simpler ecosystems globally. Within this general processing framework and using this case study, we ask the following questions: (i) How does a CNN approach perform in the training of eDNA sequences classification for labels of the reference database; (ii) How robust is the classification of a CNN applied directly to the raw Illumina metabarcoding short sequences; (iii) How do a classical metabarcoding pipeline and our CNN approach compare with the pre-existing information about biodiversity composition within two river catchments with a long history of traditional sampling effort? Accurate performance of the CNN across all these steps would allow benchmarking the application of machine learning for the processing of Illumina sequence data and would open a major bottleneck in biodiversity analyses.
eDNA data collection and reference database As a test data set we used data collected in French Guiana, a c. 80,000 square kilometers South American territory almost entirely covered by dense primary forest (Supplementary Fig. 6 ). Equatorial climate associated with abundant rainfall created a dense hydrographic network made of six major watersheds and several coastal rivers that host a highly diverse fish fauna with at least 368 strictly freshwater fish species  (Le Bail et al. 2012). eDNA field collections have been initiated in 2014 and have continued until 2020. We sampled over 200 sites (see  Murienne et al. 2019 for detail) , where we filtered 30 liters of river water across a flow filtration capsule using a peristaltic pump. For the purpose of this study, we analyzed only the filters collected in the Maroni and Oyapock rivers.
The 12S rRNA "teleo" gene fragment  (Valentini et al. 2016 ) was amplified by PCR and sequenced on an Illumina platform generating an average of 500,000 paired-end sequence reads per sample. The DNA extraction, amplification and sequencing protocol are described in  Cantera et al. 2020. We generated an eDNA reference database by combining fish specimens caught using various fishing gears. These data were complemented by fish collections carried out by environmental management agencies (DGTM Guyane, Office de l'eau Guyane, Hydreco laboratory), fish hobbyists (Guyane Wild Fish), and Museum tissue collections (MHN Geneva). Although rare for Guianese fishes, existing sequence data from online databases (Genbank, Mitofish) were also included. We extracted and sequenced the 12S ribosomal gene on the species collected.
Sequences shorter than 20 bp were excluded using obigrep. Then we ran obiclean within each PCR product for clustering. We discarded all sequences labelled as 'internal' corresponding most likely to PCR substitutions and indel errors. Taxonomic assignment of the remaining sequences was performed using ecotag with the custom genetic reference database relevant for the eDNA samples. Finally we applied an empirical threshold to account for tag-jumps and spurious errors.
Reference data augmentation and training data set The reference database has a full species coverage but the number of DNA replicate sequences for each species is limited as there are only 683 sequences for 368 species. This makes training a CNN challenging for several reasons. The number of sequences per species is not balanced, there are not enough sequences to capture the entire inter-and intraspecific variation, and the noise from the sequencing process is not accounted for. To balance the data set using data augmentation procedures we over-sampled the underrepresented species before training. To increase the sequence variation, we implemented an inline sequence mutation step similar to  Busia et al. (2020). During each training epoch all sequences were randomly mutated. We added between zero and two random insertions and deletions each as well as noise in the form of a 5% mutation rate.
This procedure further reduces overfitting as no training sample is likely to be repeated twice. For the evaluations, we either added no augmentation or 2% noise and singular insertions and deletions as we expected the PCR amplification and sequencing to be better than the 5% noise considered during the training. For the direct application on the raw reads, another data transformation was required. All sequences processed in an Illumina machine retain the selected primers and were tagged with 8bp long tags. During the sequencing two bases from the plate attachment sequence were often read as well. We therefore preand appended the forward and reverse primers, and the combined tags and attachment bps to the sequences from the reference database. Specifically we added 10 bp of unknown bases to each reference sequence, represented by the IUPAC 'N' code.
CNN training and evaluation using split sampling We investigate the performance of a Convolutional Neural Network (CNN) approach trained on the reference database at the species level. To encode DNA sequence information, each canonical base (A, C, T, G) and IUPAC ambiguity codes are translated to an appropriate four-dimensional probability distribution over the four canonical bases (A, T, C, G) including uncertain base reads (e. g. W and S). For example 'A' becomes [1,0,0,0] or 'W' equals [0. 5, 0, 0, 0. 5]. The neural network was designed and optimized through a series of tests that allow for the optimal set of correct DNA features to be selected. In particular, we explored an exhaustive number of model sizes, including one to three layers of 2d (depth-wise) separable convolutions with 4-16 filters each, one to three fullyconnected layers with varying numbers of neurons each, and a softmax activated output layer which produces a probability distribution over all possible taxonomic labels.
We applied dropout regularization and used leaky rectified-linear activation for all but the last layers. We used TensorFlow  (Abadi et al. , 2015)  to train the CNNs with all the aforementioned data augmentations. Due to the sparse dataset, we characterized and evaluated the performance of the neural networks by using three different methods. First, we applied a cross-validation with random split-sampling from the reference database. This establishes a proper separation between the training and validation data, but less than half the species in the reference dataset have two or more sequences resulting in a reduced range of species to be included. Here only 156 out of 368 possess more than two unique sequences are were considered for the split dataset. Next, we trained several networks on the full reference data set with all 368 species and validated them on the original nonaugmented reference data.
CNN application on the raw illumina sequences We applied the best CNN directly on the raw outputs from the Illumina sequencing, where we omitted all the preprocessing steps from OBITools. The CNN was expected to learn how to ignore the primer as it is constant for all presented sequences. Furthermore, the output sequences from the Illumina sequencer were fixed in length (150bp) so we fixed the input width of the CNN to this size. We systematically zero-padded or truncated the input sequences to this length during training, evaluation, and application. After the training with the reference database and the application on fastq, we developed a custom code for the fast demultiplexing of the reads. By focusing on the tag information in the first few positions of the sequence and not considering read errors in tags, we reduced the demultiplexing to a few simple look-ups in a hash table (currently 5), therefore reducing computational time with limited information loss.
Validation with known biodiversity in the region The data synthesis across historical fish surveys yielded 351 species in the Maroni and Oyapock combined, among which 293 are present in the reference database and thus potentially detectable with eDNA. We used a threshold of 50 reads for a species to be considered as present in both pipelines. For both rivers combined, the CNN applied on raw reads assigned 319 species, among which 264 are known from historical records, while 55 were never recorded (Fig. 5a ). The CNN and OBITools detected 274 species in common, while the CNN retrieved 21 species known from historical surveys in these rivers that were not retrieved with OBITools, but identified 24 species not known from the synthesis nor identified by OBITools. The species detected only by the CNN belong mainly to the Loricariidae, Cichlidae, Characidae and Callichthyidae families.
Computation time For the CNN, we have to distinguish two computational efforts, which can be measured independently. First, training the networks needs to be performed once per reference database, and second, the application on field data. Training a network on the augmented and complete reference database currently takes around 10 minutes on an Nvidia Titan RTX GPU. Training a network on the clean reference database is faster and takes 6 minutes on the same GPU. The training and application time is dependent on the size of the input data and network size. Applying the network to field data processes around 1 million input sequences per minute compared to only 20'000 input sequences per minute for OBITools. A large part of the computational time for the OBITools pipeline is dedicated to the alignment (up to 80%) and demultiplexing (up to 15%) steps.
Discussion An emerging technical issue with eDNA application for biodiversity monitoring is that, as sequencing technology becomes cheaper and more affordable, the quantity of data to be processed induces a major computing bottleneck. Our study demonstrates the application of a Convolutional Neural Network (CNN) to process short eDNA sequence reads directly from raw sequencing Illumina outputs. In only a few minutes, the software can transform a raw fastq sequence data set in a species list associated with each eDNA sample collected in the field. The processing time of the CNN contrasts with standard bioinformatic pipelines, which can require significant computing time to process the raw reads into taxonomic lists  (Mathon et al. 2021). We further show that the CNN approach delivers species composition roughly comparable to OBITools, and historical knowledge.
While limitations remain in the first application presented here, future developments are likely to improve the speed and accuracy at which CNNs can translate raw metabarcoding data into taxonomic lists. As the coverage of the reference databases may improve in a near future  (Marques et al. 2020b) , CNNs could offer an efficient way to revisit stored metabarcoding data and increase biodiversity knowledge on previously sampled sites. Together, machine learning offers new possibilities for the taxonomic assignment of short DNA sequences and transform fast collected eDNA data into interpretable taxonomic-based indicators for the use of stakeholders  ( Cordier et al. 2020 , DiBattista et al. 2020 , Sepulveda et al. 2020). The CNN offers fast and accurate processing of a large number of sequences applied directly on the raw reads from the Illumina outputs.
2021). While offering results roughly comparable to those of OBITools, the CNN decreases the processing time of the whole dataset analysis by a factor of around 150. In a recent comparison, Barque (https://github. com/enormandeau/barque) combined with a fast demultiplexing module, allowed to proceed over 15Mio reads in 30 minutes, while it took 17 hours for OBITools V1  (Mathon et al. 2021). Assuming the same rate of our CNN of 1 Mio read per minute on this data set the application of the CNN would remain two times faster than the fastest existing bioinformatic pipeline in a single model  (Mathon et al. 2021). Our study presents a first successful adaption of CNN to the processing of eDNA metabarcoding data, but we foresee several avenues of optimization to gain speed and accuracy, making it a promising tool for scaling-up biodiversity inventories via eDNA  (Berry et al.