dataesr/scientific-paragraphs-categorization huggingface dataset:
Faster R-CNN  [12]  further improves the first-stage frame by using region proposal network, and it became the baseline of later improvements, such as region-based fully convolutional network  [22]  and mask R-CNN  [15]. ML methods have been applied to various grain species. The availability of Global Wheat Head Detection dataset  [23, 24] , composed of 4,700 box-annotated red-green-blue (RGB) images of wheat field images collected over various different locations. The Global Wheat Head Detection attracted the attention of many ML researchers and practitioners in 2 competitions  [25, 26]. Most methods use existing detection models, such as the Yolo series, Faster R-CNN, and EfficientDet, while Khaki et al. [26]  modified Mobilenet  [27]  detection model to provide a lightweight network. Fourati et al.
In maize tassel counting, both regression-and detectionbased models have been applied, where together with various bounding-box-label-based detection models. Lu et al. propose TasselNet  [8]  and TasselNetV2  [9] , which applied CNN-based regression models to dot-annotated images to count maize tassels; additionally, they released the Maize Tassels Counting dataset, which is composed of 361 dot-annotated maize field images. A detailed comparison between bounding-box-based detection and dot-based regression was discussed in  [34]. Sorghum is another grain species that attracts ML methods for aerial RGB images, similar to the previous 2 grain types (wheat and maize). Guo et al. [35]  propose a framework to detect sorghum heads, which uses a decision tree-based image segmentation model to binarize the image into sorghum head and nonhead regions, followed by a quadratic support vector machine to classify the regions into heads and nonheads on the basis of geometric features of the segmented regions; the model was evaluated with an F1 score of 0.
92 and 0. 89 on 2 separate test sets, and the authors made the dataset publicly available which is composed of 1,440 annotated images of sorghum plots. Sarkar et al. [36]  successfully trained a RetinaNet  [37]  model to detect sorghum heads, and the model was evaluated on the dataset collected by Guo et al. [35]  with a mean average precision (mAP) of 0. 914 at 0. 5 IOU (intersection over union). Since sorghum has a relatively simpler head structure when compared with other grain crops such as wheat and maize (a single large head), it requires comparatively less effort to manually label the boundary of the head in images. Therefore, semantic segmentation methods have also been applied for detecting and counting sorghum heads. Lin et al. [38]  applied a U-Net  [13]  model for segmentation of sorghum head regions, followed by contour detection for separating instances of sorghum heads; the model achieved a mean absolute percent error of 0.
79 for counting sorghum heads on the  [35]  dataset. Besides sorghum, rice is another important grain species. Because of the irregular shape of the rice grains, most rice yield estimation methods were either based on time-series vegetation index  [43]  or further explored vegetation index feature points  [44]. There are few articles at present working on direct rice grain detection, which were based on segmentation and clustering methods  [45, 46]. Although these methods provide various models designed for crop panicle detection, which can be used in assisting grain yield estimation. There is no proposal for a standard pipeline that discusses an end-to-end solution, which outlines the procedure starting from data collection and preparation, to model inference and yield specific statistics calculation.
In this work, we propose a standardized pipeline to assist deep-learningbased yield and head density estimation for sorghum from RGB images collected via unmanned aerial vehicle (UAV). Our pipeline discusses data collection, data labeling, model training, augmentation techniques, model evaluation, and finally model testing on new field images, and deriving grain yield-related statistics from model inference. We present results from 2 experiments in this work. In the first experiment, we discuss a scenario where a pretrained model trained from a publicly available dataset does not work well for the target domain and provide a guideline for new training data preparation and model evaluation. In the second experiment, we consider a scenario where pretrained models work well for the new target domain, and we demonstrate how to derive head density estimation from the detection results.
Materials and Methods We aim to provide an end-to-end pipeline for applying a robust detection model on the field images to detect sorghum panicles, so as to estimate the head density across field accurately. To achieve this goal, we could either use publicly available training data or prepare a new dataset from scratch to train a model. In the first experiment, we discuss new dataset preparation. Where RGB images will be collected, preprocessed, and labeled, followed by training and validating the new model. Ground-level images are recommended for training the model because of its high adaptability. In the second experiment, we discuss when a suitable dataset is available and how it will be used in an ML pipeline to run inference on target field images and calculate head density-related statistics to assist yield estimation.
Image acquisition -Training data There are generally 2 types of RGB image datasets depending on the imaging devices, i. e. , ground images and UAV images, as shown in Fig. 1A  and B respectively. UAV images are normally captured on higher view (10 to 25 m) than ground images (1. 5 to 3 m), thereby having a higher coverage rate and are less time-consuming. However, there is difference between object scales and resolution between 2 imagery types. As shown in Fig. 2 , if the grain heads are rescaled into similar scale, UAV images (right-hand side) are blurry compared to ground-level images (left-hand side), where the axes show the original resolution pixels. Analysis of the different impact on detection model for maize was compared in  [47]. Similarly, we expect that, for other crop types, due to the loss of texture features, training on high-view blurry UAV images would not achieve as good performance as ground-level images.
Initial model The initial model was trained on an open-source sorghum dataset collected by Guo et al. [35]  (the dataset is described further in experiment 2, "Detection model training with data augmentation" section). Before training the initial model, the original images in the dataset were cropped into square patches along the length of the plot, using the resolution of the width of the plots. After cropping the images, the size of the dataset was 3,717 images, and there were on average 28 heads per image. These cropped images were used to train a "S" (small) version YoloV5 model  [10]  (https://github. com/ultralytics/yolov5), with the default yolov5 augmentation pipeline; this would be the initial model. A total of 3,567 images were used as training   Additionally, another model was trained, the "X" version of YoloV5 using the same dataset, which was used to automatically label the newly collected high-resolution dataset described in the previous section.
Image preprocessing and labeling -Training data In order to reduce the labeling effort, the images can be partially annotated using pretrained models. If there is no such pretrained model, this step is skipped and all heads need to be manually labeled. In this example, we used the initial model described in the previous section to prelabel the collected ground images. Figure  3B  shows the pretrained model predictions for the newly acquired sorghum imagery. From Fig. 3B , we can see that the sorghum model overestimates the number of heads present in the image. The sorghum model mistakes patches of ground as heads. This is due to the domain shift between the data collected in the field and the dataset used for training the initial model. The initial model was trained on images collected for mid-late flowering stage sorghum canopies via a UAV, while the new data was collected for early flowering stage sorghum canopies via a ground camera.
The labels and the images were imported to VGG Image annotator, which is an open-source image annotation tool, and the labels were manually corrected by removing false labels and adding missing ones. Finally, to obtain a consistent dataset, all images need to be regularized to a similar standard. One of the most important characteristics is object scale, i. e. , the size of grain heads in pixels. All images need to be rescaled on the basis of their different GSDs, to keep grain heads in a consistent scale. Therefore, all the images were rescaled to match the GSD (0. 25 cm per pixel) of the UAV test set (described in the "Initial model" section). Additionally, in order to reduce the edging distortion that is caused by the camera, all images were center cropped by removing 10% edges. Figure  7  provides an overview of data preparation, model training, and evaluation.
Image acquisition -Testing data The test set (UAV images) is composed of sorghum plot photos extracted from the raw imagery captured by the DJI Matrice 300 drone. The drone was flown at 20-m height, and the GSD for the raw imagery was 0. 25 cm per pixel. The plots were extracted from the raw imagery and then cropped into 360 by 360 pixel patches. The test set was composed of 97 plot patches that were manually labeled. Figure  5  shows the test set and train set image resolutions. It is worth noting that there is a considerable decrease in the spatial resolution of images when moving from ground to UAV images. As a result, physical presence of some heads in the images needed to be verified in the field, especially for the smaller heads, as shown in Fig. 6. Table  1  provides the raw image acquisition details for the experiment.
An overview of the pipeline The deep-learning pipeline is as illustrated in Fig. 8 , to train a model and test on any new coming fields. In order to maximize the model performance and robustness, augmentation methods would be applied before training (offline augmentation) or during training (online augmentation). The common augmentation methods were reviewed in  [49]. After data augmentation for the training sets, we train either a regression model (CSRnet  [7] , TasselNet  [8] ), or a detection model (YoloV5  [10] , EfficientDet  [11] , and Faster R-CNN  [12] ) for head counting. However, even with augmentations, the model performance often deteriorates when working in another dataset (domain) because of domain shifts between 2 datasets. Hence, domain adaptation methods could be applied in specific cases (especially when the target domain is significantly different from the available dataset in terms of image acquisition) to solve this problem  [29, 30].
Experiment materials Training data: The UQ dataset was collected by the UQ at the QDAF Hermitage Research Station near Warwick, Queensland, Australia (28. 21°S, 152. 10°E) and was all manually labeled and cross validated by the University of Tokyo  [35]. Most of the sorghum plants in the field were in the heading stage at the time of capture. The raw images were collected via a drone flying at 20-m altitude, with a commercial RGB camera with a native resolution of 5,472 × 3,648 pixels, which resulted in an  average GSD of 0. 45 cm per pixel. The raw images were stitched to construct an orthomosiac image of the field. The dataset is composed of images of pairs of plots extracted from the orthomosaic image, so the final resolution of the plot photos in the dataset is variable because of the plot extraction algorithm.
The height of the images approximately ranges between 1,100 and 1,600 pixels and the width of the images ranges between 300 and 500 pixels. There are 1,161 images in total, among which 1,000 images are used for training, while the rest are used for validation. Testing dataset: The test dataset was collected from an experimental trial located on an experimental farm at Jondaryan, Australia (27. 45°S, 151. 53°E), during the late flowering stage in February 2021, as shown in Fig. 9. Sorghum was sown at a planting density of 80 k/ha with a row spacing of 75 cm. The images were captured with DJI Phantom 4 Pro flown at an altitude of 22 m, at a native resolution of 5,472 x 3,648 pixels, resulting in an average GSD of 0. 60 cm per pixel. Table  2  provides the image acquisition details for training and testing data.
Here, we applied online augmentation with the following configuration: every image in a batch will be augmented with a probability of 0. 66. Every image selected for augmentation will be first augmented with 1 randomly chosen augmentation out of the aforementioned methods, followed by being augmented by the remaining augmentation methods with an independent probability of 0. 2. This configuration allows the model to be trained with a combination of original images, images augmented with multiple combinations. As discussed earlier, all dot-regression, object detection, and pixel-level semantic segmentation methods can be used in this case. Here, we consider 2 object detection methods, YoloV5 and Faster R-CNN. If the number of the training dataset is small or it is required to train the model quickly, YoloV5 is preferred.
Domain adaptation (optional): If the new domain is extremely different from the training set, e. g. , datasets of 2 different genotypes, the pretrained model may not perform well even after simple image processing techniques. Therefore, domain adaptation can be applied to improve detection performance, so as to facilitate later procedures. This extra domain adaptation method is unsupervised, i. e. , no extra labeling is required. Given training dataset as source domain and new field as target domain, source domain data are first transformed into target style with contrastive unpaired translation generative adversarial network  [33]  that is trained on unlabeled data from both domains, and then the original labels are corrected before being used for training a new detection model that adapts to target domain.
Model inference Here, we provide an example of deploying the pretrained model that is trained on an available sorghum dataset (transfer learning), i. e. , UQ dataset  [35] , on a new sorghum field. The deployment pipeline is shown in Fig. 10. After collecting UAV images in a new field, 10% edges of all images are removed before testing on the pretrained Faster R-CNN. The detection results are used as row detection input. The row detection method that we use here is RANdom SAmple Consensus (RANSAC). Row direction is a key indicator of accurate row detection, especially for scattered images. Therefore, running RANSAC on the densest part per image is performed before on the entire image to locate the dominant direction. Then, all detected rows are compared with the dominant direction, and the image is corrected to be horizontal, to construct the quasi-mosaic field image.
Finally, statistics, including imagewise and field-wise row/area density, are calculated on the basis of on each image or entire field. Grain head detection: Grain head detection is the most important step, as it highly influences later procedures. Besides an accurate detection model, it is also important to make test domain images to be similar to the training domain images. Firstly, to remove potential edge distortions, images of new fields are center cropped with removing 10% edges. Then, the image is rescaled to have similar GSD with the training dataset, so that it has similar head density per image, thereby maximizing the detector performance. If the image attributes of training set are different from the test set, i. e. , for testing images have higher resolution than training images, Gaussian blurring can be applied to the test set  [47].
Given that the Global Positioning System (GPS) location of each grid center (i,j) is L (i,j) , the location of each grid is within L (i,j) ± m x /2 from west to east and L (i,j) ± m y /2 from north to south. Therefore, the image that is closest to the grid center is selected to fill in the grid location and construct the quasimosaic field image. All the images are reoriented, by rotating them along the planting row direction (calculated in the previous step). Provided that the GPS location of each image selection L i,j and GSD G, field coverage of each image is known, the rotated images are cropped and plugged into their respective grid locations. Alternatively, if a more visually accurate and consistent representation of the field is required, mature structurefrom-motion-based photogrammetry software like Pix4D or Agisoft may be considered.
Experiment 1: Model training and evaluation for new dataset In this section, we train the model on the ground imagery that we collected and evaluate the model performance on UAV images. At the site, 164 ground images were collected to create the training set for the baseline model. Of these, 154 images were used for training, and 10 validation images were selected to sample the diversity of head size, color, and structure and were manually labeled (i. e. , edited after partial automatic labeling) as described in the materials and methods section "Image preprocessing and labeling -Training data". We rescaled the images in the new training dataset (ground images) to match the resolution of the test set. The test set (UAV images) is composed of sorghum plot photos extracted from the raw imagery captured by the DJI Matrice 300 drone, with a GSD of 0.
Experiment 2: Deep learning pipeline -Inference and statistics Various models are trained and tested on the available sorghum dataset  [35] , as shown in Table  3. As there are only bounding-box labels for the UQ dataset, the segmentation model is not included in the comparison and 1 representative model of each category is compared, i. e. , regression models: CSRnet, 1-stage detectors: YoloV5, and 2-stage detections: Faster R-CNN. According to the performance on the validation set, Faster R-CNN is selected to test on the new sorghum field dataset. It is observed that regression models have better accuracy than detectors. The error histograms of models are shown in Fig. 13. Both detection models are prone to under detect, while the regression model (CSRnet) is more balanced. Also, it is worth noting that if the detection models are to be deployed in a real time counting application, like counting from live video feeds, 1-stage detector models should be preferred over 2-stage detectors as they have fewer parameters to train, and faster inference time, Table  3  also compares the total number of trainable parameters for all models.
Discussion In this work, we introduce a comprehensive pipeline to apply deep-learning detection models for sorghum head counting, to assist grain yield estimation via RGB UAV images. Our work is complementary to existing literature for crop head detection. We take various real-world variables into consideration, including data preparation, model validation, inference, and deriving yield-specific metrics. We aimed to outline a practical and end to end pipeline from prototype to inference, for sorghum head detection. For training a suitable model for your target field, you can either collect your own dataset or you can start with a suitable public dataset. We consider both these scenarios in the 2 experiments presented in our paper. In our first experiment, we propose a pipeline for dataset preparation and model evaluation for a new target field.
We collect a dataset for a field with sorghum plants in the early stage of heading. Models trained on publicly available sorghum datasets, which focus on mid to late flowering sorghum plants, were not suitable for our target field. Therefore, we collected a new ground image dataset, followed by using a combination of semiautomatic and manual labeling to annotate the dataset. Finally, we adapt our ground image dataset to train a model to detect heads from UAV images. We train and validate our model only on ground images, and we evaluate our model on a separate test composed only of UAV images, in order to observe the generalization capability of the model. We found that the mAP of the model dropped from 0. 958 (when evaluated on ground images) to 0. 871 when evaluated on UAV images. The model performance dropped because of poor detection performance for small heads in the early stages of development.
(b) We propose a RANSAC model for row detection, which uses the head detection results identify planting rows, in order to analyse gaps between rows and variation in head density. (c) Heading density /m 2 head counts are visualized on a per-image basis and across field. Although our work tries to provide a comprehensive head number estimation pipeline from collecting data to final analysis visualization, it might still encounter additional problems. For instance, 1 limitation is that the RANSAC-based row detection method is fully contingent on the head detection results, which enlarges the error for row detection results. Later, it could be replaced with deep models of semantic row detection based on the raw images directly. In addition, research on semantic row detection will be conducted.
Acknowledgments We would like to express our thanks to  Dr. J. Eyre  from  Queensland Alliance for Agriculture and Food Innovation  and  Dr. J. Powell  from the  Univeristy of Queensland  for assisting us in collecting data from their experimental sorghum trial. Research in this project was supported by a co-investment of the Grains Research and Development Corporation engaging the institutes of the author team. Funding: This project was funded by the  Grains Research and Development Corporation (GRDC) of Australia   UOQ2002-08RTX  " High-throughput feature extraction from imagery to map spatial variability ".
0 eV step and 160 eV analyzer pass energy. The high-resolution regions were acquired with 0. 1 eV step (0. 05 eV for O 1s and C 1s) and 20 eV pass energy. A neutralizer was used to perform the recording to compensate charge effects. Curves were fitted using a Gaussian/Lorentzian (70/30) peak shape after Shirley's background subtraction and using CasaXPS software. The carbon C 1s is calibrated at 284. 8 ev for C-C and C-H bonds. Morphological characterization was studied by scanning electron microscope coupled with energy dispersive X-ray (SEM/EDX). The measurements of specific surface areas (SSA) and porosity were performed based on nitrogen adsorption-desorption volumetry at 77 K. Nitrogen adsorption-desorption isotherms were recorded on a Belsorp max II (MicrotracBEL Corp. ) which were equipped with a turbomolecular pumping unit which ensures a residual vacuum of 10 -5 Pa.
Data analysis 2. 4. 4. 1. Quality control. Analysis of adsorption kinetic and equilibrium was performed in 2 replicates and included blank samples represented OCP aqueous solution without the presence of a SM. Calibration of GC-MS system was performed daily before analysis of samples using analytical standards of individually dissolved OCPs in n-hexane. Samples were quantified using internal standard ( 13 C-labeled β-HCH). In addition, n-hexane was used as equipment blank and was introduced between two samples on the analytical tray to avoid crosscontamination.
Adsorption isotherms An adsorption isotherm is the relationship between the studied compound (here OCPs) in the liquid phase and the compound adsorbed on the surface of the adsorbent at equilibrium at constant temperature. Adsorption isotherms represented an experimental dataset based on the aqueous solution of the pesticide mixture with a concentration of 50 μg/ L, which interacted with different adsorbent doses (0. 1, 0. 4, 2. 0, 5. 0, 10 g/L) during 48 h. Experimental data were applied to Freundlich isotherm model and shown as logarithmic plots which were based on concentration of OCPs (C e ) versus adsorbed amount of OCPs (q e ) per gram of SM at equilibrium. These plots presented for 4,4-DDE and lindane (γ-HCH) as example in text below (Fig. 3  and Fig. 4 , respectively) and for other OCPs in supplementary materials (Fig.