Mapping and Estimating Weeds in Cotton Using Unmanned Aerial Systems-Borne Imagery

: In recent years, Unmanned Aerial Systems (UAS) have emerged as an innovative technology to provide spatio-temporal information about weed species in crop ﬁelds. Such information is a critical input for any site-speciﬁc weed management program. A multi-rotor UAS (Phantom 4) equipped with an RGB sensor was used to collect imagery in three bands (Red, Green, and Blue; 0.8 cm / pixel resolution) with the objectives of (a) mapping weeds in cotton and (b) determining the relationship between image-based weed coverage and ground-based weed densities. For weed mapping, three di ﬀ erent weed density levels (high, medium, and low) were established for a mix of di ﬀ erent weed species, with three replications. To determine weed densities through ground truthing, ﬁve quadrats (1 m × 1 m) were laid out in each plot. The aerial imageries were preprocessed and subjected to Hough transformation to delineate cotton rows. Following the separation of inter-row vegetation from crop rows, a multi-level classiﬁcation coupled with machine learning algorithms were used to distinguish intra-row weeds from cotton. Overall, accuracy levels of 89.16%, 85.83%, and 83.33% and kappa values of 0.84, 0.79, and 0.75 were achieved for detecting weed occurrence in high, medium, and low density plots, respectively. Further, ground-truthing based overall weed density values were fairly correlated (r 2 = 0.80) with image-based weed coverage assessments. Among the speciﬁc weed species evaluated, Palmer amaranth ( Amaranthus palmeri S. Watson) showed the highest correlation (r 2 = 0.91) followed by red sprangletop ( Leptochloa mucronata Michx) (r 2 = 0.88). The results highlight the utility of UAS-borne RGB imagery for weed mapping and density estimation in cotton for precision weed management.


Introduction
Weeds are the major pests of agricultural crops and a serious challenge to sustainable crop production [1,2]. A site-specific approach, which takes into account the spatio-temporal variabilities in weed species establishment and growth, can facilitate effective and economical weed management [3,4]. However, such an approach requires precise determination of different weed species infesting crop fields and their densities. Currently, weed infestation assessments are carried out by managers typically through manual weed scouting, which is often inefficient and inaccurate particularly in large production fields. Remote sensing has long been investigated as an alternative approach for CNN-based studies for distinguishing between weeds and crops have been increasing in recent times. Bah et al. [40] used CNNs for detecting both intra-and inter-row weeds in spinach (Spinacia oleracea L.), beans (Phaseolus vulgaris L.), and beet (Beta vulgaris L.) in UAS-derived RGB images and achieved overall accuracies of 81%, 69%, and 93%, respectively. Using multispectral images, Sa et al. [30] developed a CNN-based model to segment crops and weeds from the soil background and achieved an overall accuracy of 82%. Several other studies have validated the effectiveness of CNN-based models; however, these models are data intensive and highly suffer from data inadequacy. For some cases, especially when dealing with binary problems such as the presence or absence of a weed, CNNs may not be necessary. Instead, adequate image analysis can be carried out using much simpler methods such as the object-based image analysis (OBIA) [39].
The OBIA allows for the generation of large number of image objects, which can be further classified into user-defined classes [41,42]. This approach was shown to be effective in mapping weeds in maize [26] and sunflower (Helianthus annuus L.) [28] when information such as crop row boundaries were fused with other set of features generated using OBIA. Such combined information would help segment inter-row weeds easily and minimize the misclassification instances during the classification process. However, the effectiveness of the fusion approach could differ with variable weed densities, which may lead to fuzzy boundaries between crop rows and proximal weeds. Furthermore, the false crop boundary delineation could result in classification errors as any vegetation pixels outside of the crop row is considered a weed, which may not be the case when crop leaves extend outside of the row.
It is important to investigate the effectiveness of the above-mentioned approach by testing it on areas with varying weed densities. Moreover, it is equally important to develop a post-classification model to refine the classification and minimize errors due to false crop row detection. In this study, an improved methodology that addresses these issues has been tested and demonstrated in cotton (Gossypium hirsutum L.), which is an important crop in Texas and parts of the Southern United States (US). The specific objectives of this study are to (1) test the effectiveness of the improved fusion method (OBIA and crop row detection) to map various densities of weed infestation in a cotton field using high resolution UAS-based RGB imagery, and (2) determine the relationship between weed pixel coverage and ground-based weed densities.

