dataesr/scientific-paragraphs-categorization huggingface dataset:
The seeds were germinated in a commercial peat substrate Florentaise®TRH400 (Saint-Mars-du-Désert, France). The collection of plant material in this manuscript complies with relevant institutional, national, and international guidelines and can be obtained from various seed companies worldwide. The sampling of synchronized aphids was performed as described previously  [40] [41] [42]  to create a spectral signature database of the three aphid lines at 9 developmental stages: nymphs N1, N2, N3, N4 (1, 2, 5, 7 days old, respectively); wingless adults A9, A13, A15 (9, 13, 15 days old, respectively) during the reproductive period and A23 (23 days old) during the senescent period, and winged adults, AW (Figure  1 ). Finally, in order to test the detection program under challenging conditions, a group of A.
pisum LL01 (green) nymphs N1 (first instar) were placed on a V. faba leaf. The aphids used in this study are from parthenogenetic females from field-originated lines. The three aphid lines have different colors and sizes. This diversity provides a broad spectral database to develop an automated aphid detection program (Figure  1 ) Acyrthosiphon pisum lines LL01 (green) and YR2 (pink) were maintained on young broad bean plants (Vicia faba, L. cv. Aquadulce) and Rhopalosiphum padi line LR01 (black, two to three times smaller than A. pisum) on wheat seedlings (Triticum aestivum [L. ] cv. Orvantis) Aphids and their host plants have been reared in controlled conditions in a phytotron a 20 • C ± 1 • C and 60% RH ± 5% with a 16 h photoperiod. Organic seeds of V. faba and T. aestivum were supplied by Graines-Voltz® (Loire Authion, France) and Nature et Progrès® (Alès, France), respectively.
The seeds were germinated in a commercial peat substrate Florentaise® TRH400 (Saint-Mars-du-Désert France). The collection of plant material in this manuscript complies with relevant insti tutional, national, and international guidelines and can be obtained from various seed companies worldwide. The sampling of synchronized aphids was performed as described previously [40-42 to create a spectral signature database of the three aphid lines at 9 developmental stages nymphs N1, N2, N3, N4 (1, 2, 5, 7 days old, respectively); wingless adults A9, A13, A15 (9, 13, 15 days old, respectively) during the reproductive period and A23 (23 days old during the senescent period, and winged adults, AW (Figure  1 ). Finally, in order to test the detection program under challenging conditions, a group of A.
Image Acquisition Hyperspectral images of the three aphid lines at the nine developmental stages previously mentioned (three biological replicates each) were taken under two different conditions: aphids on a white neutral background or on their host plant leaf, providing over 160 images in total. All the images produced in this work are publicly available at Peignier et al. [44]. The images were acquired using a pushbroom HSI system (Figure  2a ) consisting of an HSI camera Specim FX10 and a halogen lighting mounted on a Specim LabScanner 40 × 20 cm (Specim, Spectral Imaging, Ltd. , Oulu, Finland). Specim's LUMO Scanner Software controls the HSI system on a computer. The camera has a visible NIR (VNIR) spectral range of 400-1000 nm and a mean spectral resolution of 5. 5 nm (224 bands). Thus, it is possible to place an aphid on the moving plate of the Labscanner, and record a hyperspectral image with a camera line of 1024 spatial pixels and a spectral data acquisition along this line with a maximum frame rate of 327 frames per second (fps) full-frame (Figure  2b ).
During hyperspectral measurements, the HSI system was placed in a controlled environment, in a black room with only LabScanner halogen lamps as the light source. It is possible to apply filters to reduce high levels of stochastic noise in hyperspectral images  [38]. However, it was not necessary for these images and, therefore, we kept all spectral data for further analysis. Each hyperspectral image was taken with two extra images for reflectance calibration, where the dark current reference was recorded by closing an internal camera shutter, and the white reference was recorded on a Teflon white calibration bar with standard reflectance of 99%. Then, we normalized the raw data using dark and white references to display light reflectance spectra between 0 (minimum reflectance) and 1 (maximum reflectance).
It is possible filters to reduce high levels of stochastic noise in hyperspectral images  [38]. Howev not necessary for these images and, therefore, we kept all spectral data for further Each hyperspectral image was taken with two extra images for reflectance cal where the dark current reference was recorded by closing an internal camera shu the white reference was recorded on a Teflon white calibration bar with standard re of 99%. Then, we normalized the raw data using dark and white references to disp reflectance spectra between 0 (minimum reflectance) and 1 (maximum reflectanc we knew that the reduction of spectral information can limit pest detection in environments  [36, 38] , we relied on full wavelengths light reflectance spectra to dev automated detection program based on three aphid lines with varying colors and.
Training Dataset Annotation The detection of aphids in hyperspectral images could have been framed as classification task. However, since the images were captured under controlled co examples corresponding to the negative class would not be representative of examples in real conditions. Therefore, we decided to frame the problem as a o classification task, which learns to identify aphids only from positive examples. such a classifier, we elaborated a one-class training dataset using principal com analysis (PCA)  [45]  and the K-means clustering algorithm  [46]. These techni.
Training Dataset Annotation The detection of aphids in hyperspectral images could have been framed as a binary classification task. However, since the images were captured under controlled conditions, examples corresponding to the negative class would not be representative of negative examples in real conditions. Therefore, we decided to frame the problem as a one-class classification task, which learns to identify aphids only from positive examples. To train such a classifier, we elaborated a one-class training dataset using principal component analysis (PCA)  [45]  and the K-means clustering algorithm  [46]. These techniques are traditionally known to perform reliably for labeling and classification of hyperspectral images  [30, 33, 36, 47]. Thus, in order to capture each aphid's spectrum, given its small size with respect to the entire image, we focused on the aphid's surrounding area.
Then, we applied a PCA on the zoomed image pixel spectra, computed the percentage of variance carried by each principal component (PC), and visualized the zoomed images projected on the most important PCs. These steps allowed us to select the number of PCs to be kept for the remaining steps. Afterward, we applied the K-means clustering algorithm to the pixels of the zoomed image, projected into the first PCs space, to capture a single cluster that gathered the aphid's pixels. The number of clusters was adjusted for each image. Finally, we computed the average spectrum of the pixels corresponding to the aphid's cluster and stored it in a positive examples dataset. To evaluate the method, we also collected negative examples from our controlled experiment. To do so, we removed the aphid's pixels from the entire image and ran a K-means clustering on the full image to extract 50 clusters that summarize the given image.
Then, the mean spectra of each cluster were stored in a negative example dataset. For further analysis, we also stored, for each aphid's spectrum, its corresponding line and stage. For the negative examples, we labeled the aphid's surrounding area cluster spectrum as either a leaf or a background. This computer-assisted hyperspectral image-training set annotation was achieved using a Jupyter Notebook script  [48] , relying on scikit-learn  [49] , Pandas  [50] , Numpy  [51] , Matplotlib  [52] , Seaborn  [53] , and Spectral  [54]  Python libraries. The notebook script for the training dataset annotation is available online in a dedicated GitLab repository https://gitlab. com/bf2i/ocsvm-hyperaphidvision (last updated on 22 March 2023).
More formally, let X = {x i ∈ X , ∀i ∈ {1, • • • , N}} be a dataset with N samples from a set X. In this article, each x ∈ X represents a reflection spectrum measured along D different wavelengths, and then X ∈ R D ; the training set X is composed of the average reflection spectrum of an aphid's pixels that were standardized to have zero mean and unit standard deviation. Let Φ : X → F be a function that maps the input space to a possibly infinite, feature space, such that for any pair of samples x i , x j ∈ X 2 , the dot product in space F can be computed using a kernel function K : X 2 → R + as Φ(x i ), Φ x j = K x i , x j. Then, as stated by Schölkopf et al. [55] , the algorithm aims to learn a maximum margin hyperplane to separate the positive examples dataset from the origin, by minimizing the objective function formalized in Equation (1).
In this work, we used the well-known radial basis function (RBF) kernel  [55]  K x i , x j = e -γ x i -x j 2 , with γ ∈ R + being a parameter of the RBF kernel. To tune the two major parameters of the algorithm, namely the trade-off parameter ν and the kernel parameter γ, we explored a large grid of pairs of parameters, as detailed in the dedicated section below. In practice, we used the One-Class SVM implementation available in the scikit-learn Python library  [49]. For the sake of reproducibility, the method's implementations, the training dataset, and the pre-trained model are available online in a dedicated GitLab repository https://gitlab. com/bf2i/ocsvm-hyperaphidvision (last updated on 22 March 2023).
Evaluation Procedure We assessed the performance of the One-Class SVM using a binary classification task evaluation protocol. Even though only positive examples, i. e. , aphid spectra, were used to train the algorithm, we used the negative samples collected from the hyperspectral images to evaluate the performance of the algorithm, as described above. Since 99% of the data samples belong to the negative class and only 1% to the positive aphid class, our learning task is under imbalanced conditions. Therefore, we chose standard evaluation measures for binary classification that are suitable under unbalanced conditions, namely the F 1 score, Recall, Precision, and the area under the Precision-Recall curve (AUPR), as formally defined in the appendix (Appendix A). Finally, we used a 10-fold stratified cross-validation procedure to compute such evaluation measures for different validation sets.
Among these techniques, LoG  [57]  is recognized as more accurate than DoG and DoH. Given an input image, this method applies a Gaussian kernel convolution with a standard deviation σ. Then, it applies the Laplacian operator on the convolved image, which results in strong positive (respectively, negative) outputs for dark (respectively, bright) blobs of radius r = √ 2σ; consequently, the coordinates of local optima in the LoG-transformed image are output as blob locations. In practice, we used the skimage. feature. blob_log function from the scikit-image Python library  [58]. This function applies the LoG method for a number num_sigma of successively increasing values for the Gaussian kernel standard deviation σ, between a minimal σ (min_sigma) and a maximal σ (max_sigma), in order to detect blobs with different sizes.
e. , D/4), i. e. , between their respective input and output layers, as suggested in  [61]. In both layers, the ReLU activation function was used. In practice, the scikit-learn  [49]  implementations were used for both methods. Since the training dataset (for each hyperspectral image) contains 1 aphid spectrum and 50 background spectra, the training dataset is strongly imbalanced. Then, in order to cope with this problem, we also applied two imbalance correction techniques from the imbalanced-learn Python library  [62] , namely the synthetic minority over-sampling technique (SMOTE)  [63]  and ClusterCentroids (CC), a prototype generation under-sampling technique based on K-means  [46]. In total, six alternative schemes were tested, combining RF and NN with SMOTE, CC, or no imbalance correction.
HSI Database and Dataset Analysis We first analyzed the spectral signatures of the different developmental stages within each aphid line, lying on a leaf or a white background (Figure  3a-c ). For each aphid line, the shape of spectral signatures of different developmental stages is rather similar, but some differences were observed in the overall level of light reflectance. The nymphal stages reflect more light than the adult stages. Moreover, winged adults tend to reflect more light than wingless ones. Between the two backgrounds, aphids reflect much more of the visible part of the light (400-700 nm) on a white background than on a leaf, with the latter potentially absorbing a part of the light transmitted by the aphid (Figure  3a-c ). In addition, the shapes of the spectral signatures of aphids laying on a white background or on a leaf are different, probably due to an interaction between aphids and leaves.
we included two hidden layers, so the NN would be able to represent an arbitrary decision boundary  [61]. We set the number of neurons in the first hidden layer to 224 neurons (i. e. , D/2) and the number of neurons in the second hidden layer to 112 neurons (i. e. , D/4), i. e. , between their respective input and output layers, as suggested in  [61]. In both layers, the ReLU activation function was used. In practice, the scikit-learn  [49]  implementations were used for both methods. Since the training dataset (for each hyperspectral image) contains 1 aphid spectrum and 50 background spectra, the training dataset is strongly imbalanced. Then, in order to cope with this problem, we also applied two imbalance correction techniques from the imbalanced-learn Python library  [62] , namely the synthetic minority over-sampling technique (SMOTE)  [63]  and ClusterCentroids (CC), a prototype generation under-sampling technique based on K-means  [46].
A. pisum LL01 aphids reflect the green light area (500-570 nm) while the A. pisum YR2 ones reflect the red-light area (600-700 nm) and R. padi reflects the visible parts of the light equally, which could be explained by their different colors. These specific reflectances are less obvious on a leaf background, but they are still visible, especially with the YR2 line, which reflects the red light area. Finally, the three aphid lines strongly reflect NIR, each in a different way, notably with a higher reflectance between 700 and 800 nm for the YR2 line. These different spectral signatures can, therefore, be used to potentially detect aphids on leaves with a One-Class SVM classifier. To this end, we applied a Z-score standardization of the spectral dataset (Figure  3d -f), which allowed to reduce the light reflectance differences between the different developmental stages and have a synthesis of the spectral signatures of aphids according to their lines and backgrounds used for the following One-Class SVM classification.
4 and 0. 49 corresponds to leaf spectra, and finally, the cluster with the lowest scores, mostly below 0. 1, corresponds to other spectra such as the background or other objects. Only two spectra from other objects and one leaf spectrum have a score higher than the One-Class SVM offset threshold (i. e. , 0. 495), while twelve aphid spectra were selected as support vectors to define the decision boundary. Figure  5b ,c depicts spectra having scores higher than 0. 1 in the two first PCA component planes, which capture 77. 48% of the dataset variance. Figure  5b  represents the scores assigned by the One-Class SVM, as well as the aphid spectra selected as support vectors. Figure  5c  represents a fine-grained provenance class for each spectrum, including leaves, other pixels such as the background, and the aphid type, whether it was on a leaf or a white background.
In addition, Figure  6a ,b, represents the standardized average top-scored spectra for each one of the previous classes, surrounded by a 68% confidence interval, respectively, on a white background or on a leaf. These results show that the background of the aphid has an important influence on the measures, as already suggested by the dataset analysis made in Figure  3. Indeed, the aphid spectra captured on leaves (Figure  6b ) have more similarities between them, and are more similar to the spectra of a leaf than the aphid spectra measured on a white background (Figure  6a ). Moreover, in the first two principal component planes (Figure  5c ), the separation between other kinds of pixels and aphid ones is better than the separation between aphids and leaves. However, despite the similarity between aphid and leaf spectra, the One-Class SVM algorithm successfully learned to distinguish aphids from such other classes as shown in Figure  5b.
However, its Recall = 0. 917 is sufficient to detect most of the positive examples in the dataset. In terms of F 1 scores, the different methods exhibit rather comparable results, only the RF•CC scheme depicts clearly lower results (i. e. , 0. 839). In terms of AUPR, all methods exhibit comparable and high-quality results. Finally, the One-Class SVM system clearly outperforms the other methods in terms of runtimes, as it is more than 100 times faster than the second fastest method, RF•CC. Despite the aforementioned differences, in terms of test quality scores, most schemes exhibit rather similar performances, which suggests that the training pipeline is underspecified  [64]. Underspecification is a common problem in machine learning pipelines  [64] ; models have similar results on the training/validation dataset but behave differently once deployed, often exhibiting instability and poor performance.
Discussion In this study, we provided a method to detect aphids on hyperspectral images based on a One-Class SVM. To do so, an essential step was the production of a large database composed of 160 hyperspectral images, including the three aphid lines, A. pisum LL01 (green), A. pisum YR2 (pink), and R. padi LR01 (black, 2 to 3 times smaller) at nine developmental stages with three biological replicates, in two different conditions: aphids on a neutral white background or on their host plant leaf. The dataset analysis first revealed that aphids at different developmental stages have overall the same spectral profile, but the nymphal stages reflected more light than adults, and winged adults reflected more light than wingless ones. Our hypothesis is that developing embryos and higher fat body content in the adult wingless morphs densify the aphids' body and increase their light absorption compared to nymphs, which have not yet developed embryos, or adult winged aphids, which contain very few embryos  [65].
Future research aimed at deploying such a system in the fields could include: (i) applying more sophisticated shape recognition to the One-Class SVM score image to count aphids in real conditions and (ii) acquiring a more complex training database that includes beneficial insects to avoid false positive detections. Here, we focused on optimizing the detection of various aphids on different backgrounds using full wavelength information. Our detection system displayed high accuracy and good speed. The speed of our detection system is fast enough to run periodic monitoring of fixed areas, such as identifying and counting insects on sticky traps  [24, 25]. However, to analyze a video stream on a robotic engine, further studies should be conducted in order to reduce runtimes  [68]. Future works could evaluate the possibility of reducing the selection of wavelengths to increase the detection speed  [36]  while maintaining high accuracy and good sensitivity in complex environments.
Conclusions In summary, this work collected the first aphid hyperspectral signature database in controlled conditions and used this information to develop an efficient automatic system for identifying, quantifying, and localizing the spatial distribution of aphids on leaf surfaces. Further studies to extend the database, improve shape recognition, and manage runtimes on moving robots could enhance the system's capabilities, making it beneficial for IPM and targeted treatments in the field. of true positive samples among the samples predicted as positive by the classifier, i. e. , Precision = TP FP+TP. A model exhibiting high Recall and low Precision tends to predict many samples as positive, including truly positive samples, but most of its predictions tend to be incorrect. Conversely, a model exhibiting high Precision and low Recall predicts few positive samples, but most of them are correctly predicted.
Data Availability Statement: All hyperspectral images produced in this work are publicly available at Peignier et al. [44]  https://doi. org/10. 15454/IS11ZH (last updated on 22 March 2023). For the sake of reproducibility, the method implementations, training dataset, and pre-trained model are available online in a dedicated GitLab repository https://gitlab. com/bf2i/ocsvm-hyperaphidvision (last updated on 22 March 2023).
Online content Any methods, additional references, Nature Portfolio reporting summaries, source data, extended data, supplementary information, acknowledgements, peer review information; details of author contributions and competing interests; and statements of data and code availability are available at https://doi. org/10. 1038/s41587-023-01893-7. Publisher's note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Open Access This article is licensed under a Creative Commons Attribution 4. 0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
2) controlled by µManager 2. 0 software. Although both illuminations were continuous, images were taken every 8-60 s (exposure times, 15-50 ms) with the 470-nm LED as excitation source and every 10 ms to 12 s (exposure times, 0. 5-15 ms) with the 488-nm laser diode. Data analysis. The images were first analyzed with Fiji to extract the photobleaching kinetics. The instant fluorescence was taken as the average over selected regions of interest (ROIs). The data were further analyzed in OriginPro 2015. Data measured on FP-labeled cells were background subtracted to remove the contribution from medium autofluorescence, and the fluorescence intensities of all cells were normalized to 1 at t = 0. ROIs in EGFP-PAA gel samples were chosen with same initial intensity values. Unless otherwise mentioned, the magnitude of the RP effect was quantified as the ratio of the areas under the photobleaching curves measured with and without NIR co-illumination.
The sample was excited at 470 nm and imaged in the green and red channels (ET525/36m (Chroma), resp. 628/32 BrightLine (Semrock)) so as to obtain the ratio of green intensity to red intensity as a function of temperature. The temperature of the heating stage was then set at 37 ± 0. 2 °C, and new green and red images were measured in the presence of the NIR beam (80-µm diameter, 1. 7 kW/cm 2 at 900 nm) to obtain a temperature map. The data were analyzed using Fiji and MATLAB. https://doi. org/10. 1038/s41587-023-01893-7.