dataesr/scientific-paragraphs-categorization huggingface dataset:
Our approach adopts the use of isolation forest as one of the base detectors in the ensemble technique with a focus on detecting local and contextual anomalies during crop harvest. Yield maps are crucial in farmers' decision making when it comes to precision farming, with many farmers having multiyear yield maps  [9]. The use of spatial-trend and temporalstability maps can give valuable information on the spatial and temporal variability of a field. In  [9] , a contour yield map was generated by interpolating the data into a regular grid using a Kriging  [10]  linear unbiased estimator. Classification management maps were generated which highlighted homogeneous zones that could be targets for investigation, or sections where inputs might need to be increased or reduced on the basis of yield performance.
Unsupervised anomaly-detection algorithms automatically identify deviating observations from unlabelled datasets, under some assumptions. Thus, model performance is determined by the different characteristics present in a dataset. Due to this specialisation of the models to different characteristics of observations and resulting in varying detection rates, it is a good idea to integrate the different detection abilities to produce a consensus judgement through the implementation of an ensemble. The combination of these individual abilities is more robust than relying on just one of them  [23]. It is also possible that some anomaly-detection algorithms succeed at detecting certain subspaces while others may present poor detection performance  [24] , although the former's total accuracy may be lower than that of the latter.
We propose the following contributions: 1. we present a detailed state of the art on anomaly-detection techniques with a focus on smart agriculture; 2. we propose a robust ensemble-based methodology for the detection of anomalies from data streams in smart agriculture context; 3. we apply the proposed technique to a data stream of combine-harvester GPS logs with the aim of identifying anomalies that impact harvest efficiency of farm machinery; and 4. we apply the proposed technique to crop data with the aim of identifying anomalies that reveal the state of the crop during harvest. This paper is structured as follows. Section 2 presents the temporal datasets corresponding to our two cases of study (the first for harvest GPS logs, the second for the crop-damage dataset) and the preprocessing steps.
Materials and Methods In this study, we investigate anomaly detection in two fronts: application to the GPS logs of combine harvesters and detection of crop damage in crop dataset. We used a GPS dataset  [28] , collected using Nexus 7 tablets on a farm in Colorado USA during the 2019 wheat-harvesting season. A GPS recorder application was kept running for each involved vehicle (combine harvesters, grain carts, and trucks) during harvesting. The combine harvester moved in a straight line at a near constant speed in a normal combine harvester operation (whether harvesting or traveling between fields). The sampling frequency of the data was 1 sample (GPS log) per second. In a typical harvesting scenario, there are more than one harvester working simultaneously in the field. This results in an overlap of the trajectories of the vehicles.
A single trajectory is considered as the consolidation of all collected GPS logs belonging to a single combine harvester. For the purpose of this study, we used the movement trajectory of a single combine harvester recorded over a period of three days. Definition 1. GPS log: Each GPS log l i is defined by < c id , t, x, y, s, b, a > where: Trajectory mining was performed using Quantum GIS (QGIS), an open-source crossplatform desktop geographic information system application that supports viewing, editing, and visualising geospatial data. The key focus was on data points generated in the field during harvesting; therefore, visualisation and map matching were conducted using QGIS to ensure that GPS points were mapped onto a field. The second step was to extract only those points within a specific field using a bounding box.
The extracted data exhibited normal harvesting behaviour with all data points below 4 mph, which is the maximal harvesting speed  [29]. The data were further processed by removing all data points with zero speed, since our interest was on GPS points associated to actual grain harvest. To create an evaluation dataset, anomalies were introduced in the original dataset by varying the vehicle speed at specific points along the trajectory, such that, for specific sections of the trajectory, a sequential number of points had their speed increased by a random number between a given range of values above 4 mph. Figure  2  presents the trajectory of a combine harvester after the introduction of anomalies, with normal points in green and anomalies in red. To visualise the effect of the introduced anomalies, outlier analysis was performed using box plots (as shown in Figure  3 ) that show the presence of outliers in speed and accuracy attributes.
Scenario B: Crop Dataset The second scenario considers anomalies in crop data, where the aim was to link the detected anomalies to the state of the crop at the end of the harvest season (i. e. , alive or damaged). The crop dataset  [30]  was collected by various farmers at the end of the harvest season spanning a period of three seasons. To simplify analysis, we assumed that all other factors such as variations in farming technique were controlled. This dataset has 10 variables as summarised in Table  1. In this study, we consider data for crop type zero (0), which we extracted from the global dataset. The first preprocessing step was to check for missing values in the data, which revealed 6397 missing values in the Number_Weeks_Used variable. The missing data are a result of farmers not recording data for the total number of weeks of pesticide use.
This indicates that the state of the crop at harvest time was greatly impacted by the presence and number of insects, the type of pesticides used to control these insects, and the duration of exposure to the pesticides. On the other hand, Number_weeks_used was positively correlated with Estimated_Insects_count and Pesticide_use_category. High negative correlation existed, where Number_weeks_Quit was negatively correlated with Pesticide_use_category and Number_weeks_used. Further analysis was also performed to establish the presence of outliers in the dataset. Figure  7  shows that, except for soil type and season, all other attributes had outliers.
Enhanced LSCP Algorithm (ELSCP) Locally selective combination in parallel outlier ensembles (LSCP)  [17]  is an unsupervised detector that defines a local region around a test instance by using the consensus of its nearest neighbours in randomly selected feature subspaces. The implementation of LSCP uses an average of maximum strategy where a homogeneous list of base detectors is fitted to the training data; then, pseudo-ground truth is generated for each instance by selecting the maximal outlier score. By training base detectors on the entire dataset and emphasising data locality during detector combination, LSCP examines both global and local data relationships. The process flow of LSCP is summarised in Figure  8. We propose ELSCP, which is an extension of LSCP with improvements on how the local-region definition is extracted, and competent detectors are selected.
In this study, we mitigate the masking effect by implementing minimum covariance determinant (MCD)  [35] , which is a very reliable estimate for multivariate anomaly identification as one of the base detectors in ELSCP. The determinant of a matrix and Mahalanobis distances are two multivariate feature statistics on which MCD relies. It searches the dataset for observations with the lowest possible determinant in the classical covariance matrix.
The higher the AUC-ROC is, the better the detection is. AUC-ROC is the most popular evaluation measure for unsupervised outlier-detection methods  [38]. AUCPR uses precision and recall. Precision is the fraction of retrieved instances that are relevant  [39]. Recall or sensitivity is the ability of a model to find all relevant cases within a dataset. The F1 score (F measure) is the weighted average of precision and recall, and considers both precision (P) and recall (R) rates: F1 = 2 * P * R P + R AUCPR is a very robust assessment measure that works well for a wide range of classification tasks. It is particularly useful when dealing with imbalanced data when the minority class is more significant, such as in anomaly detection. Therefore, for the purpose of this study, we evaluate the performance of anomaly-detection algorithms using these indicators.
Results In this section, we present obtained results by experimenting with anomaly-detection techniques on GPS logs and crop data. The algorithms were implemented in Python programming language by using the PyOD framework  [41]. Since ELSCP is an ensemble framework, and we used three base detectors in its implementation: HBOS, MCD, and IForest. The reason for using heterogeneous base detectors was to attain unbiased overall detection accuracy with little variance by incorporating the capabilities of different base detectors while carefully combining their outputs to form a robust detector. ELSCP performance ofwas also compared against state-of-the-art anomaly-detection techniques.
Scenario A: Combine Harvester GPS Data Preprocessed data were then applied to ELSCP, where the aim was to evaluate its performance by looking at the true-positive and false-positive rates by using a ROC curve. AUC-ROC was also computed as an evaluation measure of the model. The baseline AUC-ROC is usually set at a value of 0. 5 which suggests that the detector does not discriminate between normal and anomalous data, 0. 7 to 0. 8 is considered to be acceptable, 0. 8 to 0. 9 is considered to be excellent, and more than 0. 9 is considered to be outstanding  [42]. ELSCP was trained with 67% of the data, and prediction performance tested with 33% of the data. ELSCP achieved a global AUC-ROC value of 0. 998, which is outstanding performance (as shown in Figure  9 ). We also evaluated ELCSP performance in terms of precision and recall.
The baseline AUCPR for the dataset was 0. 0199 (based on a sample size of 51580 with 1026 true-positive anomalies). On the basis of obtained results, ELSCP achieved a global AUCPR of 0. 972, which is very good performance (as shown in Figure  10 ). In the second set of experiments, we identified the anomaly-detection algorithm that best estimated anomalous instances within GPS logs. We applied the data to ELSCP, baseline LSCP with variants of LOF as base detectors, LODA, COPOD, OCSVM, LOF, and CBLOF. Performance was evaluated by considering each detector's performance in terms of AUC-ROC, AUCPR, and F1 score. Obtained results from the experiments are summarised in Table  2. According to the results, our approach obtained the best scores with an AUC-ROC that was 6. 4% better than that of the second-best approach COPOD (99.
8% vs. 93. 4%); an AUCPR of 97. 2%, when the best scores of the other approaches (the one of OCSVM) were only 38. 5%. The F1 score reflected the same conclusion (92. 1% vs. 22. 8%). Therefore, our approach was clearly the best, and could help farmers in real time during harvest in detecting potential issues. Preprocessed data were then applied to ELSCP where the aim was to evaluate performance by looking at the true-positive and false-positive rates using a ROC curve. AUC-ROC was also computed as an evaluation measure of the model. In the unsupervised outlier-detection setting, it is often problematic to rigorously judge the effectiveness of the algorithms, especially when it outputs an outlier score that is converted into a label on the basis of a threshold. If the threshold selection is too restrictive (to minimise the number of declared outliers), then the algorithm misses true outlier points (false negatives).
On the other hand, too many false positives are generated if the algorithm declares too many data points as outliers. To deal with this issue, we performed threshold selection with the aim of the identifying the threshold on the ROC curve that resulted in the best balance between true-positive and false-positive rates for our imbalanced dataset. The Geometric mean (G-mean) was used to compute the optimal threshold, such that the best threshold was the one with the largest G-mean value. The slope of the ROC curve does not affect the performance of an algorithm, since ROC curves are used to make it easier to identify the best threshold from computed probabilities when making a decision on whether an instance is an anomaly or not. ELSCP was trained with 67% of the data, and prediction performance tested with 33% of the data.
The baseline area under the ROC curve is usually set at a value of 0. 5, which represents a random guess scenario where the detector does not discriminate between normal and anomalous data. Figure  11  represents the ROC curve showing the best threshold value for ELSCP model. ELSCP achieved 0. 641 AUC-ROC, G-mean value of 0. 605, and the best threshold ROC value of 0. 1404, which shows that it is able to detect anomalies resulting in crop damage. We also evaluated ELCSP performance in terms of precision and recall. The optimal threshold for the precision-recall curve, which focuses on the performance of a model on the positive (minority class/anomalies), was computed by optimising the F measure. The baseline AUCPR for the dataset was 0. 17 (based on a sample size of 63589 with 10811 true-positive anomalies).
On the basis of obtained results from the precision-recall curve, ELSCP achieved an AUCPR of 0. 277 with an F1 score of 0. 343 and the best threshold value of 0. 1404 (as shown in Figure  12 ). The obtained AUCPR value is acceptable since it is above the acceptable baseline for the crop dataset. The second phase of analysis determined if the detected anomalies were linked to the state of the crop being damaged at the end of the harvest season. We extracted all data that had been labelled as anomalies by the model and compared them to the actual ground truth. The model detected 6324 samples as anomalies, of which 1922 (30%) were actual anomalies that were linked to crop damage. In the dataset, the crop state at the end of the harvest could be categorised as alive, damaged due to other causes, or damaged due to pesticides.
On the basis of 30% of the actual anomalies, we categorised them according to the cause of damage, where we established that 1641 samples (85. 47%) were damage caused by other sources, and 281 samples (14. 62%) were damage as a result of pesticide use. The third phase identified the anomaly-detection algorithm that best estimated the anomalous instances within the crop dataset. We applied the data to ELSCP, baseline LSCP with variants of LOF as base detectors, LODA, COPOD, OCSVM, LOF, and CBLOF. Performance was evaluated by considering each detector's performance in terms of AUC-ROC, AUCPR, and F1 score. Obtained results from the experiments are summarised in Table  3. According to the results, our approach obtained competitive results where it came second to COPOD with an AUC-ROC margin of 5.
e. , the data comprise both normal and anomalous records, and algorithms should be able to distinguish between the two without any prior training. Unsupervised learning is highly preferred for real-life applications, especially in anomaly detection since there are many data without labels in this scenario. In this study, we performed unsupervised anomaly detection in obtained data streams from movement tracks of combine harvesters during wheat harvest, and data for crop damage recorded by farmers over a period of three harvest seasons. On the basis of our results, deviant combine-harvester behavior could be effectively detected by using machine learning. It was also possible to link anomalies extracted from multivariate analysis of various features to damaged crop state at the end of harvest.
Data Availability Statement: Publicly available datasets were analysed in this study. The first dataset (Combine Kart Truck GPS Data Archive) is openly available at https://purr. purdue. edu/ publications/3083/2 (accessed on 5 July 2021), reference number  [28]. The second dataset (AV JanataHack: Machine Learning in Agriculture) is openly available at https://www. kaggle. com/ shravankoninti/av-janatahack-machine-learning-in-agriculture (accessed on 5 July 2021).
Culture filtrates from these four strains were tested for the ability to kill aphids, but no aphid death was observed (data not shown) suggesting the action of killing was not solely due to a secreted product and required live cells. Putative identifications via 16S rRNA sequence analysis revealed that four bacteria (including PpR24) were Pseudomonads, four were Enterobacteriaceae closely related to Enterobacter and Pantoea and a single species belonged to the Acinetobacter group (Table  1 ). A phylogenetic analysis of the P. fluorescens species complex revealed the presence of two clades with at least five subgroups with strains previously classified as P. fluorescens, interspersed with strains classified in other species (Fig. S1 ). PpR24 was observed to reside in subclade 1 and to be closely related to P.
Bacterial strains were classed as pathogenic to the aphids if aphid death was triggered during the first 48h of observation. No death was observed in the control sachets. Further detailed assessment of aphid mortality on different aphid clones {insecticide-resistant (IR) and insecticide-susceptible (IS) listed in Table  S5}  with the six best aphid-killing bacteria was performed. We carried out the previously described aphid toxicity assay with infecting doses ranging from 10 7 to 10 2 CFU ml À1 for three days. Each bacterial treatment with different doses was replicated three times with 10-15 adult aphids per replicate over course of all experiments. Data obtained from these bioassays were used for determination of the LC 50 value of all aphid clones for their individual bacterial treatment.
PCR products were purified using the Genomic DNA Clean and Concentrator TM -25 kit (Zymo Research, Irvine, USA) according to manufacturer's instructions, and forward and reverse strands sequenced by Source BioScience UK Limited, Oxford. Sequences were aligned and the resulting consensus read compared with the 16S rDNA sequences in the National Center for Biotechnology Information (NCBI) database (http://www. ncbi. nlm. nih. gov/BLAST/) using Basic Local Alignment Search Tool (BLAST). Evolutionary relationships between Pseudomonas strain PpR24 and their closest genetically related species were investigated using a Multilocus sequence typing (MLST) approach developed by  Andreani et al. (2014)  to characterize the P. fluorescens group. The seven MLST loci sequences glnS, gyrB, ileS, nuoD, recA, rpoB and rpoD from 97 strains  (Andreani et al.
, 2014)  were downloaded from NCBI (January 2017), while those from genomes sequenced in this study were extracted by blasting the MLST sequences of the reference genome P. fluorescens A506 against the genomes. This dataset was enriched with the MLST sequences extracted from the 79 genomes of the P. fluorescens species and most related species gathered in the genetic cluster 2  (Monteil et al. , 2016)  in which all loci were detected (using a BLAST word size of 11 pb, a minimum sequence identity of 70% and alignment length of 50%). Gene sequences were aligned independently using MUSCLE and then concatenated into a single alignment of 3541 bp among which 1428 sites were polymorphic. A maximum likelihood (ML) tree was built with RAxML 8. 2. 6  (Stamatakis, 2014)  under the GAMMA model of rate heterogeneity using empirical nucleotide frequencies and the GTR nucleotide substitution model.
Acknowledgements AJH was funded by an  award  (project number  CP082 ) from The  Horticultural Development Company (now Agriculture and Horticulture Development Board ) to RWJ. FA was supported by an  ERASMUS  study abroad award. We thank  Neal Ward ,  Martin Emmett  and  Jon Knight  for invaluable guidance and industry support and  Vic Eastop  for guidance on plant species to target for bacterial isolation.
On this basis, the forecast results can be improved and the model can be optimised through parameter modification, improving the credibility of the prediction results. In this study, topsoil (0e20 cm) samples from the farmland in Zhejiang Province were collected in 2003 and 2013, respectively. The total concentration of Cd was obtained by acid digestion with HFeHNO 3 eHClO 4. To integrate the soil samples collected in 2003 and 2013, two points with separation distances of less than 300 m were considered to share the same soil pool. Based on this assumption, the study area was divided into grids, and the value of each grid was the average Cd concentration overlaid on the grid by the sampling points for each survey. After data matching, 413 grids were retained in the study area (Fig. 1 ).
Geostatistical and spatial autocorrelation analysis Geostatistics were first used in studies on the spatial variations of soil in the 1970s, and ordinary kriging is a representative geostatistical method  (Webster and Oliver, 2011) , which was developed for predicting the values of target variables at unvisited locations with data obtained from observation points  (Li and Heap, 2011). The ordinary kriging method considers the spatial positions of the observation and estimated points, and considers the relative positions of the observation points, thus, its interpolation effect is better than that of the IDW method with a small sample size. The IDW method is readily employed and more suitable for datasets that deviate significantly from normal distribution  (Hu et al. , 2017b; Jia et al. , 2020).
Data analysis and utilisation of the model In this study, the summary statistics were processed using R Studio software, while the global Moran's I index was computed in GeoDa 1. 12. 1. 59 (Anselin et al. , 2006). The map developed through ordinary kriging and IDW was produced in ArcGIS 10. 2 (ESRI Inc. , USA), and the parameter sensitivity analysis and optimisation were conducted in PEST  (Doherty, 2004). The model simulation based on the bagging algorithm was conducted using the bagging function of the ipred package in R Studio  (Peters et al. , 2002). The main steps of this study are presented in Fig. 4.
Limitations and perspectives Although we adopted several measures to reduce model uncertainty and bias, and improve the model performance, our study has several limitations. First, although we included as many main sources and outputs of Cd in agricultural soil as possible, not all sources and outputs of soil Cd could be included in our mass balance model. Therefore, some uncertainty remains in our prediction results. Second, limited by time, labour, economic costs, and equipment, the values of some parameters were obtained from similar previous studies. Third, although we collected over 20,000 soil samples from the study area, after data pre-processing, only 413 grids contained soil samples in both 2003 and 2013. Most of these soil grids were distributed in the central, northern, and eastern coastal regions of Zhejiang Province, which also negatively affected the results.
Acknowledgements This work was supported by the  National Key Research and Development Program of China  ( 2018YFC1800105 ), the  National Natural Science Foundation of China  ( 41771244 ), and the  Consulting Research Project of the Chinese Academy of Engineering  ( 2019-XZ-24 ). We acknowledge the support received by  Bifeng Hu  from the  China Scholarship Council  ( 201706320317 ) for three years of Ph. D. study in the  French National Institute for Agriculture, Food, and Environment (INRAE)  and  Orl eans University in France.