Study Site and Establishment
The study was conducted at the Texas A&M AgriLife Research farm near College Station, TX, US (30 • 32 15.75" N, 96 • 25 19.50" W; elevation: 68 m) ( Figure 1). The cotton crop was drill seeded in 1-m wide rows on 1 June 2017. Palmer amaranth (Amaranthus palmeri S. Watson) and red sprangletop (Leptochloa mucronata Michx) seed were broadcast planted with three different densities (low, medium, and high) (see Table 1) in 10 × 10 m plots within a 0.6 ha of field. Palmer amaranth is an annual plant native to the arid southwestern U.S. and northwestern Mexico and is one of the most problematic weeds in row crop production in the U.S. due to evolution of multiple herbicide resistance in this species [43]. Red sprangletop is an annual grass weed, widespread in the southern U.S. cultivated lands. Other weed species present in the experimental area, though in low frequencies, include morningglories (Ipomoea spp.), Texas millet (Urochloa texana Buckl.), and devil's claw (Proboscidea louisianica (Mill.) Thell.). Morningglory is a broadleaved, annual plant species with fast growth rates. Texas millet is an annual grass weed native to the southern U.S., and is a troublesome weed in row crops. Devil's claw is an annual broadleaved weed that is commonly found across the sandy, arid areas of west and south Texas. The study had three replications and were arranged in a randomized complete block design. The steps followed in image acquisition and weed mapping are summarized in the flowchart ( Figure 2).  The experimental field (0.6 ha) with spatial distribution of treatment plots representing low (green polygons), medium (blue), and high (red) weed densities. Yellow star within the density plots represent the location for experimental unit, which is a quadrat (1 m × 1 m) in our case. Each treatment plot has five experimental units. The experimental field (0.6 ha) with spatial distribution of treatment plots representing low (green polygons), medium (blue), and high (red) weed densities. Yellow star within the density plots represent the location for experimental unit, which is a quadrat (1 m × 1 m) in our case. Each treatment plot has five experimental units.

Data Collection
Multiple flights were conducted over the experimental area from May to July 2017; however, only the image acquired on 28 June 2017 was used for analysis in the current study due to high image quality in an early to mid-crop growth stage. The multi-rotor UAS Phantom 4 (DJI, China) equipped with a 12 MP on-board camera was used for capturing images in three bands (Red, Green, and Blue). Six ground control points (GCPs) were laid out throughout the study area for georeferencing the imagery, and global positioning system (GPS) coordinates were recorded for the GCPs using EMLID-GNSS receiver (EMLID Inc., Hong Kong, China). Three different radiometric calibration panels (white, gray, and black) were placed on the ground to enable radiometric calibration of the imagery during ortho-mosaicking process. Image data were collected at 15 m above ground level (AGL), with the auto-exposure mode, 70% side and front overlapping rates, and forward UAV speed of 3 m/s. The flight was performed in a sunny day with wind speed of approximately 11 km h −1 . A total of 464 images (.JPG format) were captured during the flight mission. The .JPG format was chosen over raw image format during image acquisition as the flight planner used in this study only supported the earlier format. Moreover, Pix4D Mapper, the software used for stitching the images, could not support the raw image format.
Ground truthing data on weed species density were documented at the time of flight operations. For each plot, five quadrats (1 m × 1 m) were laid out throughout the experimental area. For each quadrat, the number of individual plants per each species were counted and density m −2 were determined for comparing with image-based coverage area. Reflectance values for cotton and the weed species were recorded from the imagery to observe the spectral overlap ( Figure 3) and choose the appropriate techniques for further image processing.

Data Collection
Multiple flights were conducted over the experimental area from May to July 2017; however, only the image acquired on 28 June 2017 was used for analysis in the current study due to high image quality in an early to mid-crop growth stage. The multi-rotor UAS Phantom 4 (DJI, China) equipped with a 12 MP on-board camera was used for capturing images in three bands (Red, Green, and Blue). Six ground control points (GCPs) were laid out throughout the study area for georeferencing the imagery, and global positioning system (GPS) coordinates were recorded for the GCPs using EMLID-GNSS receiver (EMLID Inc., Hong Kong, China). Three different radiometric calibration panels (white, gray, and black) were placed on the ground to enable radiometric calibration of the imagery during ortho-mosaicking process. Image data were collected at 15 m above ground level (AGL), with the auto-exposure mode, 70% side and front overlapping rates, and forward UAV speed of 3 m/s. The flight was performed in a sunny day with wind speed of approximately 11 km h −1 . A total of 464 images (.JPG format) were captured during the flight mission. The .JPG format was chosen over raw image format during image acquisition as the flight planner used in this study only supported the earlier format. Moreover, Pix4D Mapper, the software used for stitching the images, could not support the raw image format.
Ground truthing data on weed species density were documented at the time of flight operations. For each plot, five quadrats (1 m × 1 m) were laid out throughout the experimental area. For each quadrat, the number of individual plants per each species were counted and density m −2 were determined for comparing with image-based coverage area. Reflectance values for cotton and the weed species were recorded from the imagery to observe the spectral overlap ( Figure 3) and choose the appropriate techniques for further image processing. AgriEngineering 2020, 3 FOR PEER REVIEW 6 Figure 3. Reflectance values for the three most dominant weed species in the experimental area, compared with cotton for red, green, and blue bands in the visual imagery.

