dataesr/scientific-paragraphs-categorization huggingface dataset:
Based on biologist expertise, the selected sections are representative of density and intensity variability of DAB-Ni NeuN staining. This ground-truth dataset was manually segmented by an image processing expert into four classes: stained tissue (neurons), unstained tissue, background (no tissue) and artifacts (non-specific staining concentration). Learning and test datasets were defined from the dataset according to three rules: (1) each dataset was extracted from middle sections in 3 subjects, (2) each dataset was extracted from the same anatomical regions and (3) each dataset was balanced through their number of images. Following these rules, balanced learning and test datasets were produced (512 × 512 pixels images). For the 9 years old macaque (NeuN_1), 54 and 46 sample images were respectively extracted for the learning and the test datasets (the entire datasets are represented in Fig.
5S ). For the last macaques (NeuN_2 and NeuN_3), 50 and 50 sample images were respectively extracted in two balanced datasets (a learning and a test datasets). The pooling of these three datasets is called NeuN_pool and is composed of 300 sample images. The brainstem of a 5 years old healthy male macaque was cut into 8 series of 40-µm-thick transversal Sections  32. One series of 60 sections was used for DAB anti-Phox2B labelling. This nuclear marker identifies neurons involved in vegetative functions and automatic breathing control  33, 34. All the sections were digitized using a WSI bright field virtual scanner (Scanner Aperio AT2, Leica biosystems), with a × 20 magnification factor (in-plane resolution of 0. 5 × 0. 5 µm). Each digitized slice weighed approximately 2 Gp (Fig. 1b ). Contrary to DAB-Ni NeuN staining, the DAB anti-Phox2B was nonspecific and neurons of interest were uncommon.
Manual segmentation was therefore difficult to perform as there were no existing atlas to guide neurons of interest localization and distribution  32. A ground-truth dataset was constructed by extracting 212 sample images (256 × 256 pixels) randomly selected in different regions of the brainstem. Several images were randomly picked on specific areas selected by a pathologist. Then a manual selection was performed on these images to keep the similar proportion of four classes between learning and test datasets. Sample images were manually segmented by a pathologist in four classes: neuron (specific anti-Phox2B staining), tissue (unstained tissue and non-specific staining), background (no tissue) and artifacts (non-specific staining concentration). The entire datasets are represented in Fig.
Furthermore it is one of the most used algorithms in the context of virtual microscopy  8, [44] [45] [46]. RF is composed of a set of fully grown decision trees which are trained based on a bootstrap of the training database and with a randomized vector of features. Each tree provides a classification decision and the majority of the decisions prevails. One of the main properties of RF algorithms is nonlinear boundary fitting, making it particularly relevant to detect specific against nonspecific staining. Weighted Random Forest (WRF) algorithm  47  uses weights to strengthen minority classes of interest in a strongly unbalanced dataset. The weights are adjusted independently from the training process. In the case of a minority class of interest, WRF offers a valuable alternative to RF. In the proposed study, WRF was implemented using Scikit-learn  48.
The selection was performed on a limited vector size as the first step (n > 2). This limit was determined after the first selection depending on the number of features previously selected. The selection was also performed in two-fold-cross-validation to verify the independence to the learning and validation datasets of the selected vector  25. If both vectors were unsimilar, the vector with the highest F-Score was therefore selected. Generalization step. Using the proposed strategy, a reduced and stable feature vector was selected for each stain. Subsequently, a whole high-resolution digitized organ (Part I) from each staining was segmented using both optimized subsets and WRF within a distributed CPU computation environment. For the macaque brains, only the first one was processed (NeuN_1).
L i represented the list of remaining combinations at iteration i. F i represented the feature with the lowest fMPV at iteration i. V i represented the feature vector at iteration i (for i = 0, V i is empty)  51. learning and testing datasets used for the WRF. Contrary to Falk et al. 11  , no data augmentation was used for this test to allow fair comparison with the same datasets. Direct and cross validation were performed. The results are presented in the next part. Computational environment. The WRF and feature selection codes were developed and integrated in the BrainVISA collaborative software platform (http:// brain visa. info)]  52  Software libraries enabling partial Input/ Output access and distributed CPU computation (somaWorkflow  53  ) allowed partial reading of large images, fitting the processed data to computational requirements of a HPC environment.
Using this framework, each histological section was processed in parallel, reducing the required processing time for pixel-by-pixel feature extraction and segmentation. The implementation of U-Net was realized with Tensorflow and Keras  54  , two Python API for DL algorithms. Computations of WRF and feature selection were performed on two different Information Technology (IT) infrastructures. A workstation with Ubuntu 14. 04 LTS 64-bits on Intel Xeon CPU E5-2630 v3 @ 2. 40 GHz × 16 (32 computing cores), 128 GB of Random Access Memory (RAM) and the supercomputer Irène of HPC infrastructure Très Grand Centre de Calcul (TGCC) of the french atomic commission CEA (http:// www-hpc. cea. fr/ en/ compl exe/ tgcc-Irene. htm). Irène has 1,656 computing nodes Intel Skylake @ 2. 7 GHz (AVX512) with 48 cores and 192 GB of RAM each.
Part II: Results Random forest segmentation. The NeuN datasets were segmented by WRF with the initial feature vector including 114 features (Fig. 5 ). F-Score values of 0. 88 were obtained in Direct Validation (DV) and 0. 89 in Cross Validation (CV) with 100 trees and a maximal depth of four. These scores corresponded to the highest quality of segmentation. Moreover the increase of maximal depth and weight of class "neuron" were tested and did not improve the segmentation quality (Fig. 6a ). The DAB anti-Phox2B datasets were first segmented with the same standard WRF settings used for NeuN without optimization. The F-Score values obtained for DAB anti-Phox2B in direct and cross validation were below 0. 5 (0. 49 in DV and 0. 42 in CV) for both, which is insufficient for a correct segmentation.
Feature family selection (Step 1). For NeuN staining, selected families were consistent between the two validation conditions (Table  3 ). Through the 4 datasets studied, 6 out of 10 families were identical between validation conditions and in the same relative order, which represented 21 individual features corresponding to 18. 42% of the initial feature set size. The families selected for NeuN_pool dataset were identical to families selected for NeuN_2. Moreover, LBP_11 and Var images were selected for the NeuN_pool dataset and this selection was shared for two thirds of the other datasets. Only LBP_40 and LBP_68 were not selected for the NeuN_pool dataset. Similar results were found for DAB anti-Phox2B staining (Table  4 ). Seven families were common between the two validation conditions which represented 24 individual features (21.
05% of the initial feature set size). Contrary to NeuN, the relative orders between direct and cross validation were not consistent. For both staining, the family selection led to a significant reduction of the number of individual features (approximately one fourth) allowing for a deeper Brute-force searching on the remaining features (increase of the vector size). Figure  11S     www. nature. com/scientificreports/ 20, 19 and 20 features. Therefore, the estimation presented in Fig. 11S  is an upper estimation for these datasets. With the same rationale as previously introduced, the vector size limit was extended to 4 for all datasets. Once feature families were selected for each staining, a second selection step was performed to extend the exploration of possible features combinations.
Individual feature selection (Step 2). The second Brute-Force search resulted in the evaluation of thousands of combinations (7,546 for NeuN_1, 6,195 for NeuN_2 and NeuN_pool and 5,035 for NeuN_3). After the first selection step, more than 99% of all combinations reached F-Score values higher than 0. 8 for all NeuN datasets (Fig. 7 ). This proportion represented a threefold average increase. For each dataset, the selected features were similar under DV and CV conditions at each iteration (Table  5 ). Among selected features, the real part of the Gabor filter with a wavelength of 20 pixels was selected in all selection processes and validation conditions. LBP and Variance images were selected in 3 out of 4 selection processes. For NeuN_1, NeuN_2 and NeuN_3, the selection diverged at the third iteration.
The mean final F-Score corresponded to 97% (NeuN_1), 99% (NeuN_2), 98% (NeuN_3) and 98% (NeuN_pool) of the F-Score resulting from the use of the initial 114-sized feature vector. The size of the selected feature vectors were 2 for NeuN_1, NeuN_2, NeuN_3 and 3 for NeuN_pool which is a reduction by a factor of 57 of the initial feature vector. LBP_68 was selected only with the NeuN_1 dataset. Therefore, the selected vector of NeuN_1 was not among the evaluated combinations derived from NeuN_pool. The F-Scores of selected vectors of NeuN_2 and NeuN_3 Table  4. Summary of the selected families for DAB anti-Phox2B. The feature families are ranked through their relevance (more precision in Supplementary Fig. 3 to 4 ). The nomenclature is presented in Material and Methods. were extracted in the Brute-force searching results of NeuN_pool (Fig.
8 ). Both extracted F-Scores were very close in the top 50% of NeuN_pool F-Scores. A total number of 6,903 combinations were evaluated on the second Brute-force search for the anti-Phox2B dataset. Before the first selection step, 81% of the combinations had a F-Score below 0. 1 (Fig. 9 ). This proportion was significantly reduced to 46% after the first selection step. Only 2. 2% of the combinations had an F-Score superior to 0. 4 and 36% after the second step. The second selection step improved the F-scores of the selected combinations (shift toward the right part of the distribution). The maximum values of the F-scores were increased from 0. 4 to 0. 6 between the two steps. For DAB anti-Phox2B, the first three features selected were consistent between the two validation conditions (Table  6 ).
The needed memory was dramatically reduced by a factor of 38 for NeuN_pool and 57 for the other datasets. Using a supercomputer (4,032 cores) with the optimized feature subset, the whole brain (5. 3 Tp) was processed 2. 5 h hours against 1. 5 estimated months without parallelization and feature selection (Table  7 ). Similarly, the memory needed for the whole brainstem stained anti-Phox2B (120 Gp) was reduced by a factor of 38 and the time consumption was reduced to several minutes against a year without the proposed selection method and parallelization. Comparison between WRF and U-Net results. The F-Scores obtained between the segmentation obtained with U-Net and WRF methods were very similar for both staining and conditions as seen in Table  8  (1. 2% differences in average for the optimized WRF).
Therefore, the F-Score differences between U-Net and the optimized WRF with feature selection are comparable with the F-Score differences between optimized WRF without selection. The learning curves for U-Net method are presented in Figs. 7S and 8S for both staining. For anti-Phox2B, the F-Scores remained under 0. 7. The learning time for each condition was around 45 min for NeuN_1 and 22 min for anti-Phox2B considering 1,000 epochs. The time differences were due to the difference in size of the two datasets: NeuN_1 datasets were twice the size of anti-Phox2B ones.
For the two stainings selected to test different organs from four healthy macaques (3 brains, 1 brainstem) and neuron staining specificity, the proposed methodology achieved a consistent selection between direct and cross validations. Among the four NeuN datasets, the proposed two-steps selection process allowed a consistent selection for each step and each validation condition. The segmentation quality of NeuN between U-Net and optimized WRF without selection was similar, justifying our choice to use WRF in this work. Then the proposed methodology allowed a massive reduction of computation time and memory cost with a small loss in segmentation quality compared with U-Net segmentation quality (Table  8 ). Therefore, the selected vectors were suited to perform exhaustive quantification on whole organs even for group studies.
Furthermore, the anti-Phox2B dataset could be pre-or post-processed. For example, the resulting segmentation would benefit from an enhancement of contrast, a color normalization as preprocessings  58. In addition, the result of the segmentation could be regularized using morphological mathematics operations or median filtering. Further work will consider the possible effect of pre-and post-processing on the selection and the overall quality of segmentation. Another possible lead is to enhance the number of features in the initial dataset or use data augmentation methodologies  59, 60. The extension of the learning datasets in both size and features promise further improvement of segmentation quality. Feature families were proposed to divide feature spaces into subparts presenting similar cardinality and to allow comparison of different types of features.
Feature families' selection showed that linear color spaces (RGB and XYZ) were the most descriptive color spaces for the NeuN dataset (Table  3 ) which is a staining highly specific (high contrast between stained and unstained tissue). L*a*b* was the least informative colorimetric color space. This result is consistent with instability of nonlinear color space at low saturation level  15. On the contrary, nonspecific staining anti-Phox2B benefited from nonlinear color spaces as shown in Table  4. Linear color spaces seemed suited for specific staining and nonlinear color spaces for unspecific staining. However, this observation must be confirmed with supplementary tests on other staining. For anti-Phox2B, b* is one of the most informative features selected as shown in the second selection step Table  6.
Both staining had an increase of F-Score with blue hues: B from RGB, b* from L*a*b* and Z from XYZ. Among primary colors, blue hue is the most discriminative for brown color  61. Therefore, the blue hue was discriminative for NeuN and anti-Phox2B (two brown stainings), which was coherent with previous works  62. Real parts of Gabor families were ranked in high position in our selection feature scheme for both staining and each dataset (Tables  3  and 4 ). Combined with its low computation complexity, Gabor filters appeared to be adapted to perform large image classification. LBP and Variance images had similar advantages. For both staining, both features were particularly adapted for the set goal of feature vector size minimization, reduction of computation time and size wise. As shown in Tables  5  and 6 , LBP and Variance images were indeed part of the stable feature subset for 4 out of 5 datasets.
In order to process other staining, they are relevant candidate features, providing a good compromise between robustness, computational complexity and cardinality. Although Haralick texture feature space is not suitable for Big Data applications due to its high computational complexity and cardinality, it was tested in our study to confirm its ability to reach the highest F-Score possible for both staining and each datasets. Moreover, we noticed that the quality of the segmentation improved when decreasing radius. Haralick with a 2. 5 µm radius for NeuN and anti-Phox2B datasets were the most compact of Haralick families in the best results, as shown in Supplementary Figs. 1, 2, 3, 4, 9 and 10. Texture close to the pixel scale (micro-texture) was more discriminative than texture at the neuron scale (macro-texture).
Edge detectors were not selected for NeuN_3 alone. However, the selected vector of NeuN_3 reached a mean F-Score superior to 0. 87 with only blob detectors which was the second highest F-Score through all selected vectors. For the other NeuN datasets, Mean image did not have a high fMPV and were discarded during the second selection step. As presented in Fig. 8 , the selected vectors were located in the best combinations of NeuN_pool. Solely relevant features were selected in the first step of the methodology as presented in Fig. 7. Therefore, all combinations provided F-Scores superior to 0. 8 which can explain the disparity in the final feature vectors through all NeuN datasets as multiple vectors fit the goal of the selection with similar performances. The anti-Phox2B selected feature vector was part of the top 14% of the combinations.
In each case, similar vectors were selected for a specific subject and, in the case of NeuN datasets, all selected vectors derived from similar features and were highly ranked with fMPV. Further studies will be conducted to extract relevant feature vectors on publicly available H&E databases such as TCGA  66. On a more general note, the proposed methodology is part of the Wrapper methods-selection process including learning and validation steps  67, 68  -and Brute-force searching is the weakest of all meta-heuristic. Consequently, the other meta-heuristic results can be compared to Brute-Force searching ones as reference to other FSA. Further research should lead us to benchmark our methodology with other feature selection methods such as correlation filters, join vectors, genetic algorithms, minimum-redundancy-maximum-relevance feature selection or PCA.
Introduction Bioimage informatics aims at bringing microscopy into quantitative biology, associating higher level information to pixels to answer complex biological questions. In particular machine learning based techniques  1  are easing the image analysis step, extracting geometrical objects from multidimensional images. But the next step, transforming that geometrical information into biological knowledge, involves a very diverse set of algorithmic tools in distinct communities, from spatial statistics  2, 3  to computational geometry  4, 5  or neuroinformatics  6. Similarly, the software ecosystem around geometrical data analysis is very diverse and heterogeneous, with reference algorithm implementation spread across languages (Spatstat  7  for spatial statistics in R, CGAL  8  for computational geometry in C++) or across module in python (scipy 9 for generic algorithms, anytree 10 for trees, trimesh  11  for meshes etc), a lack of generic geometric data exchange format and standard graphical tools like Fiji  12  and Icy 13 being limited in the flexibility of the analysis easily available.
To address this problem, we propose GeNePy3D  14, 15  , a python library meant as a 'middleware' library to facilitate building data analysis workflows for geometrical objects by providing one convenient API for geometrical data I/O, conversion and interaction between geometrical objects and access to many common and less common algorithm. We will introduce below the architecture of the library and show one example workflow, re-analysing a published dataset of zebrafish brain neuronal traces by combining traces and brain region to extract quantitative metrics per region.
Implementation GeNePy3D is implemented in Python, taking advantage of a high-level programming language with simple syntax and many open-source packages. We reused algorithms and functions available from various recognised packages when possible, and developed our own implementation when needed, within a unique interface. Most of the packages we link to are available from the Python package Index (PyPi) and can be easily installed via Python package manager (pip). Figure  1  lists out some functions with colors denoting the package used. Beyond standard ones, more specific ones includes AnyTree for tree manipulation, TriMesh for surface manipulation or ScikitLearn for machine learning tasks. Other feature are listed as optional, as they come from harder to install or less recognized.
Amendments from Version 1 Small updates to answer reviewer comments include removal of reference to 'large scale', a clarification of reasoning behind licensing choices and removal of mention of alignment algorithms. We also updated the title, to remove mention of large scale, and updated affiliation of one of the authors. Any further responses from the reviewers can be found at the end of the article sources, including the C++ library CGAL, only partially available in Python, for generic object interaction in 3D, or the optimal transport method implemented in PyEMD. Some original development available in GeNePy3d include an algorithm to compute local 3D scale we recently published  16. Many common input/output formats are supported including SWC for Tree, CSV, XYZ for Points/Curve and STL and OFF for Surface.
Use case To exemplify the use of GeNePy3D  14, 15  , we reanalyzed a recently published dataset containing up to 2000 traced neurons across the whole brain of larval zebrafish  17. The authors annotated 36 symmetric regions and established a connectivity atlas for the neurons within these regions. Figure  2A  illustrates a possible workflow using GeNePy3D for reanalyzing the dataset. The inputs consist of neuronal traces in SWC formats and a 3D volume in NRRD format containing different annotated labels for the 36 brain regions. The traces are imported into GeNePy3D under Tree objects, while the regions are reconstructed into Surface objects using marching cube algorithm. Figure  2B  top illustrates the outline of the Tectum along with all neuronal traces arriving to this brain region. We then extracted branching point positions from the neuronal traces (Tree→Points), decomposed them into sections (Tree→Curves) and checked whether the branching points or curve sections lies within or outside each region (interaction with Surface).
Conclusions The advent of machine learning and developments in biological imaging is leading to numerous geometrical datasets, and GeNePy3d 14,15 aims at enabling complex analysis workflows based on those objects. But as in other aspects of bioimage informatics, the key will be for the community to work together and define common formats and structures for region of interests and geometric objects to ease the interactions between the various visualisation, data management or analysis tools, and convert raw images to biological knowledge. GeNePy3d is ready to become a component of that ecosystem. Reviewer Expertise: Bioimage informatics, machine learning I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.