dataesr/scientific-paragraphs-categorization huggingface dataset:
Before outputting the state predictions and visualizing the results, the zero-tip configurations are reedited back to their original state. To estimate the model parameters (q, the equilibrium frequencies with F81-like models, and j the transition/transversion ratio with the HKY model used in simulations), we compute the scenario likelihood using the standard pruning algorithm  (Felsenstein 1981) , and use the limited-memory bounded BFGS optimization routine to obtain ML estimates (L-BFGS-B  [Byrd et al. 1995; Zhu et al. 1997 ], available in Python SciPy library  [Oliphant 2007] ). This is achieved in two steps (both using the pruning and L-BFGS-B algorithms): first we obtain a rough estimate of q assuming a JC-like model, then we estimate all parameters together, starting from the previously estimated value of q and equal frequencies for all the states (and j ¼ 4 with HKY).
Moreover, the MAP state is always included in the set of states resulting from MPPA. For the rare cases ((1% in our simulations below) where the joint state is not included in MPPA state set, a program option adds it systematically to ensure that the joint (most likely) scenario is included in MPPA solution. SS k ¼ fi 1 ; i 2. i k g (k ¼ 1 to s).
For large trees with many state changes, even after compression the visualization might contain too many details. To address this issue, a program option makes it possible to specify the desired number of tips shown in the compressed tree (15 by default), which is then achieved by performing a relaxed horizontal merge and hiding less important nodes. In a relaxed horizontal merge, the definition of identical trees is updated: instead of requiring identical sizes of the corresponding nodes, we allow for nodes of sizes of the same order (log 10); for instance, now a node in state A of size 3 can correspond to a node in state A of any size between 1 and 9, and a node in state B of size 25 can correspond to a node in state B of any size between 10 and 99. If even after a relaxed horizontal merge the compressed representation contains too many details, we trim less important tips as follows.
Software and Utilities PastML takes as input a rooted tree and a tip state annotation table (for one or more characters). It produces a table with predicted ancestral states, and an interactively modifiable visualization (an html file that can be viewed in a browser). PastML is implemented in python 3, uses Scipy/Numpy  (Oliphant 2007)  for parameter optimization/estimation, and Cytoscape. js library  (Franz et al. 2016)  for tree visualization. An additional option performs an automatic upload of the full tree, annotated with ACR predictions, to iTOL, an interactive tool for tree management and visualization  (Letunic and Bork 2016). PastML is available as a python library/command-line program on pip3. We also provide a docker container that includes all the functionality and does not require installing python: evolbioinfo/pastml.
To ease the implementation, reproducibility and interpretation of the results, we used DNA and protein models, although the method and software are intended for unique characters. We generated 4-state data sets using Seq-Gen v1. 3. 2  (Rambaut and Grass 1997 ) and the HKY model  (Hasegawa et al. 1985)  with equilibrium frequencies of A, C, G, and T being equal to 0. 2, 0. 1, 0. 3, and 0. 4, respectively, and a transition/transversion ratio j of 8. 0. These relatively extreme values were chosen to challenge ACR when using the F81 model implemented in PastML. Likewise, we generated 20-state data sets using Seq-Gen and the JTT model  (Jones et al. 1992 ) with its default amino-acid equilibrium frequencies. We thusly obtained 16 (x values) Â 50 (1,000-tip trees) Â 50 (number of characters) Â 2 (4-state/20-state) data sets to assess the accuracy of ACR methods.
For this purpose, we generated five new DENV2 alignments, each by picking 356 sequences randomly with replacement from the original alignment. This way we obtained five randomized alignments of the same size as the original one, but with some sequences removed and some present multiple times, which in turn perturbed the numbers of samples per location. We then reconstructed the phylogeography of these five resampled data sets using RaxML and the same approach as for the original alignment. PastML results with the RAxML tree are shown in figure  4. The location of the root is unresolved between five regions: the Caribbean, Eastern Asia, Oceania, South America, and South-eastern Asia. Provided that the root represents the common ancestor of the sylvatic and endemic/epidemic strains (dated 1209 ), this result is not surprising.
PastML compressed scenarios for RAxML, FastTree, PhyML, and PhyML-collapsed trees are almost identical, with a few minor differences that can be mostly eliminated by resolving some unresolved nodes (supplementary fig. S6 , Supplementary Material online). This illustrates the robustness of PastML against phylogenetic uncertainty. The same holds regarding sampling variations: PastML ancestral scenarios with resampled data sets are very similar to the scenario inferred using the original alignment (supplementary fig. S7 , Supplementary Material online). Figure  4  shows the advantage of the approach, where uncertain inferences are not solved arbitrarily but made explicit. For example, the MAP and Joint inferences for the tree root are Eastern Asia and South-eastern Asia, respectively, whereas MPPA predicts five possible origins including both MAP and Joint predictions.
2000; Hemelaar 2012; Faria et al. 2014). We used a large data set of 3,619 HIV-1C pol sequences, obtained from  Jung et al. (2012) ,  Chevenet et al. (2013) , and the latest (2017) pol alignment of the Los Alamos HIV database. This data set is annotated with sampling dates and countries. We built a tree from the DNA sequences using PhyML  (Guindon et al. 2010) , and rooted it using non-C sequences. As in  Mourad et al. (2015) , we first computed the presence of the studied DRM in the sequences, thus obtaining the value of a 2-state character (sensitive/resistant) for every tree tip. Then, we used PastML with default options to reconstruct the ancestral resistance status of the tree nodes and root. We also performed analyses through time, to study the dynamics of DRM emergence, diffusion and reversion, and combined DRM analyses with phylogeography to reveal the spatial propagation of resistances.
Five of the most prevalent DRMs were analyzed. Results for M184V (the most prevalent DRM in our data set) and the combination with phylogeography for the largest resistance cluster are displayed in figure  5. M184V is a major The reconstruction was done by PastML with MPPA þ F81 option. For the timeline, the tree was pruned at each year to remove the tips sampled after that year. In the bottom left panel, M184V presence/absence is combined with location data: M184V state is shown color-coded in the left half of each node (green when mutation is absent, and orange for resistant strains), countries are color-coded in the right half of each node, and shown in the labels. Ishikawa et al. doi:10. 1093/molbev/msz131 MBE nonnucleoside RT inhibitor (NRTI) mutation selected in patients receiving Lamivudine (3TC) and Emtricitabine (FTC)  (Gallant 2006).
2015) : transmissions of DRMs within resistant clusters are then indirect, whereas a one-patient resistant node may correspond to a small resistance cluster, the root of which acquired the DRM. We analyzed the reconstructed transmission tree at different time points, each time pruning the tree to remove the tips and nodes sampled after the corresponding year. Figure  5  shows the results for 1996 (the sampling year corresponding to the first sequences with M184V in our data set), 2005 and 2015 (last sampling year in our data set). We see the emergence and growth of potential TDR clusters over time. In 2005, the main configurations included a major TDR cluster of 53 patients, and 76 cases of independent DRM emergence (ADR, i. e. , 1-patient node, or small resistant clusters of 2-3 patients).
Conclusions We presented a new, simple, and fast approach to reconstruct ancestral scenarios, deal with the uncertainty of ancestral inferences in the difficult regions of the tree (typically around the tree root), and visualize and edit interactively a treeshaped graphical representation of the most likely ancestral scenarios. The results obtained with the Dengue and a large HIV data sets are congruent with previous studies. Moreover, these results are robust against phylogenetic uncertainty and sampling variations. The method proposed here to account for uncertainties in ancestral inferences could easily be adapted to sequences and especially proteins, where its ability to provide an inventory of a limited number of alternative amino acids should be very useful to examine likely variants and determine the best candidate based on the structure and physicochemical properties.
HIV-1C Data and Analyses We used an HIV-1C pol sequence data set, previously used in  Jung et al. (2012) , and then (in a slightly updated version) in  Chevenet et al. (2013). We extended the latter alignment with HIV-1C pol sequences from the latest (2017) pol alignment in the Los Alamos HIV database (https://www. hiv. lanl. gov/content/index; Last accessed June 1, 2019), hence adding 583 sequences. Addition of the new sequences was performed using MAFFT multiple sequence alignment program with the -add option  (Katoh and Standley 2013). The final alignment contains 3,619 HIV-1C pol sequences, plus 35 outgroup reference sequences from the non-C subtypes. The data set is annotated with sampling dates and countries. We detected the Surveillance Drug Resistance Mutations  (Bennett et al. 2009 ), using the Sierra web service of the Stanford HIV drug resistance database  (Liu and Shafer 2006).
Acknowledgments Sincere thanks to  L. Blassel ,  S. Cosentino ,  S. Duchêne ,  F. Lemoine ,  M. Matsui ,  H. M enager ,  S. Mestack , and  K. Theys  for their help and comments. We also thank  Tal Pupko  and two anonymous reviewers for their suggestions to improve the first submitted manuscript. This work was supported by the  EU-H2020   Virogenesis  project (Grant No. 634650 , O. G. ), by the  INCEPTION  project ( PIA/ANR-16-CONV-0005 , A. Z. and O. G. ), and by  Postdoctoral Fellowship  and  KAKENHI 282725 (S. A. I. ) ,  16H06279  (W. I. ), and  16H06154  (W. I. ) from  Japan Society for the Promotion of Science.
, u(i -L + 2)) = (v(i), u L-1 ), is defined and with the Shannon entropy E(u L ) = -∑ L p(u L ) log p(u L ), CCE can also be described as: CCE v/u (L) = E(v(i), u L-1 ) -E(u L-1 ). ( 25 ) For a limited amount of samples, the approximation of CCE always decreases to zero while increasing L. To solve this problem, a modification has been introduced as: CCE v/u (L) = CCE v/u (L) + perc v/u (L) × E(v), (26) where perc v/u is the ratio of mixed patterns found only once over the total number of mixed patterns, CCE v/u (L) and E(v) are, respectively, the estimates of the CCE v/u (L) and E(v) based on the considered limited dataset. CCE can be defined as a measure of unpredictability of one signal when the second is observed because it quantifies the amount of information carried by one signal which cannot be derived from the other.
Convolutional neural networks (CNNs) have rapidly become the state-of-the-art models for image classification applications. They usually require large groundtruthed datasets for training. Here, we address object identification and recognition in the wild for infrared (IR) imaging in defense applications, where no such large-scale dataset is available. With a focus on robustness issues, especially viewpoint invariance, we introduce a compact and fully convolutional CNN architecture with global average pooling. We show that this model trained from realistic simulation datasets reaches a state-of-the-art performance compared with other CNNs with no data augmentation and fine-tuning steps. We also demonstrate a significant improvement in the robustness to viewpoint changes with respect to an operational support vector machine (SVM)-based scheme.
Introduction As shown on reference datasets such as ImageNet  [1] , convolutional neural networks (CNNs) have become the state-of-the-art approaches for object classification in images. With the introduction of networks capable of dealing with both detection and classification  [2] [3] [4] [5] , neural networks can provide an all-in-one solution for target detection and classification. However, there are still issues remaining such as the need for CNNs of very large groundtruthed datasets or classification failures that a human eye would not make  [6, 7]. In this study, we address target identification and recognition in defense application contexts, as encountered in synthetic aperture radar imaging, sonar imaging, or infrared imaging. In a defense context, no large-scale real datasets can generally be collected.
A schematic depicting the proposed approach for target identification and recognition: a convolutional neural network (CNN) model trained using simulated data (image generated with OKTAL-SE) and tested on real data (image extracted from SENSIAC database  [8] ). In this paper, to address target identification and recognition in infrared images, we propose a compact and fully convolutional neural network with global average pooling (GAP), referred to as cfCNN. The proposed architecture is tested against three separate datasets with increasing quality. Benchmarking experiments on real IR images patches demonstrate the relevance of the cfCNN with respect to state-of-the-art CNN architectures and an approach based on support vector machines (SVM). They stress the importance of realistic synthetic dataset.
Given the targeted operational contexts, we study the robustness of our cfCNN against possible perturbations introduced by the detection stage. To simulate such behaviour, we train our network on images with centred targets and test it on translated or scaled inputs. We compare the cfCNN performances against state-of-the-art CNN architecture and a SVM based approach. The results also highlight that Global Average Pooling improves robustness against disrupted inputs. The rest of the paper is organized as follows. Section 2 briefly reviews related works and the description of the problem. In Section 3, we describe the datasets of simulated and real data considered in this study. The proposed CNN architecture is presented in Section 4. Section 5 presents numerical experiments, and we further discuss our key contribution in Section 6.
Learning Strategies with Simulated Datasets In several applications and, more specifically, in a military context, only a limited amount of data is available, within which only a fraction might be fully or partially groundtruthed. For example, the target may not be identified but only labeled according to generic categories such as car, truck, etc. Advances in image simulation provide an alternative to the collection of representative image datasets as illustrated by Reference  [31]  for SAR imaging or the use of unsupervised learning strategies  [32] , transfer learning  [33] , and improved convolution layers  [34]. Such simulation-based strategies have been investigated for applications in optical imaging. For instance, in Reference  [35] , a robotic arm was trained in a simulated environment involving varied lighting and colour conditions before its deployment in real situations.
Simulated and Real Infrared Data As stated in the introduction, we address target recognition and identification on real MWIR images using CNN models trained with synthetic datasets. With the goal of evaluating how the quality of the simulation data affects the recognition and identification performances, we consider 3 different datasets, referred to as DS1, DS2, and DS3. All evaluations are carried out on a real dataset, referred to as DR. The simulation of an IR scene requires specific tools. The databases were created using OKTAL-SE. This software includes several modules allowing for the creation of multiple signatures for vehicles and the modification of atmospheric and shooting conditions. By combining the outputs of those modules, we can create a wide variety of realistic IR scenes.
As described in Figure  2 , the first step usually involves the creation of the vehicle signature using real video sequences or measurements. We then use a secondary toolset to update the signature based on the meteorological conditions and finally combine the results in a scene editor. During this final step, we can generate one or multiple databases entry using snapshots from a simulated IR sensor. DR contains 40,000 images extracted from infrared videos sequences. Each images has a size of 128 × 128 pixels. The targets available in DR are m1, m2, c1, c3, t1, and t3, meaning that no test examples will be available for classes c2 and t2. We may point out that the simulated datasets include, for each target, images simulated for varied camera viewpoints, target positions and orientations, target state (i.
Training Datasets From the simulation datasets described in the previous section, we build training datasets for target recognition and identification as follows. Each sample in datasets DS1, DS2, and DS3 is a 640 × 512 image along with the associated target type, position, and bounding box. This bounding box is generated during the simulation process. It takes into account the position of the target and the viewpoint. Consequently, it delimits perfectly the target within the image. As illustrated in Figure  3 , inputs for CNNs presented in the next Section are 128 × 128 image patches. For a given bounding box d x × d y , we consider a squared patch of size 1. 1 × max(d x , d y ) centered in the center of bounding box. Using a bilinear interpolation, we rescale this patch to a 128 × 128 patch.
Test Datasets Three datasets are used during the experiments. The first one corresponds to the real images in dataset DR with the original bounding boxes; thus, we keep the same name. The bounding boxes are manually drawn around the target. We use this dataset to benchmark CNN architectures when trained from datasets TRS1, TRS2, or TRS3. To evaluate the robustness of the proposed framework to target localization errors in the detection stage (i. e. , when the target is not centered in the patch image), we need all target information, especially the center of the target, to be precisely known which is not the case for real data. Therefore, we build other test datasets from simulation data. We consider TRS3 dataset, which is the most realistic simulation dataset and leads to the best reccognition performance when used as training dataset.
as shown in Section 5. 1. We proceed as follows to generate our test dataset, referred to as TTS. We build this dataset from the 4096 images randomly removed (see Section 3. 2) from dataset DS3. For a given translation direction, namely horizontal or vertical, we apply a translation of the bounding box, of which the magnitude is a predefined fraction of the dimension of the bounding box along the considered translation direction. We then proceed as described previously to extract 128 × 128 exemplars based on the initial bounding box parameters (i. e. , prior to translation). We apply this procedure both for vertical and horizontal directions. For the vertical axis, the direction UP refers to a translation of the bounding box towards the top of the image and DOWN refers to that towards the bottom of the image.
For the horizontal axis direction, LEFT refers to a translation of the bounding box to the left of the image and conversely for direction RIGHT. We report an example in Figure  4  for an upward translation with a factor of 0. 4. We create a dataset with exemplars for translation factors from 0. 1 to 0. 5 for all four directions. We create a dataset referred to as TSS to assess the robustness to scaling effects, typically related to changes in the shooting distance. Here, we rescale the bounding box with a factor ranging from 0. 5 to 1. 5, keeping the center of the bounding box unchanged, as shown in Figure  5. We may remind that the final patch datasets rescale the patches associated with the considered bounding boxes to 128 × 128 patches.
Performance Gains Using Improved Simulation We first evaluate the impact of using more accurate synthetic datasets during training to improve identification and recognition results on real images for each architecture. Table  2  shows the performance changes when training on TRS2 and TRS3 compared with the performance issued from a training on TRS1. The performance is assessed from the identification and recognition scores evaluated on dataset DR. For all networks and the SVM, we observe a better performance when improving the quality of the simulation data. Overall, the largest gains for the recognition score are obtained by Inception v3 (+25. 77%) and cfCNN (+17. 98%). When considering the identification scores, both versions of the cfCNN provide the highest results. The high gains observed for the cfCNN(fc) can be explained by very low identification and recognition scores on the DR dataset after a training phase on TRS1.
CNN Performance Comparison We further compare the different architectures using Reference  [30]  as a baseline in Table  3. Generic computer vision architectures, namely BCNN and Inception V3, do not bring improvement compared with Reference  [30] , except in terms of the recognition score when training on dataset TRS3 (resp. +3. 38% and +7. 82%). Interestingly, the proposed cfCNN reaches the best performance in all training configurations, and the performance gain increases with the quality of the simulation data (e. g. , from +11. 25% in the identification score when training on dataset TRS1 to +19. 54% when training on dataset TRS3). Improving the quality of the simulation has helped increase the recognition score of the SVM, up to 9% compared to Reference  [30]. However, its performance on the identification task is below that of Reference  [30].
The performance of the cfCNN(fc) compared to the cfCNN also highlights the benefits of GAP for transfer learning. Without GAP, the cfCNN(fc) managed to improve over Rodgers et al. , the BCNN, and Inception v3 only on TS3 with an identification score of 8. 10% and a recognition of 6. 35%. Despite this improvement, its performance is still below the cfCNN with GAP. One can also note that the cfCNN gives the best results for identification purposes. These performance improvements also support the usefulness of realistic simulation datasets for learning-based strategies. These results further emphasize that the cfCNN takes the greatest benefit from improved simulation data. As mentioned in Section 4. 1, we used the leaky ReLU nonlinearity. To illustrate this effect, we consider two architectures: A cfCNN with the ReLU activation and a standard cfCNN with the leaky ReLU activation.
Both networks were trained 10 times each on the TRS3 dataset and then tested on the DR dataset. When we compared the results form the best performing iteration of each network, we noted that the leaky-ReLU improved the performance of the cfCNN on the DR dataset. We reported a 4. 75% increase in the identification score and a 2. 87% in the recognition score. Additionally, the use of Leaky ReLu has allowed for a reduction of the standard deviation of identification and recognition results from each successive iteration from 8. 24% and 5. 23% respectively to 2. 82% and 1. 93% respectively.
Evaluation of the Robustness to Localization and Scaling Errors In this section, we evaluate the robustness of target identification models w. r. t. the target localization and scaling errors. We compare the proposed cfCNN to the three CNN architectures previously used in Section 5. 1. We also include in these experiments a SVM-based classifier, which is among the state-of-the-art shallow models for target classification in MIWR images. In the following, the training step is based on dataset TRS3. For the evaluation of the robustness to viewpoint changes, we consider the two test datasets described in Section 3. 3, namely.