Image Mosaicking and Radiometric Calibration
The images were mosaicked using the Pix4D Mapper software (Pix4D Inc., Lausanne, Switzerland) ( Figure 4a). The GPS coordinates for the GCPs were post corrected and used in the mosaicking process. Among the several templates available in Pix4D, the 'Ag RGB' template was chosen to process the imagery since this template is recommended for mosaicking RGB imagery (Pix4D manual). The key point image scale was set to 'Full' mode and minimum number of key point matching was set to '3' for the point cloud densification in the template. The resulting ortho-mosaic imagery ( Figure 4b) had a spatial and radiometric resolutions of 8 mm/pixel and 8 bits per pixel, respectively. .

Image Mosaicking and Radiometric Calibration
The images were mosaicked using the Pix4D Mapper software (Pix4D Inc., Lausanne, Switzerland) ( Figure 4a). The GPS coordinates for the GCPs were post corrected and used in the mosaicking process. Among the several templates available in Pix4D, the 'Ag RGB' template was chosen to process the imagery since this template is recommended for mosaicking RGB imagery (Pix4D manual). The key point image scale was set to 'Full' mode and minimum number of key point matching was set to '3' for the point cloud densification in the template. The resulting ortho-mosaic imagery ( Figure 4b) had a spatial and radiometric resolutions of 8 mm/pixel and 8 bits per pixel, respectively.

Image Mosaicking and Radiometric Calibration
The images were mosaicked using the Pix4D Mapper software (Pix4D Inc., Lausanne, Switzerland) ( Figure 4a). The GPS coordinates for the GCPs were post corrected and used in the mosaicking process. Among the several templates available in Pix4D, the 'Ag RGB' template was chosen to process the imagery since this template is recommended for mosaicking RGB imagery (Pix4D manual). The key point image scale was set to 'Full' mode and minimum number of key point matching was set to '3' for the point cloud densification in the template. The resulting ortho-mosaic imagery ( Figure 4b) had a spatial and radiometric resolutions of 8 mm/pixel and 8 bits per pixel, respectively.
.  with 300 DN values of a band as the X-variable and the reflectance values as the Y-variable belonging to the pixels in the spectral panel were prepared. Further, simple linear regression analyses were conducted to derive three separate regression models (Equations (1)-(3)) for predicting reflectance values using prepared datasets. The model was then applied to predict the values for all the pixels in red, blue, and green bands.
where (σ j ) r = predicted reflectance value of a jth pixel for the red band (σ j ) g = predicted reflectance value of a jth pixel for the green band (σ j ) b = predicted reflectance value of a jth pixel for the blue band (λ j ) r = DN value of a jth pixel for the red band (λ j ) g = DN value of a jth pixel for the green band (λ j ) b = DN value of a jth pixel for the blue band µ1, µ2 and µ3 are slope values for red, green, and blue band, respectively, whereas c1, c2, and c3 are constants for models for red, green, and blue band, respectively.

Image Preprocessing
Image preprocessing is an important step in image analysis and is required to prepare the image for further analysis. The experimental plots in the imagery were clipped into individual subsets and were subjected to further image processing. This process was completed in the following four steps:

Masking Non-Vegetative Area
In order to avoid potential misclassification of target objects with unnecessary objects, it is a good approach to mask the non-vegetative area upfront. For this purpose, excess green vegetation index (ExG) [44] was calculated using Equation (4).
where G, R, and B indicate green, red, and blue channel pixel values, respectively. The Otsu thresholding method [45] was applied to identify an optimal threshold for developing a binary classification: vegetation vs. non-vegetation (Figure 4c).

Canny Edge Filtering
The canny edge algorithm [46] was applied over the Otsu's binary imagery to obtain the edges of the crop rows. The algorithm requires the user to input values for two different hyper parameters called "minVal" and "maxVal". MinVal and maxVal represent the lower and upper limits of the intensity gradient range such that for any potential edge candidates to be regarded as true edge, the curve to which it belongs should lie either completely or partially above the upper limit within the user-defined range. Several sets of lower and upper values were tested in a trial and error mode until the best visual results were obtained. A median filter was applied over the edge imagery to remove edge noises and highlight crop rows (Figure 4d).

