dataesr/scientific-paragraphs-categorization huggingface dataset:
40% versus 98. 49%). The mass accuracy depends only on peak detection, since no mass deviation was included in the simulation. Of note, the reported mass accuracy for PTRwid was computed before calibration: indeed, the masses from the simulated multiple peaks may not match with the internal chemical formula library used by PTRwid for calibration, especially for masses >300 Da (the mass accuracy for PTRwid after calibration was 20 ppm). Quantification was further evaluated on the peaks which were well detected by all software. The mean absolute percentage error between the estimated temporal evolution and the input of the simulation was 4. 96% for ptairMS and 14. 65% (respectively, 5. 38%) for PTRwid (respectively, IDA). Finally, we compared the ability to discriminate the compounds from exhaled breath and ambient air, based on two unilateral t-tests comparing the intensities in the two acquisition phases (see Section 2.
1. 3). ptairMS was shown to detect the expiration profiles with the highest sensitivity and specificity, with a global accuracy of 99% (compared to 87% and 95% for PTRwid and IDA; Table  2 ). As illustrated in Figure  3  on two simulated peaks with close m/z values, an exogenous VOC (i. e. with a constant profile) at m/z 82. 034 was erroneously classified as 'expiration' by PTRwid and IDA but not by ptairMS, as a result of a less precise temporal estimation of the two first software tools. Altogether, these results demonstrate that ptairMS is well suited for biomarker research by breath analysis.
Application to real datasets The ptairMS software has been designed for biomarker discovery in large clinical cohorts. First, it is fast (<1 min for a 3-5 min acquisition), and files can be processed with parallel computing and in a batch mode. Second, studies can be readily incremented with new files (e. g. if new patients are included): only the processing of these new files and the final alignment between samples are performed to update the peak table of the whole cohort. Third, the whole workflow can be run interactively through a graphical user interface, which provides visualizations (expiration phases, peaks in the raw data, peak table, individual VOCs), quality controls (calibration, resolution, peak shape and evolution of the reagent ions with time), and exploratory data analysis (Fig.
ambient air). For each metric, the best performance is shown in bold. a The reported mass accuracy for PTRwid was computed before calibration as explained in the text. conduct the analysis of clinical cohorts, with parallel file processing, incremental addition of new patient files, quality control of the acquisitions along clinical trials, alignment between the samples, and final statistical tests to discard exogenous VOCs. The full workflow was implemented in the R package ptairMS which is publicly available on the Bioconductor repository and includes a detailed tutorial. Raw files from two experimental datasets, as well as one simulated file, are provided in the companion ptairData package. The public availability of all data and source code will therefore be of high value for the reproducibility of the analyzes, and the benchmark of software tools  (Wilkinson et al.
Since the exhaled breath and ambient air have different concentrations of humidity, O 2 , and CO 2 , the direct subtraction should not therefore be considered as an absolute quantification, but rather as a relative concentration, which can be used to compare patients. To further compute accurate concentration differences between inspiratory and expiratory phases, adequate humidity-adapted calibrations are required  (Trefz et al. , 2018). Since the estimation of the temporal profiles is a key aspect of breath analysis, we have developed a 2D model based on P-spline regression. Compared to the existing software which are well suited for single-file, large data from environmental monitoring, we demonstrate that ptairMS is very convenient for breath analysis, achieving highest sensitivity and accurate quantification.
This enables to adapt the processing to specific instruments (e. g. with distinct resolutions) but also to various biological matrices (e. g. with different time profiles). As an example, ptairMS was used to process files from both PTR-TOF 8000 and PTR-Qi-TOF instruments (Ionicon Analytik). Files from other vendors (e. g. Tofwerk) should be processed accordingly, since they are in the same open source HDF5 format, which is a data storage format of choice within the MS community  (Askenazi et al. , 2017). Beyond exhaled breath, ptairMS was successfully applied to atmospheric air data (hospital room and corridor air), headspace analysis from mycobacteria (see the package tutorial) and truffles  (Vita et al. , 2015; Supplementary Fig. S5). A graphical interface was developed to facilitate data analysis and result interpretation by experimenters (e.
To achieve higher confidence levels of 2 or 1 for the most interesting VOCs, complementary experiments with hyphenated techniques such as GC-MS are required  (Ibrahim et al. , 2019; Nardi-Agmon et al. , 2016; Wilde et al. , 2019). Recently, ptairMS was successfully applied to intubated, mechanically ventilated patients, and enabled to discover a biomarker signature of four VOCs for the diagnosis of coronavirus disease-19 infection  (Grassin-Delyle et al. , 2021). In addition, it is routinely used for clinical trials in centers performing exhaled breath research, not only for online patient analysis, but also for the off-line analysis of breath collected in sampling bags, allowing the analysis of samples from multisite patients. Altogether, these results demonstrate the value of the ptairMS software as a key resource in breathomics for real-time analysis at the point of care and in biomarker discovery studies, with a high clinical potential for the phenotyping of health and disease, therapeutic drug monitoring, toxicological studies and precision medicine  (Fernandez del R ıo et al.
Acknowledgements We thank all the staff from the  Exhalomics platform (Foch Hospital, Suresnes ) for providing PTR-MS data. We thank  Pierrick Roger  and  Paul Zheng  for their help with the volatolomics database, the raw data format and the package design. We thank  Dr Phillip Trefz  for kindly providing acquisition files for the PTR-TOF-MS 8000 instrument. We also thanks  Dr Vincent Le Moine  and  Pr Jean-Louis Herrmann  for providing bacteria cultures.
Regarding the identification of defects, two parts are at play. The first part is a Deep Learning (DL) model that detects defects on inspection images, and infers a defect class from the features of the image. The DL model is built by STMicroelectronics and it is not the object of this work; the model is applied automatically on every inspection image, feeding an image database of currently ≈ 20 millions elements, this number continuously increasing. The second part corresponds to the search engine, RETINA, which operates on abstract vectors encoded by the DL model, called fingerprints or feature vectors. When a RETINA user searches for past images similar to the new one, the application actually looks for feature vectors that are ''close'' to that of the reference image in the feature space.
As the number of images in the historical database continually increases, search time becomes a key player in performing an efficient quality control task. The process described above is named as Content-based image retrieval (CBIR)  (Jenni et al. , 2015; Vita and Kamboj, 2016) , and the time to search is a known weak point of the technique  (Hameed et al. , 2021). This article aims to evaluate the impact of dimensionality reduction on retrieval performance, characterized by the time to search and the memory footprint, while maintaining high relevance of the results. A particular aspect of our situation is the rate of production of the images (and thus vectors). With thousands of inspections occurring every day from all fabs, there is no possibility for humans to manually assign a defect class to each and every image -an information that would be important to evaluate the relevance of search results before and after reducing the number of dimensions.
Instead, we ''trust'' the result of classification by the DL model in our evaluation of dimensionality reduction operators. The paper is organized as follows: in Section 2, we provide a summary of previous studies that applied the concept of dimensionality reduction to CBIR tasks. In Section 3, a detailed description of the problem is presented, and definitions are formulated. Section 4 corresponds to the Experimental Protocol where we present the dataset, the components of the experiment and the methodology applied to evaluate our assumptions. In Section 5, Results are presented analysing the choice of distance metrics and key parameters like the number of components. Conclusions are presented in Section 6.
Related work Many studies are exploring the possibility of reducing the dimensionality of feature vectors to alleviate pressure on CBIR systems. The selection below offers an overview of the directions taken by those studies. Some focus on benchmarking PCA, Isomap, LLE  (Cheng et al. , 2013 ) and other several supervised and unsupervised reduction algorithms on explicit visual characteristics of images, such as semantic features or colour histograms. Semantic features require substantial pre-processing of the images, based on human expertise. On the other hand, DL networks combine the pre-processing and the learning phases in one single step. Contrary to colour histograms, those DL features also encode visual patterns containing rich information. Other works aim to quantify the impact of a PCA transformation on feature vectors produced by a DL model  (Babenko et al.
, 2014; Fleet et al. , 2014; Yandex and Lempitsky, 2015). They explore different algorithms to produce those vectors from activations within the network. Babenko et al. Babenko et al. (2014)  prove the superiority of vectors output by a model that was trained on a specific dataset, over one that came pre-trained on generic image datasets. The works mentioned above are directed towards generic image retrieval, as shown by the datasets they founded their experiments on, e. g. ImageNet. It must be noted that the applications of deep-learning based CBIR is not limited to generic search engines. For example,  Arai et al. (2018)  use convolutional autoencoders to compress 3D brain MRI into compact vectors suitable for CBIR. Cao et al. (2018)  apply dimensionality reduction on feature vectors obtained from pictures of clothes, for e-commerce applications.
After training, any new image is feed-forwarded into the network, and the resulting activations form a vector that encodes the features of the image. In our case, the vectors are produced by a Residual network, namely a ResNet-18 network  (He et al. , 2016) , trained on historical inspection images, and are of dimension  = 512. The  images thus make up a matrix  of size  ×  , each row of which representing the fingerprint of an image from the database. Given a reference image of index  0 , the objective is to find the  closest rows in  (excluding  0 ), which optimize some metric. We allow  to be the Euclidian distance ( 2 , to be minimized), the inner-product pseudo-distance ( , to be maximized) or the cosine pseudo-distance (cos, to be maximized). Here we focus on the techniques that allow an improvement of search runtime and the memory footprint of the vectors containing the fingerprints 1.
Experimental protocol The context and challenge were stated in previous section. Here we focus on the description of the methodology that allows us to validate the following assumption: some dimensionality reduction is possible without sacrificing the relevance of the search results. We propose to run different dimensionality reduction algorithms on an extract of the total database. This allows us to obtain smaller vectors ( ′ between 10 and 510 components), then we analyze the ability of those reduced vectors to perform a similarity search, and evaluate the results. For this we will consider three similarity metrics:  2 ,  and cos.
Dataset Our database is composed of  = 27 695 Scanning Electronic Microscope (SEM) images extracted from a bigger database by STMicroelectronics. For each image we have computed the associated feature vector using the DL model above mentioned. Each image is tagged with a defect class, resulting from the classification by the DL model. The class is thus ultimately determined by the visual features of the image, as learnt by the neural network. For example, one class represents scratches on die surface, another one particles adhering to the surface, etc. (see Fig. 2 ). There are 10 classes, labelled  0 to  9 in the following. The images are not equally distributed among classes; the smallest class has 415 images while the biggest one has 5 555. Our experimental protocol ensures that all classes are equally sampled in each training set.
Evaluating the choice of the (pseudo-)distance metric While the (pseudo-)distance metric  is one attribute of the experiment among others, it plays a special role. In any typical application, it will be chosen by its ability to retrieve relevant results for the user, whether the search operates on full or reduced vectors. To avoid misinterpreting results based on irrelevant metrics, we first evaluate the 3 candidates  2 ,  and cos for themselves, using the defect classes. If () is the defect class associated with any vector  from the database, we define the accuracy of  for a reference vector  0 as: 𝑎𝑐𝑐𝑢𝑟𝑎𝑐𝑦(𝑑, 𝑖 0 ) = | | | { 𝑖 ∈ 𝐼, 𝐶(𝑖) = 𝐶(𝑖 0 ) } | | | 𝐾 where  is the set of image IDs retrieved by the search operation using  as the metric. The accuracy is a number between 0 and 1. 1 means that all neighbours retrieved by the search operation belong to the same class as  0 , that is, that the results are consistent with the classification by the DL network.
The role of training size |𝑇 | Results in Fig. 4  give an overview of how algorithms behave with respect to the training size | |. As SRP does not depend on | |, it is excluded from this discussion. For PCA  ((a)  and (e)), the size of the training set, | |, has little impact on the convergence of the recall. The PCA algorithm reaches a plateau at | | ≥ 250, where the overall distribution of the vectors is captured, and further training will not improve the results. In our dataset, 250 elements represent 1% of the database. For Isomap ((c), (g)), recalls appear to be increasing slowly with | |. For LLE  ((d)  We conclude that, as | | increases, more information from the statistical distribution of the feature vectors is captured by the PCA and Isomap algorithms than by Isomap and LLE. This is especially true with PCA, for which only a small number is needed.
The role of the algorithm 𝐴: PCA, srp, isomap and LLE We have discussed the behaviour of the four algorithms with varying training sizes, numbers of components and (pseudo-)distance metrics. Now we summarize those insights to guide the choice of the most appropriate algorithm for the application. First, we eliminate Isomap and LLE, since there is no situation where either of them is the best performer. The choice between PCA and SRP, the two remaining candidates, depends on the metric used. If, as in RETINA, the metric is not dictated by business considerations, then PCA with  2 is the best choice. Its average recall is always higher than for the other algorithms, and its distribution is tighter, with less severe outliers. Besides, for the smallest value of  ′ = 10 (a 88% reduction of the size of the database), the average recall of PCA is already around 70%.
Impact on memory footprint In order to quantify the gain in memory after reduction of the feature vector, we monitor the memory taken by the vector elements in computer memory. RETINA and the experiments are coded in Python, where vectors are represented as dense NumPy  (Harris et al. , 2020)  arrays whose elements are 4-byte floating point numbers (float32). The byte size of an array a can be obtained by using the sys. getsizeof(a) function call. The return value of the call is the total size occupied by the array, including its elements and the metadata maintained by NumPy's internal working. The relationship between the byte size of the full database against the number of components  ′ is linear, meaning that the array metadata is constant and independent of the shape of the array. The byte size is indeed given by the following formula:   = 110 780 ×  ′ + 120.
Impact on search runtime Concerning the search runtime, we measure the time to perform the nearest-neighbour search, with the function described in Section 4 (Algorithm 1). It is worth mentioning that we do not consider the time to apply trained algorithm  on evaluation vectors , or the database  -in RETINA, search acts on vectors that were previously reduced by an offline operation. The time measured reflects the minimal cost of a search in the conditions of our experiments, namely:  = 100 nearest neighbours of || = 100 evaluation vectors. With the aims to imitate the application in production, we did not follow the same experimental loop as in Algorithm 1. We applied the dimensionality reduction algorithms in a preliminary step, before running all the searches on already reduced vectors 4.
Memory and search runtime The initial memory size, corresponding to the raw vectors, was estimated as 38 GiB in Section 3. With  ′ = 32 and  = 2 × 10 6 , we obtain a revised size of 2. 4 GiB, to be compared with the initial 38 GiB of the raw vectors. This is a 16-fold improvement. Regarding the search time, whose measurements are sensitive to the infrastructure being used, we only report the theoretical improvement that would be observed on our test server (described in Section 5. 3). itself via their effect on the CPU caches. Those effects are not evaluated in this study. They could be avoided by loading the database into GPU memory, where calculations are fast and not impaired by the side activity of the CPU. 5 FAISS does not compute the square roots, the neighbours are actually searched by squared distances.
Acknowledgements The authors wish to thank  STMicroelectronics Rousset  for providing the images and the DL model used in this study, and for reviewing the work. This project has received funding from the  ECSEL Joint Undertaking (JU)  under grant agreement no. 826589. The JU receives support from the  European Union 's  Horizon 2020 research and innovation programme and Netherlands ,  Belgium, Germany, France, Italy, Austria, Hungary, Romania, Sweden , and Israel.
Eigenfaces In 1987, M. Kirby and L. Sirovich  [7, 8]  proposed the use of Karhunen-Loève transform to automatically learn important features for face recognition. The Karhunen-Loève transform, also called principal component analysis (PCA) in machine learning  [9, 10] , is a transform that learns automatically on an orthogonal basis widely used for dimensionality reduction. In 1991, M. Turk and A. Pentland  [11, 12]  developed a face recognition method called eigenfaces based on previously introduced works of Kirby and Sirovich. The selected eigenvectors learned by Karhunen-Loève transform are called eigenfaces. An example of eigenfaces learned on Yale Face dataset  [13, 14]  is provided in Figure  1. (Figure  1  (The eigenfaces are learned using the extended Yale Face database B  [13, 14] )).
Preprocessing The preprocessing is a step primordial for reducing non-informative variabilities (or factors of variation  [26] ) present in the signal. Indeed, RF eigenfingerprints are based on singular value decomposition (SVD), a linear algebra tool similar to PCA. As explained by Brunton in  [10] , SVD and PCA are really sensitive to variability. For example, in eigenfaces, misaligned face datasets (translation, rotation, etc. ) require more eigenfaces to learn the face variability than well-aligned face datasets. This feature explosion is due to the fact that PCA (or SVD) is not invariant to scale, translation, and rotation, among others. In the eigenfaces literature, this preprocessing is called data alignment  [10]. Thus, performing preprocessing on the received signal is paramount to eliminate non-informative source of variabilities such as signal delay or complex amplitude.
Impairments Simulation The first experiment consists of simulating a pool of wireless devices using an RF fingerprinting impairments model presented in Figure  5. This model is inspired by several models present in the literature  [25, 41, 42]. The parameters of the model are the following: • IQ offset (U is an uniform distribution): - A I ∼ U(-0. 01, 0. 01): Real part. - A Q ∼ U(-0. - K = 3. - a 1 = 1. - a 2 ∼ -U([-27dB, -33dB]). - a 3 ∼ -U([-45dB, -55dB]). This configuration corresponds to RF eigenfingerprints using preprocessing process n°1 (Figure  3 ). We simulate 10 different devices with 30 signals for each class. The preamble is a 250-sample QPSK signal with RRC shape filter (the filter is designed with Matlab function rcosdesign (0. 5, 4, 5)) with unit power (P s = 1). The signal-to-noise ratio (SNR) is fixed to 30 dB using additive white Gaussian complex noise (P n = 10 -3 ).
Real-World Performance Evaluation In this subsection, we present a real-world experiment showing the classification performances of the RF eigenfingerprints. For this experiment, we used four ADALM-Pluto software-defined radio (SDR) platforms from Analog Devices as emitter, with central frequency f 0 = 2. 45 GHz and sampling frequency F s = 5 Msps (the transmitted signal is a QPSK at 1 MBd with roll-factor β = 0. 5, thus the signal bandwidth is 1. 5 MHz. The authors choose these signal parameters according to WPAN IoT standards such as ZigBee, using VERT2450 antenna (Ettus Research). Concerning the receiver part, we used a BB60C I/Q signal recorder (the software used to record the signals is Spike from Signal Hound) with central frequency f 0 = 2. 45 GHz and frequency sampling F s = 5 Msps using VERT2450 antenna.
FPGA Implementation In this part, we provide an FPGA implementation of projection described by Equation (  7 ) using RF eigenfingeprints learned by classifier 2 and 3 in the previous section (N = 250, K = 7). This projection is implemented using Vivado High-Level Synthesis (HLS) for Xilinx Zedboard (Zynq-7000) at 80 MHz. Vivado HLS 2019. 2 is a high-level synthesis software that produces hardware description level (HDL) code using high-level synthesis language. For our implementation, the high-level language used is C++ and the hardware description level produced is VHDL. The pseudocode of projection implementation is presented in Algorithm 2. The input x ∈ C 250 is a complex array (in reality, a complex array is represented using two real arrays: one array for real part and one array for imaginary part) of 250 samples stored in block RAM (BRAM), and the output z ∈ C 7 is a complex array of seven coefficients stored in BRAM.
z (i) ← 0; end for i = 1 : N do // External projection loop y (i) ← x (i) -x (i) ; for j = 1 : K do // Internal projection loop (opti2 is here) z (j) ← z (j) + h * j,i y (i) ; end end The different implementation results ẑproj are compared with Matlab reference z proj result using mean square error (MSE) in percentage E = ẑprojz proj 2 / ẑproj 2. Using ap_fixed<16, 2> (arbitrary precision fixed point, 16 bits), the MSE error in percentage is 0. 6294%. Furthermore, different implementations depending on optimizations opti1 and opti2 are reported in Table  1. The most efficient implementation is apfixed162_v3 because it performed projection in 22. 03 µs and required less area (BRAM18K, DSP48E, FF, LUT) than apfixed162_v4. The projection implemented is 250 × 7 transform which requires a centering (250 × 1) using mean signal x and projection (250 × 7) using projection matrix U proj.