Hough Line Transformation
To minimize potential misclassification, the classification algorithm was applied only after separating inter-row weeds from cotton by detecting crop rows using one of the popular crop row detection method called Hough transformation [47]. This method determines positions of crop rows based on the parameters ρ and θ, where ρ is the perpendicular distance from the origin to the line and θ is the angle of perpendicular projection from the origin to the line, clockwise from the positive X-axis of the image space [47]. This method was implemented over the de-noised imagery using the "houghlineL" function in "OpenCV" package built in Python programming language to generate crop row lines (Figure 4e). The two hyper parameters for the function, ρ and θ, were chosen as 1000 and 0 • to 180 • respectively.

Generation of Crop-Row Strips
The row strip width (α) around each Hough line in each plot was determined using Equation (5), based on the width of cotton measured for 20 random plants within a plot.
where α denotes mean width, w represents the width of the cotton plant measured from a tip of a leaf on one side to a tip of a leaf on another side in the direction perpendicular to row axis for the ith plant (1 to 20). A particular width value was then used to generate crop-row strips for each of the rows in a plot.

Weed Detection and Regression
Following the establishment of row strips, the OBIA framework was implemented for both intraand inter-row weed detection using eCognition Developer software (Trimble Inc., Munich, Germany). The chessboard segmentation analysis was then carried out over each plot imagery to produce grids of 5 × 5 pixels, which represented 4 cm × 4 cm area on the ground. Any grids pertaining to vegetation outside of the Hough transformation-derived strips ( Figure 4f) were classified as inter-row weeds. After assigning the inter-row weeds, the next step was to classify the grids within a strip into cotton and intra-row weeds, as grids pertaining to soil/shadows had already been masked during image preprocessing steps. For this purpose, the Random Forest (RF) method [48], a non-parametric ensemble learning method, was used. This classifier creates a set of decision trees from a randomly selected subset of training dataset, which then aggregates the votes from different decision trees to decide the final class of the test object. The outcome in each decision tree is determined based on information gain, gain ratio, and Gini index [48] for each attribute or feature. This classifier requires two hyper parameters 'ntree' (the number of decision trees to be formed during the decision process) and 'mtry' (the number of features to be used in the node for a decision tree) to be set by the user; in this study, 'ntree' and 'mtry' were set to '500' and 'the square root of total number of image features used in the classification', respectively. A total of 18 grey level co-occurrence matrix (GLCM)-based textural features [49] and five spectral features were constructed for clipped imageries ( Table 2). A balanced sample size of 600 for each class (cotton and weed species) were selected randomly from the grid objects resulting from the chessboard segmentation to train the RF classifier. In addition, 200 samples for each class (cotton, weeds, and soil/shadows) were used for validation of mapping in each density treatments. Prior to the training process, it was necessary to discard the non-important features to optimize the computation cost and time. The "varImp.randomForest" function in "Caret" package in R programming language (R Foundation for Statistical Computing, Vienna, Austria) was used to compute the importance index for the features constructed in the study. The function uses the RF classifier-based wrapper selection method to calculate accuracy of each decision tree using out-of-bag samples for a given feature. The decrease in accuracy of decision tree when a feature is substituted with another feature is averaged across all the decision trees to calculate mean decrease in accuracy, which is further rescaled to 1-100 and termed as important index. In general, higher the mean decrease in accuracy for a feature, higher the important index and better the feature. In this study, the features with index value greater than 50 in the scale of 1-100 were chosen, which includes two spectral features (red band and ExG) and four textural features (GLCM_Homogeneity for green band, GLCM_Contrast for green and red band, and GLCM_Entropy for red band). In certain cases, leaves of inter-row weeds overlapped with that of cotton within the strip and could not be classified using the standard approach. In such cases, an iterative feature ratio rule was used to re-label the mis-labeled vegetation as weeds using Equation (6).
where ϕ(x) is the rule to assign the specific grid (j) as weed (1) or non-weed (0), ExG ij represents the ratio of ExG value of the grid for weeds immediately outside the row strip (i) to that of the grid immediately inside the row strip (j). Two model accuracy measures, namely overall accuracy (OA) and kappa values (K), were calculated. The OA is calculated using Equation (7) as the number of correctly classified grid objects over the total number of validation samples.
where A, E, and I are the number of validation samples accurately classified as crop, weed, and soil/shadows, respectively; D and G are the number of crop samples that were inaccurately classified as weed and soil/shadow, respectively; B and H are the number of weed samples that were inaccurately classified as crop and soil/shadow; C and E are the number of soil/shadow samples that were inaccurately classified as crop and weed, respectively. The Kappa value is a measure of deviation from the outcome by chance. The value ranges from 0 to 1, with 0 indicating no agreement and 1 indicating full agreement between the observed and predicted values. The mathematical formula for computing kappa values was derived from Cohen [50].
Following the generation of classification maps, the shapefiles for weed classes were extracted from the maps and loaded to the ArcMap software (ESRI Inc., Redlands, CA, USA). The area of all the shapefiles belonging to a particular quadrat (1 m × 1 m) was calculated, divided by the area of the quadrat, and recorded as image-derived weed coverage (%). A simple linear regression analysis was subsequently conducted in the R statistical software (R core team 2013) using the ground-based weed density (m −2 ) dataset as the Y-variable and the image-derived weed coverage (%) dataset as the X-variable. In addition to the model for combined weed species in the quadrats, two separate individual models for two most dominant species in the experimental area, Palmer amaranth and red sprangletop were developed. For this purpose, quadrats (9 for Palmer amaranth and 11 for red sprangletop) that had >80% infestation of either species in the field were selected across the experimental area.
The whole data processing tasks were performed using a computer with a relatively high processing power comprising of Intel ® core™ i7-5960X 3.00 gigahertz (GHz) central processing unit, 64 gigabytes of random-access memory (RAM), and 64-bit operating system. The data processing tasks, including image mosaicking, calibration, preprocessing, and weed detection and regression for all the density treatment plots takes approximately 2 h and 30 min. This includes only the time required for running the python scripts/software for corresponding data processing tasks and does not include the time associated with the preparation of necessary data for tasks such as image calibration, and training and validation of the classifier. The image mosaicking process consumed the majority of the time (approx. 70%), whereas the image preprocessing step required the least time (5%).

Weed Mapping
The classification techniques used in the current study was effective in mapping the distribution of weeds in cotton with reasonably high accuracy levels. An overall accuracy (OA) of 89.16%, 85.83%, and 83.33% and kappa (K) value of 0.84, 0.79, or 0.75 were observed for low, medium, or high-density plots, respectively ( Figure 5). The generally high accuracy levels obtained in the current study could be attributed to the implementation of the multi-step classification model wherein potential misclassification was minimized by first detecting and separating inter-row weeds, thereby subjecting only the intra-row weeds for machine learning-based classification. The classified maps and pixel density heat maps are shown in Figure 6.
AgriEngineering 2020, 3 FOR PEER REVIEW 10 required for running the python scripts/software for corresponding data processing tasks and does not include the time associated with the preparation of necessary data for tasks such as image calibration, and training and validation of the classifier. The image mosaicking process consumed the majority of the time (approx. 70%), whereas the image preprocessing step required the least time (5%).

Weed Mapping
The classification techniques used in the current study was effective in mapping the distribution of weeds in cotton with reasonably high accuracy levels. An overall accuracy (OA) of 89.16%, 85.83%, and 83.33% and kappa (K) value of 0.84, 0.79, or 0.75 were observed for low, medium, or high-density plots, respectively ( Figure 5). The generally high accuracy levels obtained in the current study could be attributed to the implementation of the multi-step classification model wherein potential misclassification was minimized by first detecting and separating inter-row weeds, thereby subjecting only the intra-row weeds for machine learning-based classification. The classified maps and pixel density heat maps are shown in Figure 6. Several studies have undertaken a similar multi-step classification approach and achieved high classification accuracies. For example, De Castro et al. [28] mapped both broadleaved and grass weed species in sunflower and cotton fields and achieved an average weed detection accuracy index of 73% and 75% for cotton and sunflower field, respectively. López-Granados et al. [7] mapped johnsongrass (Sorghum halepense (L.) Pers.) in maize (Zea mays L.) using a multistep approach, wherein the maize rows were first delineated using an iterative strip formation process, the inter-row johnsongrass was detected, and then normalized difference vegetation index (NDVI) and Excess Greenness Index (ExG) were used to classify intra-row johnsongrass from maize with an accuracy of 89% and 82% for multispectral and visual imagery, respectively. In another study, Gao et al. [36] combined the pixelbased method with OBIA to map weeds in a maize crop; Hough transformation was followed by Random Forest (RF) classifier using spectral, GLCM-based textural, and geometrical features to classify intra-row weeds with OA and K values of 94.5% and 0.91, respectively. Several studies have undertaken a similar multi-step classification approach and achieved high classification accuracies. For example, De Castro et al. [28] mapped both broadleaved and grass weed species in sunflower and cotton fields and achieved an average weed detection accuracy index of 73% and 75% for cotton and sunflower field, respectively. López-Granados et al. [7] mapped johnsongrass (Sorghum halepense (L.) Pers.) in maize (Zea mays L.) using a multistep approach, wherein the maize rows were first delineated using an iterative strip formation process, the inter-row johnsongrass was detected, and then normalized difference vegetation index (NDVI) and Excess Greenness Index (ExG) were used to classify intra-row johnsongrass from maize with an accuracy of 89% and 82% for multispectral and visual imagery, respectively. In another study, Gao et al. [36] combined the pixel-based method with OBIA to map weeds in a maize crop; Hough transformation was followed by Random Forest (RF) classifier using spectral, GLCM-based textural, and geometrical features to classify intra-row weeds with OA and K values of 94.5% and 0.91, respectively.
AgriEngineering 2020, 3 FOR PEER REVIEW 11 Figure 6. Results showing weed coverage in each replication (Rep 1, Rep 2, and Rep 3 on the upperleft, upper-right, and bottom-left panels, respectively) for three different density treatment plots (low, medium, and high). The pixels pertaining to weeds and crop in the classified maps were analysed using a multi-step approach involving separation of inter-row weeds first using Hough transformation and then detection of intra-row weeds using random forest classifier. The weed pixel density heat maps were derived by first converting the classified pixels to point shape files and performing point kernel density analysis on the shapefiles.
A unique aspect of the current study is that it implemented the multi-step approach under three different weed density levels and provided an outlook on how the accuracies are affected. Moreover, the majority of existing studies have focused on classifying weeds at an early crop stage when the weeds are sparsely distributed or there is a clear delineation of crop rows due to an absence of overlapping intra-row weeds. Such scenarios would minimize the complexity of generating crop row lines and further image processing tasks, leading to high classification accuracies. However, the current study successfully classified intra-and inter-row weeds even under high density levels.
The robustness of classification of inter-row weeds was dependent on how accurately the crop rows were delineated [7,36] using the crop row detection method. In the current study, this method was very effective, given the straight cotton rows in the field. However, additional processing may be required to remove redundant crop row lines in cases of non-linearity or under very high weed density levels wherein the green pixels of inter-row weeds may overlap with crop pixels, making it difficult for the algorithm to identify edges of rows. Apart from the field structure, crop row detection can also be influenced by the noises during binarization, edge detection, and other related preprocessing steps [51]. One of the several reasons for the inaccurate binarization could be the higher spectral similarity between shadow and underexposed vegetation pixels. The lower leaves are affected by shadow from upper leaves, which could lead to spectral confusion between underexposed leaves and gaps in crop canopy. The inaccurate masking of crop pixels, especially at upper-right, and bottom-left panels, respectively) for three different density treatment plots (low, medium, and high). The pixels pertaining to weeds and crop in the classified maps were analysed using a multi-step approach involving separation of inter-row weeds first using Hough transformation and then detection of intra-row weeds using random forest classifier. The weed pixel density heat maps were derived by first converting the classified pixels to point shape files and performing point kernel density analysis on the shapefiles.
A unique aspect of the current study is that it implemented the multi-step approach under three different weed density levels and provided an outlook on how the accuracies are affected. Moreover, the majority of existing studies have focused on classifying weeds at an early crop stage when the weeds are sparsely distributed or there is a clear delineation of crop rows due to an absence of overlapping intra-row weeds. Such scenarios would minimize the complexity of generating crop row lines and further image processing tasks, leading to high classification accuracies. However, the current study successfully classified intra-and inter-row weeds even under high density levels.
The robustness of classification of inter-row weeds was dependent on how accurately the crop rows were delineated [7,36] using the crop row detection method. In the current study, this method was very effective, given the straight cotton rows in the field. However, additional processing may be required to remove redundant crop row lines in cases of non-linearity or under very high weed density levels wherein the green pixels of inter-row weeds may overlap with crop pixels, making it difficult for the algorithm to identify edges of rows. Apart from the field structure, crop row detection can also be influenced by the noises during binarization, edge detection, and other related preprocessing steps [51]. One of the several reasons for the inaccurate binarization could be the higher spectral similarity between shadow and underexposed vegetation pixels. The lower leaves are affected by shadow from upper leaves, which could lead to spectral confusion between underexposed leaves and gaps in crop canopy. The inaccurate masking of crop pixels, especially at the edge of the crop rows, might significantly affect crop row detection results and thus may lead to inaccurate crop row lines.
Low weed density plots had low instances of inter-row weeds and extremely low intra-row weeds. However, intra-row weeds were relatively frequent in the medium and high-density plots. Lower OA in high-density plots, as compared to low-density plots, could be attributed to frequent occurrence of intra-row weeds in high density plots and difficulty associated with classifying intra-row weeds from cotton using the OBIA method. High instances of intra-row weeds increased the risk of spectral similarity and obscure the textural uniqueness of plants due to canopy interlockings. This situation was found in every replication of the high-density plots. The standard deviations of OA and kappa for different density plots were low and quite similar, probably due to high similarity in spatial configuration and amount of inter-row and intra-row weeds in cotton. In addition, segmented objects (group of pixels) were used as the validation samples, in contrast to pixels, which may have lowered the chances of variability in accuracy measures.
Morningglories showed high spectral (all three bands) and textural confusion with cotton, compared to Palmer amaranth and red sprangletop. The morningglories were often seen creeping into the cotton rows in the ground, adding more complexity in spectral distinction. Red sprangletop in particular had very low spectral overlap with cotton, compared to other weed species. These weeds were only the major grass species found in the area and were visually distinct in the ground. Though Palmer amaranth had high spectral similarity with cotton, the GLCM-based textural attributes based on 5 × 5 pixel kernels were different for these species, as implied by differences in leaf sizes and canopy structure. Thus, a combination of spectral and textural features yields high classification accuracies [52,53]. However, it should also be noted that spectral similarity observed here between cotton and weeds may not be the case in other situations. The spectral confusion is primarily dependent on the spectral, spatial, and radiometric resolution of the imagery; growth stage of the crop and weed; and the crop production system. For example, inclusion of non-visible bands in the analysis may help increase the spectral separability between crops and weeds. Further, increase in radiometric resolution adds more gradients of pixel values and thus provides more details/information at the pixel level.

Relationship between Weed Density and Pixel Coverage
The relationship between the image-based weed coverage data (i.e., area covered by weed pixels) and ground-based weed density assessments (plants m −2 ) for total weed species, and individually for Palmer amaranth and red sprangletop was determined using a simple linear regression analysis. A fairly high coefficient of determination (r 2 = 0.80) was achieved for total weed species present in a quadrat, indicating that the density of weeds in the crop field could be estimated based on weed pixel coverage (Figure 7). The ability for assessing weed densities using aerial images has been demonstrated previously. For example, Gao et al. [36] obtained, using a very high-resolution imagery (1.78 mm/pixel), high coefficient of determination (r 2 = 0.89) between image-based weed density and manually assessed weed density in a maize field. Although the coefficient of determination in the current study (r 2 = 0.80) was slightly lower compared to that of Gao et al. [36], current study provided considerably high accuracy even with a coarser spatial resolution (8 mm/pixel). The degree of relationship between ground-based manual assessments and aerial image-based assessments can be affected by several factors including weed and crop species being studied, growth stages of weeds, and environmental factors. First, the accuracy of weed pixel coverage determination in aerial imagery depends on how well the weeds are classified and distinguished from the crop. Second, inter-locked growth of weed species can lead to inaccurate estimation of pixel coverage since the coverage area of two interlocking weed plants may be lesser than the actual value. It is also possible that the dominant weeds can partially or completely mask other species growing underneath them, affecting the total pixel values [53,54]. Among the individual weed species assessed in the present study, high coefficient of determination was achieved for red sprangletop (r 2 = 0.88) ( Figure  8a) and Palmer amaranth (r 2 = 0.91) (Figure 8b). Higher accuracies with Palmer amaranth compared to that of red sprangletop could be largely attributed to the differences in growth pattern between the two species; red sprangletop plants had higher overlapping with each other, with more variable growth sizes compared to Palmer amaranth. In this study, we aimed at demonstrating if and how UAS can be used to map different densities of early-to mid-season weeds in cotton and estimate their densities. We do not anticipate our regression models to be as accurate under alternative experimental settings (e.g., different flight height, growth stage of weeds, forward speed, lighting conditions, etc.). Rather, we anticipate that The degree of relationship between ground-based manual assessments and aerial image-based assessments can be affected by several factors including weed and crop species being studied, growth stages of weeds, and environmental factors. First, the accuracy of weed pixel coverage determination in aerial imagery depends on how well the weeds are classified and distinguished from the crop. Second, inter-locked growth of weed species can lead to inaccurate estimation of pixel coverage since the coverage area of two interlocking weed plants may be lesser than the actual value. It is also possible that the dominant weeds can partially or completely mask other species growing underneath them, affecting the total pixel values [53,54]. Among the individual weed species assessed in the present study, high coefficient of determination was achieved for red sprangletop (r 2 = 0.88) (Figure 8a) and Palmer amaranth (r 2 = 0.91) (Figure 8b). Higher accuracies with Palmer amaranth compared to that of red sprangletop could be largely attributed to the differences in growth pattern between the two species; red sprangletop plants had higher overlapping with each other, with more variable growth sizes compared to Palmer amaranth. The degree of relationship between ground-based manual assessments and aerial image-based assessments can be affected by several factors including weed and crop species being studied, growth stages of weeds, and environmental factors. First, the accuracy of weed pixel coverage determination in aerial imagery depends on how well the weeds are classified and distinguished from the crop. Second, inter-locked growth of weed species can lead to inaccurate estimation of pixel coverage since the coverage area of two interlocking weed plants may be lesser than the actual value. It is also possible that the dominant weeds can partially or completely mask other species growing underneath them, affecting the total pixel values [53,54]. Among the individual weed species assessed in the present study, high coefficient of determination was achieved for red sprangletop (r 2 = 0.88) ( Figure  8a) and Palmer amaranth (r 2 = 0.91) (Figure 8b). Higher accuracies with Palmer amaranth compared to that of red sprangletop could be largely attributed to the differences in growth pattern between the two species; red sprangletop plants had higher overlapping with each other, with more variable growth sizes compared to Palmer amaranth. In this study, we aimed at demonstrating if and how UAS can be used to map different densities of early-to mid-season weeds in cotton and estimate their densities. We do not anticipate our regression models to be as accurate under alternative experimental settings (e.g., different flight height, growth stage of weeds, forward speed, lighting conditions, etc.). Rather, we anticipate that In this study, we aimed at demonstrating if and how UAS can be used to map different densities of early-to mid-season weeds in cotton and estimate their densities. We do not anticipate our regression models to be as accurate under alternative experimental settings (e.g., different flight height, growth stage of weeds, forward speed, lighting conditions, etc.). Rather, we anticipate that the study informs that true color UAV images can indeed be used to map early-to mid-season weeds. Nonetheless, we are confident that our methodology can be adopted and expanded by other studies with a similar focus. The prime reason for this adaptability is that the supervised classification method implemented in this study is based on the local training data. The regression model for weed estimation depends upon the classification-based weed canopy coverage area, which in turn depends upon the training samples collected by the researcher. This whole process is similar for any weed size in cotton. Following points highlight the significance of the experimental plan and the outputs of this study: (a) The study has demonstrated if and how early-to mid-season weeds can be mapped in cotton using true color UAS-borne imagery. (b) The study has shown that vegetation indices such as excess greenness index and textural features can be used in mapping early-to mid-season weeds, at least for high spatial resolution true color imagery. This information can guide future researchers with shared ideas. (c) The study has illustrated that high spatial resolution true color imagery-based weed coverage area could be an effective determinant of weed density in cotton at early-to mid-growth stage of weeds. (d) The study has also demonstrated how high spatial resolution imagery can be utilized to detect early-to mid-season cotton rows and use the information to easily segment out inter-row weeds.

Conclusions
This study demonstrated a methodology for mapping weed infestations in cotton utilizing RGB imagery and non-conventional image analysis techniques. Advanced computer vision techniques were tested to map weeds under different density levels and determine the relationship between image-based weed coverage estimates and ground-based weed density assessments. The current study has successfully demonstrated that they can be applied across different levels of weed densities. The spatial maps and density prediction models can be great resources for farmers/consultants for robust assessment of weed infestations and making informed management decisions. Furthermore, with a successful application of RGB imagery for this purpose, the study also emphasizes the usefulness of RGB imagery for weed assessment.
This study, however, has few limitations: (a) the results presented here were based on the experiment carried out on a specific weed growth stage (Table 1) and thus the predictive model for weed densities may not be applicable to other weed growth stages. However, our study proved the effectiveness of the computer vision techniques in weed density assessments, and this approach can be expanded to other scenarios as well. (b) the quadrats used for regression analysis for individual weed species were selected such that the specific weed densities were >80% within each quadrat. This was necessary due to difficulties with distinguishing different weed species using RGB imagery at this level of image resolution (8 mm/pixel). Such high densities of a single weed species may not be typical in all field scenarios and occurrence of a mix of multiple weed species can complicate prediction accuracies. However, ongoing technological improvements may improve weed classification and provide a solution to this challenge. Future research should focus on utilizing multispectral and hyperspectral imageries and develop improved classification algorithms for weed infestation assessments.