Next Article in Journal
Development and Evaluation of a Laser System for Autonomous Weeding Robots
Previous Article in Journal
Silicon in the Production, Nutrient Mineralization and Persistence of Cover Crop Residues
Previous Article in Special Issue
Differentiating Growth Patterns in Winter Wheat Cultivars via Unmanned Aerial Vehicle Imaging
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Efficient UAV-Based Automatic Classification of Cassava Fields Using K-Means and Spectral Trend Analysis

by
Apinya Boonrang
,
Pantip Piyatadsananon
* and
Tanakorn Sritarapipat
School of Mathematical Science and Geoinformatics, Institute of Science, Suranaree University of Technology, Nakhon Rachasima 30000, Thailand
*
Author to whom correspondence should be addressed.
AgriEngineering 2024, 6(4), 4406-4424; https://doi.org/10.3390/agriengineering6040250
Submission received: 2 October 2024 / Revised: 15 November 2024 / Accepted: 18 November 2024 / Published: 22 November 2024
(This article belongs to the Special Issue Computer Vision for Agriculture and Smart Farming)

Abstract

:
High-resolution images captured by Unmanned Aerial Vehicles (UAVs) play a vital role in precision agriculture, particularly in evaluating crop health and detecting weeds. However, the detailed pixel information in these images makes classification a time-consuming and resource-intensive process. Despite these challenges, UAV imagery is increasingly utilized for various agricultural classification tasks. This study introduces an automatic classification method designed to streamline the process, specifically targeting cassava plants, weeds, and soil classification. The approach combines K-means unsupervised classification with spectral trend-based labeling, significantly reducing the need for manual intervention. The method ensures reliable and accurate classification results by leveraging color indices derived from RGB data and applying mean-shift filtering parameters. Key findings reveal that the combination of the blue (B) channel, Visible Atmospherically Resistant Index (VARI), and color index (CI) with filtering parameters, including a spatial radius (sp) = 5 and a color radius (sr) = 10, effectively differentiates soil from vegetation. Notably, using the green (G) channel, excess red (ExR), and excess green (ExG) with filtering parameters (sp = 10, sr = 20) successfully distinguishes cassava from weeds. The classification maps generated by this method achieved high kappa coefficients of 0.96, with accuracy levels comparable to supervised methods like Random Forest classification. This technique offers significant reductions in processing time compared to traditional methods and does not require training data, making it adaptable to different cassava fields captured by various UAV-mounted optical sensors. Ultimately, the proposed classification process minimizes manual intervention by incorporating efficient pre-processing steps into the classification workflow, making it a valuable tool for precision agriculture.

1. Introduction

Agriculture has long been a cornerstone of human civilization, with nations like Thailand highlighting its importance. Approximately half of the nation’s land area is devoted to agricultural activities [1]. As the global population is projected to surpass 9 billion by 2050 [2], food production must increase significantly, with projections estimating a required rise of between 35% and 56% to meet future demand [3]. This situation of heightened demand exerts immense pressure on farmers to increase crop yields. However, numerous factors, including pests, pathogens, and weeds, limit crop yield [4].
Among these factors, weeds substantially threaten crop growth by competing with crops for essential resources such as nutrients, sunlight, water, and space. In Thailand, cassava, a drought-tolerant crop of significant economic value, is particularly vulnerable to weed infestation, especially during its early growth stages. Cassava yield losses due to weed competition have been reported to range between 20% and 80% [5,6]. Traditionally, herbicides are the primary method of weed management; however, their overuse results in escalating costs, environmental contamination, and health risks [7]. Recently, advancements like UAV spray technology have begun to offer promising solutions by enabling targeted herbicide application, thus reducing overall herbicide usage by up to 40% [8]. Nonetheless, successful weed management hinges on accurate weed species identification, which is vital for advancing precision agriculture in cassava cultivation.
UAV technology has gained traction in precision agriculture due to its ability to generate high-resolution maps and spatial data for monitoring and mapping vegetation. UAVs capture imagery at a centimeter-level resolution, providing detailed information crucial for precisely identifying weeds. Despite the promise of UAV imagery, challenges such as light intensity variations and shadow effects can distort spectral reflectance, affecting classification accuracy. Image classification, central to distinguishing weeds from crops, can be performed through supervised or unsupervised methods.
Supervised classification, which involves user-defined training data, allows for customized classification models and error correction during the training phase [9]. Techniques such as Random Forest (RF), Support Vector Machine (SVM), and deep learning have been employed for weed detection. However, these approaches require extensive training data and expert knowledge [10,11]. In contrast, unsupervised classification does not rely on pre-labeled data, making it more efficient, especially when addressing novel or unknown weed species. However, unsupervised methods face limitations such as subjective labeling and variability in spectral properties influenced by environmental conditions.
Today, advances in computing power and software development have significantly enhanced image classification techniques. Researchers have applied deep learning classification, achieving remarkable accuracy from 0.9328 up to 0.9884 [12,13], or an R2 of up to 0.85 [14]. While deep learning offers superior classification performance compared to traditional methods, it often requires larger amounts of manually labeled data as a foundation.
Recent advancements in computational capacity have driven the development of semi- and fully automated weed mapping techniques using UAV imagery [15,16], though supervised methods still require manual input, and deep learning models demand large datasets and high computational power. Spectral trend analysis offers a promising enhancement to rule-based classification by identifying patterns that enable effective thresholding for background removal and class separation, particularly in UAV image classification, where variable illumination is common. Adaptive thresholding dynamically accounts for these changes, providing robustness across diverse datasets. However, it remains sensitive to noise when spectral characteristics overlap between classes, risking misclassification [17]. Moreover, while adaptive thresholding methods work well when pixel classes are balanced, they struggle to determine threshold values when classes are highly unequal and often involve significant computational complexity [18]. Thus, the development of an automated UAV image classification process that is both rapid and precise is crucial, emphasizing the need for a method that combines accuracy with the resilience to handle diverse environmental conditions.
This research aims to enhance precision agriculture practices in cassava farming, contributing to increased productivity and sustainability. This study aims to develop an automated classification process for identifying weeds in cassava fields, utilizing data captured by commonly available, cost-effective UAVs. The proposed classification process incorporates pre-processing and classification techniques into a streamlined workflow. Various indices and parameters are carefully considered to ensure the robustness and precision of classification results.

2. Materials and Methods

2.1. Study Sites and Acquisition of Data

This study was conducted in cassava fields in the Muang district of Nakhon Ratchasima province, located in the Northeastern region of Thailand. Nakhon Ratchasima is recognized as Thailand’s leading province in terms of cassava cultivation area and production. The classification process developed in this study was tested using seven image samples, each representing different cassava plots within the study area. Each image sample covers 40 × 50 m, encompassing zones with weeds, soil, and trees. The process was further applied to ten additional cassava plots to validate the classification accuracy and assess the robustness of the proposed classification process. These plots exhibited cassava canopy size, soil type, and weed distribution variability.
UAV flights were conducted over the ten cassava plots at various times and dates, between three and four months after planting, capturing variations in the datasets across two periods: 2018 and 2021. Table 1 provides details of the study sites, including a wide range of soil properties representing the diversity of cassava plots in Nakhon Ratchasima province. The study areas shown in Figure 1 and Figure 2 represent UAV images captured by different sensors: the DJI Phantom 4 Pro and DJI Phantom 4.
Two UAV platforms were used for image acquisition: the DJI Phantom 4 Pro and the DJI Phantom 4. The DJI Phantom 4 Pro is equipped with an FC6310 optical sensor, which has a resolution of 20 million pixels, a 1-inch CMOS sensor, a focal length of 8.8 mm, an 84° field of view (FOV), and a maximum image size of 5472 × 3648 pixels. The DJI Phantom 4, on the other hand, is equipped with an FC330 optical sensor, which features a 1/2.3-inch CMOS sensor with 12.4 million effective pixels, a focal length of 3.6 mm, a 94° FOV, and a maximum image size of 4000 × 3000 pixels. Both UAVs captured imagery in the visible light spectrum, including the red, green, and blue (RGB) channels. GPS/GLONASS satellite systems were used to geo-reference the images, ensuring precise spatial positioning.
Due to the independent image-capturing processes for each cassava plot, variations in lighting conditions between flights were unavoidable. The UAV images were processed and mosaiced using Pix4Dmapper software (Version 1.4, PIX4D), producing orthorectified images for each plot. The initial spatial resolution of the images ranged from 1.21 cm to 4.414 cm. The images were resampled to a spatial resolution of 5 cm using the nearest-neighbor method.

2.2. Develop the Proposed Classification Process

The very high-resolution UAV images were classified into three distinct classes: cassava, weeds, and soil. The proposed classification process involved a pre-processing stage that included filtering, followed by an unsupervised algorithm, K-means clustering, combined with labeling rules to enable automatic classification. The workflow of this classification process is depicted in Figure 3. Various parameters, including the input dataset and filtering settings, were evaluated to optimize classification accuracy.
Building upon prior research [19], which demonstrated the effectiveness of mean-shift filtering in improving classification accuracy by enhancing object pixel size and value distribution, this study employed a two-step optimization strategy. In the first step, each input image was individually fine-tuned to determine the parameter configuration that produced the best performance for the corresponding class. In the second step, the parameters of the mean-shift algorithm were further optimized to ensure maximum class separability across the dataset.
The approach adopted in this study for initially detecting soil pixels prior to further classification was specifically chosen to address the variability introduced by differing lighting conditions. By identifying soil pixels first, a more flexible basis for subsequent classification stages is established, allowing the method to perform effectively under varied illumination. This approach underwent rigorous testing across seven sample sites, demonstrating its robustness and efficiency across diverse environmental conditions. Accordingly, this method offers a more reliable framework for accurate weed detection in UAV imagery across different terrains and lighting conditions, aligning with our objective of developing a classification process capable of consistent performance in a wide range of settings.
As shown in Figure 3, the input data for the proposed classification process requires two components: a UAV image with 5 cm resolution and a boundary shapefile. The classification process begins with input data preparation, which includes calculating indices and creating a composite input image for subsequent steps, followed by filtering, clustering, and the initial labeling of identified classes as either soil or vegetation (soil classification). In the vegetation classification stage, inputs for clustering consist of the soil classification image from the previous step and the filtered image. In this process, soil pixels were assigned a value of 0, while vegetation pixels were assigned a value of 1. These values were then multiplied by the filtered image, resulting in a dataset displaying 0 for soil pixels and the filtered values for vegetation pixels. For the K-means clustering function, the number of clusters was set to four, representing cassava, weeds, soil (with a pixel value of 0), and no-data pixels (those outside the shapefile). Finally, the soil map and the combined cassava and weed map were merged to produce the final classification output.
The proposed classification process results were validated using unsupervised and supervised classification methods before being applied across the entire study area. This validation ensured the robustness of the approach and its applicability to large-scale cassava farming.
This study details the development of an automated classification process implemented in Python. The process integrates a set of functions and selected variables specifically designed for each step. All tasks—including feature extraction, composite image preparation, filtering, clustering, labeling, and merging classification classes into a single map—were executed using Python libraries. The classification process was conducted on a Microsoft Windows 10 system with a 64-bit operating system, 64 GB of RAM, and a 3.60 GHz Core i9-9900KF CPU, with the processing time measured from start to finish. The proposed classification approach was assessed on this system to ensure efficiency and performance across all steps.

2.2.1. Composite Image Preparation for Classification

The quality of UAV images can be significantly affected by variations in illumination, particularly under rapidly changing weather conditions, which often lead to uneven lighting across images. Several studies on weed detection using UAV imagery have developed image processing techniques to address these illumination challenges. The illumination issue is crucial for accurate classification, as inconsistencies in lighting can compromise classification accuracy. Color indices have been employed to address illumination challenges under different lighting conditions to mitigate these effects [20]. However, the effectiveness of these indices varies based on crop type and light intensity [20]. Table 2 provides a summary of commonly used RGB-based indices that highlight both plant and soil properties.
In the initial stage of the classification process, features were extracted from the red (R), green (G), and blue (B) layers of the UAV input images. Various vegetation indices, such as ExR, ExG, ExB, ExGR, NGRDI, GLI, VARI, BI, and CI, were calculated using the equations provided in Table 2.
Feature selection plays a critical role in filtering and classification by enhancing model performance, accuracy, and efficiency, especially in high-dimensional spaces. Density estimation within these spaces is particularly challenging; as [21,22] indicates, reducing the number of features helps mitigate difficulties in estimating densities and choosing bandwidths in algorithms such as mean shift. Additionally, studies [23,24] show that eliminating irrelevant or redundant features reduces noise, improving accuracy. This makes feature selection essential for achieving reliable results and efficient computation.
To effectively implement feature selection within filtering and classification processes, we applied these principles to create meaningful composite images with RGB layers and computed indices by constructing a three-layer composite image prepared according to the specified parameters for OpenCV’s pyrMeanShiftFiltering() function [25]; each layer in the composite image was assigned a specific index, with notations such as BI-BI-BI representing composites where all three layers consisted of the BI. Additionally, combinations of three distinct indices were explored, such as R-G-B, R-G-ExG, and ExG-ExGR-GLI. This approach aligns with the goal of reducing irrelevant data to improve model performance and computational efficiency.
This systematic approach generated a total of 232 unique composite images, which were subsequently tested within the mean-shift filtering framework. These composite images served as inputs for further processing steps, ensuring that the classification process could address the challenges posed by varying illumination conditions while maintaining high accuracy in identifying plant and soil characteristics.
Table 2. Spectral indices based on RGB values distinguish vegetation and non-vegetation.
Table 2. Spectral indices based on RGB values distinguish vegetation and non-vegetation.
IndexEquationDominant Application
Excess Red (ExR) [26] 1.4 × r g red spectrum extraction
Excess Green (ExG) [27] 2 g r b green spectrum extraction
Excess Blue (ExB) [28] 1.4 × b g blue spectrum extraction
Excess Green minus Excess Red (ExGR) [29] E x G E x R highlight vegetation
Normalized Green Red Difference Index (NGRDI) [30] ( G R ) / ( G + R ) vegetation discrimination
Green Leaf Index (GLI) [31] ( 2 G R B ) / ( 2 G + R + B ) vegetation discrimination
Visual Atmospheric Resistance Index (VARI) [32] ( G R ) / ( G + R B ) vegetation discrimination
Brightness Index (BI) [33] ( G 2 + R 2 ) / 2 soil discrimination
Color Index (CI) [34] ( R G ) / ( R + G ) soil discrimination
where R, G, B is digital number of red, green, and blue channels (0–255), and r = R R + G + B , g = G R + G + B , b = B R + G + B .

2.2.2. Optimizing Mean-Shift Algorithm Parameters for Image Classification

The mean-shift algorithm, a non-parametric iterative technique initially developed by Fukunaga and Hostetler [35], has found widespread applications in filtering and clustering within computer vision and image processing. The algorithm is particularly valued for preserving edges during filtering and segmentation tasks by considering the image data’s geometric and photometric characteristics [36]. The core principle involves defining a window (or kernel) based on spatial proximity and color similarity, with pixels within this window treated as neighbors. The algorithm iteratively computes the mean value of the neighborhood and shifts the target pixel towards this mean until convergence, effectively reducing noise and smoothing contours. This capability to adapt to the shape and size of objects makes mean-shift filtering highly suitable for tasks involving detection and tracking, as it requires minimal manual intervention and is computationally efficient [37,38]. Additionally, the algorithm operates independently of the selected color space, allowing for flexibility in feature selection [25].
Despite its many advantages, the mean-shift algorithm has certain limitations. For instance, it may converge towards local optima rather than the global maximum, mainly when the image contains multiple objects [39]. Furthermore, the bandwidth parameter plays a crucial role in the algorithm’s performance, with its effectiveness dependent on object size and contrast. Selecting an optimal kernel size is essential for achieving the best results, though no universally applicable method exists for this selection process [40].
In this experiment, the pyrMeanShiftFiltering() function from OpenCV [25] was applied. This algorithm iteratively executed mean-shift calculations on the input image pixels based on specified conditions. The algorithm iteratively performed mean-shift calculations on the pixels of the input images following the conditions:
( x , y ) : X s p x X + s p , Y s p y Y + s p ,
( R , G , B ) ( r , g , b ) s r ,
where sp represents the spatial window radius and sr represents the color window radius. The vectors (R,G,B) and (r,g,b) are the color components at pixel locations (X,Y) of the input image and (x,y) of the filtered result, respectively.
The algorithm works by iteratively shifting a window over an image. It calculates the weighted average of both the spatial coordinates and color values of neighboring pixels within a defined spatial radius (sp) and color radius (sr). The window is then shifted towards the region with the highest pixel density based on both spatial position (X’, Y’) and color vector (R’, G’, B’), which are used as the new center for the next iteration. This process repeats until the window converges, resulting in smoothed and segmented regions in the image. This algorithm operates independently of the color space, enabling the use of any three-component data for processing. It requires only a three-component input, allowing the flexibility to work across various color models.
This study tested various filtering window sizes to determine the optimal parameters for each target class. The spatial (sp) and color (sr) radius parameters of the filtering window varied based on the specific characteristics of the target objects. The sp and sr values varied between 5 and 25 in increments of 5, resulting in 25 different filtering sets explored for the soil and vegetation classification processes. This approach allowed for tailored optimization specific to each class, including soil, cassava, and weeds.

2.2.3. Clustering

Clustering algorithms play a vital role in data analysis by identifying groups (clusters) of similar data points within a dataset without needing pre-labeled training data or human supervision [41]. Among the various clustering techniques, K-means clustering is one of the most commonly used for unsupervised classification. It partitions the data into a user-defined number (k) of clusters, assigning each data point to one of these clusters [42]. The primary objective of K-means is to minimize the total variation within each cluster [43].
Despite its simplicity and relatively low parameter-tuning requirements, K-means clustering has limitations. One major challenge is the random initialization trap, where the selection of initial cluster centroids affects the algorithm’s performance. Poor initial centroids may cause the algorithm to converge to local optima, preventing it from finding the globally optimal solution [44].
In this study, the classification of the filtered image was achieved using the K-means algorithm from the sklearn.cluster library [45], which implements the K-means++ method. The K-means++ method was used to improve the selection of initial centroids by giving preference to the points that are farthest from existing centroids, thus increasing the likelihood of selecting representative clusters [46].
The appropriate number of clusters (k) was determined based on the expected classification outcomes. For soil classification, the expected clusters included soil, vegetation (a mixture of cassava and weeds), and background (pixels outside the boundary shapefile). For plant classification (cassava and weeds), soil pixels were assigned a value of 0 and vegetation pixels retained their filtered values. The K-means clustering function was configured with four clusters to differentiate cassava, weeds, soil (value of 0), and no-data pixels (outside the shapefile). The soil map was then merged with the combined cassava and weed map to produce the final classification output.

2.2.4. Spectral Trend Analysis and Labeling

K-means clustering assigns pixels into clusters based on their spectral characteristics, grouping similar pixel types or classes. These clusters are then labeled according to their spectral similarities. However, the labeling process goes beyond merely assigning spectral values to clusters; it involves the analysis of spectral trends to refine classification rules that capture patterns across different classes. Spectral trend analysis identifies consistent patterns in spectral values, accommodating potential variability across images. This approach ensures that classification remains robust and adaptable across diverse datasets by highlighting reliable trends in spectral values specific to each class.

2.2.5. Adjusting and Validating

The classification process was tested on seven sample sites to assess its accuracy. The kappa coefficient and statistical significance were evaluated across these sites, with validation points randomly distributed throughout the study area based on the visual interpretation of UAV images. The optimal combination of indices, filtering parameters, and labeling rules was determined by maximizing the average accuracy and kappa coefficient from the classification results. These variables were thoroughly tested across seven distinct areas and settings, each featuring diverse environmental conditions, along with variations in dates, times, and camera sensors. The broad range of testing conditions strengthens the assumption that the selected variables consistently perform well across different settings, thereby improving the reliability and generalizability of the results.
The performance of the classifier was compared to traditional classification methods, including Random Forest (RF) for supervised classification and K-means clustering for unsupervised classification. Test sites were segmented using eCognition Developer software (Version 8.7), and RF models were constructed for each site using different variables. The model with the highest performance was selected for each sample site, creating site-specific RF models. K-means clustering used the same inputs as RF, and the resulting clusters were labeled based on the dominant class within each cluster. Kappa coefficients obtained from the developed classification process were compared with those from RF and K-means methods.

2.2.6. Applying the Classification

Initially, the optimal parameters for the classification process were identified across the entire study area, covering ten cassava plots. This broader application aimed to evaluate the classifier’s robustness and identify its limitations by analyzing the study plots’ physical properties and diverse components. Classification accuracy was assessed using reference points obtained through the visual interpretation of high-resolution original UAV images.
The accuracy of the classification was measured using a confusion matrix, along with overall accuracy (OA), producer’s accuracy (PA), user’s accuracy (UA), and the kappa coefficient [47]. OA represents the proportion of correctly classified instances, PA indicates how well a particular class was classified, and UA denotes the probability that a pixel classified into a given class truly belongs to that class. The kappa coefficient quantifies the agreement between the classification results and ground truth, accounting for chance agreement. The equations for these metrics are:
O A = i = 1 n x i i N
P A i = x i i x i +
U A i = x i i x + i
kappa   coefficient   =   N i = 1 n x i i i = 1 n ( x i + x + i ) N 2 i = 1 n ( x i + x + i )
where x i i is the number of correctly classified instances for class i, x i + and x + i are the marginal totals for row i and column i, respectively, n refers to the number of classes in the matrix, and N is the total number of observations.

3. Results

3.1. Influence of Input and Parameters on Classification Accuracy

The selection of input parameters, including spectral indices and filtering settings, was crucial in determining the classification accuracy of soil, cassava, and weed classes. To better understand the influence of these factors, the R, G, and B layers of the UAV images were processed and normalized to a range of 0–255. Boxplots were generated to represent the spectral values of the sample classes (soil, cassava, and weeds) using the R, G, and B channels and various spectral indices. These boxplots visually depict the spectral value ranges for each class. As shown in Figure 4, considerable spectral overlap between classes across all indices made it challenging to distinguish between classes using any single index alone. This overlap highlights the necessity for an optimized combination of indices and filtering parameters to achieve accurate classification results.
Additionally, the spectral values from the original blue, green, and red channels exhibited a broader range of values compared to the calculated indices, indicating that the raw data displayed greater variability. This variability underscores the importance of selecting the appropriate spectral indices and filtering parameters, as raw spectral values alone may not provide sufficient differentiation between the target classes.
The influence of spectral index combinations on classification accuracy is further demonstrated in Table 3, which summarizes the benefits of combining the primary dataset (derived from the RGB bands) with specific spectral indices to achieve superior classification outcomes. Among the index tested, the combination of B-VARI-CI, filtered with a spatial radius (sp) of 5 and a color radius (sr) of 10, achieved the highest average kappa coefficient (0.9513 ± 0.0358) for soil classification across all sample sites. Other combinations, such as B-VARI-CI (sp = 10, sr = 10), B-VARI-BI (sp = 5, sr = 10), B-ExB-CI (sp = 5, sr = 10), and B-VARI-BI (sp = 10, sr = 5), also demonstrated strong performance, though with gradually decreasing accuracy.
For cassava and weed classification, the combination of G-ExR-ExG, filtered with sp = 10 and sr = 20, resulted in the highest average kappa coefficient (0.8226 ± 0.1045), showcasing the effectiveness of this index combination. This experiment was followed by G-ExR-NGRDI (sp = 10, sr = 20), which showed similar optimal window and search radius settings. Other top-performing combinations included G-ExR-NGRDI (sp = 25, sr = 15), G-NGRDI-GLI (sp = 20, sr = 15), and G-ExR-ExGR (sp = 25, sr = 15). For the primary dataset (R-G-B), the highest average kappa coefficient achieved was 0.7993 ± 0.1091, with a filter setting of sp = 5 and sr = 25.
These results indicate that the appropriate selection of input indices and filtering parameters significantly enhances the classification accuracy for the soil, cassava, and weed classes, reducing spectral overlap and improving the robustness of the classification process.

3.2. Labeling Rules

The clustering process generated specific values for each cluster, which served as thresholds for classifying soil, cassava, and weed classes. However, variations in illumination and light conditions across different images affected the pixel values, leading to inconsistencies. The trends in spectral values for each class were used to label clusters accurately. By establishing classification rules based on the spectral properties of each class, an automatic classification process was developed that minimized the impact of varying illumination conditions.
The pixel values in the clustered images exhibited distinct characteristics depending on the input combinations. Despite some variation in pixel values across different areas—even within the same index—the overall trends remained consistent, as shown in Table 4. These trends allowed for robust classification rules based on the cluster values.
Table 4 categorizes the indices into two groups based on their classification characteristics. Group 1 includes the indices R, G, B, ExR, ExB, BI, and CI. In this group, lower pixel values correspond to vegetation for soil classification, while higher pixel values indicate soil. For vegetation classification, lower pixel values are associated with cassava, while higher pixel values denote weed. Conversely, Group 2 (comprising ExG, ExGR, NGRDI, GLI, and VARI) exhibits opposite characteristics. In this group, lower pixel values represent soil in soil classification, while higher pixel values correspond to vegetation. For vegetation classification, lower pixel values indicate weeds and higher pixel values represent cassava.
These results led to the creation of a systematic approach for identifying and classifying data groups. The classification was achieved by determining the maximum pixel values in each input image and using these as thresholds to define the class boundaries. As indicated in Table 4, high pixel values were used as the maximum values for classification, ensuring that each image had distinct threshold values tailored to its specific dataset.
The classification of pixels (p) was governed by the following rules based on the group of indices being used:
For Group 1 indices (R, G, B, ExR, ExB, BI, CI):
class ( p ) = vegetation if   p     p max soil if   p = p max
class ( p ) = cassava if   p     p max w e e d if   p = p max
For Group 2 indices (ExG, ExGR, NGRDI, GLI, VARI):
class ( p ) = vegetation if   p = p max soil if   p p max
class ( p ) = cassava if   p = p max w e e d if   p p max
where p max is the maximum pixel value of the input image.
This approach ensured that the classification process was robust and adaptable across different lighting conditions and image datasets, enabling precise and automated labeling of soil, cassava, and weeds based on the spectral properties and trends derived from clustering

3.3. Validation of the Classification: Comparison with Traditional Methods

The developed classification process incorporated a combination of input indices, mean-shift parameters, cluster numbers, and classification rules tailored to each input index. This approach resulted in consistently high average kappa coefficients across sample sites 1–7. Optimal combinations of input data and filtering parameters were identified for the classification scheme, and Table 5 outlines these conditions in detail. For the soil classification, the combination of B, VARI, and CI indices was used as input, filtered with mean-shift parameters (sp = 5, sr = 10), and clustered into three groups labeled as soil, vegetation, and background. These clusters were labeled based on the B index, as discussed in Section 3.2. The combination of G, ExR, and ExG indices was selected as input for vegetation classification, filtered with mean-shift parameters (sp = 15, sr = 10), and clustered into four groups. These were labeled as cassava, weeds, soil pixels (from the previous process), and background based on the G index.
It was compared to traditional approaches across seven sample sites to evaluate the performance of the proposed classification method. This comparison involved combining three indices at a GSD of 5 cm, segmenting them using eCognition software, and then applying classification. The Random Forest (RF) method was used to represent supervised classification, while K-means clustering was used as the unsupervised approach.
Table 6 presents the input data and resulting classification accuracies for the K-means clustering and RF methods. A one-tailed paired t-test was conducted at a significance level of α = 0.05 to statistically compare the average classification accuracies. With 6 degrees of freedom, this test assessed the differences between the K-means, RF, and proposed classification process. The results demonstrated a statistically significant difference between the proposed classification process and K-means clustering, indicating the superior performance of the novel approach. However, no significant difference was observed between the proposed classification process and RF, suggesting that the proposed classification process achieves accuracy comparable to supervised learning (RF) while surpassing the unsupervised method (K-means). The labeling rules in the proposed classification process were chosen based on observed patterns in spectral values across different classes. The accuracy of each class and the kappa coefficient of the classification results reflect the correctness of these rules. Across all seven sample sites, the high accuracy of the proposed classification process demonstrates the effectiveness of the rules, indicating their applicability to other images as well. Figure 5 visually depicts the kappa coefficients obtained across all test sites for the three methods.

3.4. Application of the Classification: Results from Different Study Areas

The classification process began by resampling images to a standardized GSD of 5 cm using the nearest-neighbor method, ensuring consistent spatial resolution across all datasets. A sequential classification approach was then applied, targeting each class individually. The classification first addressed soil, followed by cassava and weeds. The outputs of these classifications were then integrated to generate a comprehensive classification map that included all three target classes.
The developed classification process was deployed to classify ten cassava plots, with the classification accuracies and processing times presented in Table 7. The results provide valuable insights into the effectiveness of the classification method. The classification outcomes are further illustrated in Figure 6. Soil classification exhibited consistently high accuracy across all plots, with producer’s accuracy (PA) ranging from 0.9831 to 1.0000 and user’s accuracy (UA) ranging from 0.7076 to 0.9804.
The PA and UA for cassava and weed classification showed greater variability. Cassava PA ranged from 0.5449 to 0.9600, with UA values between 0.7682 and 1.0000, highlighting a range of accuracy across different plots. Similarly, weed classification displayed PA values ranging from 0.5603 to 1.0000 and UA from 0.5909 to 0.9804, indicating fluctuations in classification accuracy.
Overall accuracy (OA) across the plots ranged from 0.7467 to 0.9867, with most values exceeding 0.8, resulting in an average OA of 0.8518. The kappa coefficient, which measures the agreement between classified images and reference data, ranged from 0.6344 to 0.9800, with most values above 0.75 and an average kappa coefficient of 0.7809. Processing times varied based on the size of each plot, ranging from 1.02 to 18.32 min.

4. Discussion

4.1. Input Combination as the Impact of Selection and Labeling Rules

The results presented in Table 3 emphasize the significant influence of spectral index combinations on the classification accuracy of soil, cassava, and weed classes. Strategically fusing the primary dataset (derived from RGB bands) with specific spectral indices considerably improved classification outcomes. Combinations of the primary dataset with two additional indices yielded better results compared to using the primary dataset alone. This improvement is especially evident in soil and vegetation classification, with kappa accuracy improving by approximately 2.33–2.65%. The robustness of these index combinations is demonstrated by the low standard deviation in classification accuracy, indicating consistent performance across different datasets.
The consistent success of the Color Index (CI) in soil classification is due to its sensitivity to soil color variations and composition [34]. The CI effectively distinguishes soil from other elements by quantifying the color difference between red and green bands, making it relatively insensitive to vegetation cover. This characteristic makes the CI particularly useful in separating soil from plant life. The green and excess red (ExR) indices played a crucial role in differentiating cassava from weeds. The green band captures plant health and structure, while ExR highlights differences in red and green reflectance, which is useful for distinguishing plant species with varying chlorophyll content [48].
The clustered image characteristics from each index display a trend in cluster values that varies by region. By using these trends, represented by minimum or maximum values, threshold-based approaches become more effective than relying on exact values. The spectral trend analysis supports the development of classification rules that can be adapted for different environments. While the proposed classification method applies straightforward rules to a small number of clusters, more complex rules may be necessary for cases involving a larger number of clusters.

4.2. Filtering Parameters

As shown in Table 3, soil classification achieved high accuracy with various spatial window sizes (sp), suggesting that no single optimal sp value exists, likely due to the variability in soil shapes. In contrast, employing a small search radius (sr) yielded high accuracy. This is likely due to the narrowing of the spectral range within the combined input indices, which facilitates the distinction between vegetation and soil.
For cassava classification, the chosen filtering parameters (sp and sr) played a crucial role in capturing the essential properties of the target objects. The sp parameter, optimized for a GSD of 5 cm with a 10-pixel window, aligns well with the average size of cassava canopies (ranging from 52 to 88 cm). This suggests a correlation between sp and the size of the classified objects. Meanwhile, the sr parameter appeared to be responsive to the specific spectral values of cassava in the selected indices, contributing to the accuracy of the classification.

4.3. Proposed Classification Process Performance

The proposed classification process, which had already established the optimal combination of input data, filtering parameters, clustering parameters, and labeling rules, can run automatically with the identified variables. Results from ten different cassava plots demonstrate the performance of this classification process as reflected in the achieved accuracies.
The soil class consistently demonstrated high producer accuracy (PA) and user accuracy (UA), indicating strong performance in correctly identifying soil pixels. This can be attributed to the distinct color differences between soil and vegetation, which simplified classification using spectral indices (Figure 4). Minimal overlap between the spectral profiles of soil and other classes further enhanced classification accuracy. Integrating three different indices, as seen in Table 3, resulted in even higher classification precision for soil.
In contrast, cassava and weed classification showed greater variability in PA and UA, reflecting the challenges in accurately distinguishing between these classes. These difficulties were primarily due to the similar spectral characteristics of cassava and weed or variations in their appearance. Plots 1, 5, and 8 exhibited lower PA and UA due to misclassification issues. In Plot 1, weed layers resembled soil (Figure 6a), leading to misinterpretation and a lower UA for the soil class. In Plot 5, dense weed patches and small, sparsely distributed cassava canopies (Figure 6b) caused difficulty in differentiating between cassava and weeds. Variability in light conditions in Plot 8 (Figure 6c) also contributed to potential misclassification between cassava and weeds, as changes in reflectance values due to lighting influenced clustering and classification accuracy.
The non-uniform lighting conditions observed in the cassava plot images significantly influenced classification outcomes when processed as a single unit. Segmenting the images into two sections led to a marked increase in accuracy, suggesting that addressing lighting variability within localized areas enhances classification reliability. The use of a clustering algorithm that incorporates Voronoi partitioning proved effective in this context. By dividing the input image, the algorithm was able to form smaller, distinct groups, creating localized data clusters that better represented the heterogeneity in lighting and other variables across the plot. This approach allowed the clustering process to focus on these smaller sections, resulting in more accurate and robust classification.
These findings suggest that partitioning input data to account for lighting inconsistencies enables the clustering algorithm to manage localized variations effectively, improving classification performance across areas with complex lighting patterns. This method could be particularly beneficial for large-scale agricultural imagery where environmental factors vary widely.
However, the proposed classification process proved robust across varying light conditions, with plots 2 and 8 achieving overall accuracy (OA) and kappa coefficients exceeding 70%. This demonstrates the method’s reliability in practical agricultural settings with fluctuating illumination levels.
The classification method was highly advantageous in terms of processing efficiency, with processing times under 20 min from initial index calculation to classification map generation. This makes it suitable for real-time or near-real-time applications in precision agriculture without requiring extensive user training or parameter adjustment.
Overall, the method performed well, particularly in plots where kappa coefficients surpassed 0.7, indicating substantial agreement with reference data. Sometimes, kappa coefficients exceeded 0.81, indicating near-perfect agreement and underscoring the method’s precision. The efficient processing times further highlight its utility in timely agricultural management applications.

5. Conclusions

This study explored using high-resolution UAV imagery and spectral indices for classifying cassava fields and extracting weed information. The K-means clustering method showed promise for class separation but faced challenges in achieving high accuracy in a single step. The proposed classification process, incorporating mean-shift filtering and rule-based post-processing, significantly improved classification accuracy, yielding results comparable to the supervised Random Forest (RF) method with less manual intervention.
Evaluating the method across ten cassava plots confirmed its effectiveness, with classification accuracies ranging from 0.6 to 0.9 and kappa coefficients exceeding 0.7. Processing times were faster than traditional supervised methods, ranging from 1 to 18 min.
A key aspect of this study was the pre-processing step using mean-shift filtering, which reduced noise and enhanced the distinctiveness of relevant image features. The analysis of filtering parameters revealed that varying spatial window sizes (sp) worked well for soil classification, while a small search radius (sr) consistently improved soil and vegetation differentiation. Cassava classification showed optimal performance with a specific sp value of 10, aligning with the average size of cassava canopies, and sr was responsive to the spectral properties of cassava in the selected indices.
The study also highlighted the importance of selecting appropriate spectral indices for high classification accuracy. The Color Index (CI) emerged as particularly reliable for soil classification due to its sensitivity to soil color and minimal influence from vegetation cover. Tailoring index selection to specific target classes improved cassava and weed classification accuracy.
In terms of the spectral trend analysis, the clustered image characteristics revealed trends in cluster values that varied by region. These trends, represented by minimum or maximum values, allowed threshold-based approaches to be more effective than relying on exact values. The spectral trend analysis further supported the adaptability of classification rules across different environments. While simple rules were effective for small clusters, more complex rules may be necessary for cases involving a larger number of clusters.
In conclusion, using RGB sensor data, this work demonstrates the effectiveness of color indices, mean-shift filtering, and K-means clustering for automated weed classification in cassava fields. The method requires minimal training data, making it adaptable to diverse cassava datasets. Its emphasis on pre-processing and weed classification makes it suitable for precision agriculture applications, where efficient, data-driven weed management is critical for improving crop yield and resource allocation. Future studies should explore weed spatial distribution patterns, time series analysis, and the use of classification maps for weed management in precision agriculture.

Author Contributions

Conceptualization, A.B., P.P. and T.S.; methodology, A.B., P.P. and T.S.; software, A.B. and T.S.; validation, A.B., P.P. and T.S.; formal analysis, A.B. and T.S.; investigation, A.B.; resources, A.B., P.P. and T.S.; data curation, A.B. and T.S.; writing—original draft preparation, A.B.; writing—review and editing, P.P.; visualization, A.B.; supervision, P.P.; project administration, A.B.; funding acquisition, A.B. and P.P. All authors have read and agreed to the published version of the manuscript.

Funding

A portion of the publication fees was provided by the Institute of Research and Development, Suranaree University of Technology.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Acknowledgments

We extend our sincere gratitude to the Science Achievement Scholarship of Thailand (SAST) for awarding a Ph.D. scholarship to Apinya Boonrang. The results presented in this study are part of the experiments conducted for her doctoral dissertation (2022). The dissertation is available at http://sutir.sut.ac.th:8080/jspui/handle/123456789/9842 (accessed on 1 October 2024).

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Office of Agricultural Economics. Agricultural Utilized Areas by Province, Year 2019. 2019. Available online: https://www.oae.go.th/assets/portals/1/files/socio/LandUtilization2562.pdf (accessed on 15 May 2024).
  2. FAO. How to Feed the World in 2050—High-Level Expert Forum. Rome, 12–13 October 2009. Available online: https://www.fao.org/fileadmin/templates/wsfs/docs/Issues_papers/HLEF2050_Global_Agriculture.pdf (accessed on 15 May 2024).
  3. van Dijk, M.; Morley, T.; Rau, M.L.; Saghai, Y. A Meta-Analysis of Projected Global Food Demand and Population at Risk of Hunger for the Period 2010–2050. Nat. Food 2021, 2, 494–501. [Google Scholar] [CrossRef]
  4. Fried, G.; Chauvel, B.; Reynaud, P.; Sache, I. Decreases in Crop Production by Non-Native Weeds, Pests, and Pathogens. In Impact of Biological Invasions on Ecosystem Services; Vilà, M., Hulme, P.E., Eds.; Springer International Publishing: Cham, Switzerland, 2017; pp. 83–101. [Google Scholar]
  5. Jeamjamnanja, J.; Phuddacharoen, S.; Pulsa-nguan, P.; Rojanaridpiched, C.; Saengkaewsuk, W. Timing of Weed Control in Cassava. Weeds 1984, 2, 144–147. [Google Scholar]
  6. Onochie, B.E. Critical Periods for Weed Control in Cassava in Nigeria. PANS Pest. Arctic. News Sum. 1975, 21, 54–57. [Google Scholar] [CrossRef]
  7. Marin-Morales, M.A.; Ventura-Camargo, B.D.C.; Hoshina, M.M. Toxicity of Herbicides: Impact on Aquatic and Soil Biota and Human Health. In Herbicides—Current Research and Case Studies in Use; Andrew, J.P., Jessica, A.K., Eds.; InTech: London, UK, 2013; ISBN 978-953-51-1112-2. [Google Scholar]
  8. Miller, P.C. Patch Spraying: Future Role of Electronics in Limiting Pesticide Use. Pest Manag. Sci. 2003, 59, 566–574. [Google Scholar] [CrossRef]
  9. Campbell, J.B.; Wynne, R.H. Introduction to Remote Sensing, 5th ed.; The Guilford Press: New York, NY, USA, 2011; ISBN 978-1-60918-176-5. [Google Scholar]
  10. Foody, G.M.; Mathur, A. Toward Intelligent Training of Supervised Image Classifications: Directing Training Data Acquisition for SVM Classification. Remote Sens. Environ. 2004, 93, 107–117. [Google Scholar] [CrossRef]
  11. Ge, Y.; Bai, H.; Wang, J.; Cao, F. Assessing the Quality of Training Data in the Supervised Classification of Remotely Sensed Imagery: A Correlation Analysis. J. Spat. Sci. 2012, 57, 29–45. [Google Scholar] [CrossRef]
  12. Haq, M.A.; Rahaman, G.; Baral, P.; Ghosh, A. Deep Learning Based Supervised Image Classification Using UAV Images for Forest Areas Classification. J. Indian Soc. Remote Sens. 2021, 49, 601–606. [Google Scholar] [CrossRef]
  13. Zhang, J.; Qiang, Z.; Lin, H.; Chen, Z.; Li, K.; Zhang, S. Research on Tobacco Field Semantic Segmentation Method Based on Multispectral Unmanned Aerial Vehicle Data and Improved PP-LiteSeg Model. Agronomy 2024, 14, 1502. [Google Scholar] [CrossRef]
  14. Nguyen, C.; Sagan, V.; Bhadra, S.; Moose, S. UAV Multisensory Data Fusion and Multi-Task Deep Learning for High-Throughput Maize Phenotyping. Sensors 2023, 23, 1827. [Google Scholar] [CrossRef]
  15. Pérez-Ortiz, M.; Peña, J.M.; Gutiérrez, P.A.; Torres-Sánchez, J.; Hervás-Martínez, C.; López-Granados, F. A Semi-Supervised System for Weed Mapping in Sunflower Crops Using Unmanned Aerial Vehicles and a Crop Row Detection Method. Appl. Soft Comput. 2015, 37, 533–544. [Google Scholar] [CrossRef]
  16. Gašparović, M.; Zrinjski, M.; Barković, Đ.; Radočaj, D. An Automatic Method for Weed Mapping in Oat Fields Based on UAV Imagery. Comput. Electron. Agric. 2020, 173, 105385. [Google Scholar] [CrossRef]
  17. Otsu, N. A Threshold Selection Method from Gray-Level Histograms. IEEE Trans. Syst. Man Cybern. 1979, 9, 62–66. [Google Scholar] [CrossRef]
  18. Roy, P.; Dutta, S.; Dey, N.; Dey, G.; Chakraborty, S.; Ray, R. Adaptive thresholding: A comparative study. In Proceedings of the 2014 International Conference on Control, Instrumentation, Communication and Computational Technologies (ICCICCT), Kanyakumari, India, 10–11 July 2014; pp. 1182–1186. [Google Scholar] [CrossRef]
  19. Boonrang, A.; Sritarapipat, T.; Piyatadsananon, P. Applicable Mean-Shift Filtering Parameters for Mapping Weed in Cassava Fields Based on UAV Images. In Proceedings of the 42nd Asian Conference on Remote Sensing (ACRS2021), Can Tho City, Vietnam, 22–24 November 2021; pp. 303–310. [Google Scholar]
  20. Hamuda, E.; Glavin, M.; Jones, E. A Survey of Image Processing Techniques for Plant Extraction and Segmentation in the Field. Comput. Electron. Agric. 2016, 125, 184–199. [Google Scholar] [CrossRef]
  21. Wang, Z.; Scott, D. Nonparametric Density Estimation for High-Dimensional Data—Algorithms and Applications. WIREs Comput. Stat. 2019, 11, e1461. [Google Scholar] [CrossRef]
  22. Comaniciu, D.; Meer, P. Mean Shift: A Robust Approach Toward Feature Space Analysis. IEEE Trans. Pattern Anal. Mach. Intell. 2002, 24, 603–619. [Google Scholar] [CrossRef]
  23. Kohavi, R.; John, G.H. Wrappers for Feature Subset Selection. Artif. Intell. 1997, 97, 273–324. [Google Scholar] [CrossRef]
  24. Blum, A.L.; Langley, P. Selection of Relevant Features and Examples in Machine Learning. Artif. Intell. 1997, 97, 245–271. [Google Scholar] [CrossRef]
  25. OpenCV. pyrMeanShiftFiltering(), Image Filtering Module. 2024. Available online: https://docs.opencv.org/4.x/d4/d86/group__imgproc__filter.html#ga9fabdce9543bd602445f5db3827e4cc0 (accessed on 25 October 2024).
  26. Meyer, G.; Hindman, T.; Laksmi, K. Machine Vision Detection Parameters for Plant Species Identification. In Precision Agriculture and Biological Quality, Proceedings of the Photonics East (ISAM, VVDC, IEMB), Boston, MA, USA, 1–6 November 1998; SPIE: Bellingham, WA, USA, 1999; Volume 3543. [Google Scholar] [CrossRef]
  27. Woebbecke, D.; Meyer, G.; Bargen, K.; Mortensen, D. Color Indices for Weed Identification under Various Soil, Residue, and Lighting Conditions. Trans. ASAE 1995, 38, 259–269. [Google Scholar] [CrossRef]
  28. Guijarro, M.; Pajares, G.; Riomoros, I.; Herrera, P.J.; Burgos-Artizzu, X.P.; Ribeiro, A. Automatic Segmentation of Relevant Textures in Agricultural Images. Comput. Electron. Agric. 2011, 75, 75–83. [Google Scholar] [CrossRef]
  29. Meyer, G.E.; Neto, J.C. Verification of Color Vegetation Indices for Automated Crop Imaging Applications. Comput. Electron. Agric. 2008, 63, 282–293. [Google Scholar] [CrossRef]
  30. Tucker, C.J. Red and Photographic Infrared Linear Combinations for Monitoring Vegetation. Remote Sens. Environ. 1979, 8, 127–150. [Google Scholar] [CrossRef]
  31. Louhaichi, M.; Borman, M.M.; Johnson, D.E. Spatially Located Platform and Aerial Photography for Documentation of Grazing Impacts on Wheat. Geocarto Int. 2001, 16, 65–70. [Google Scholar] [CrossRef]
  32. Gitelson, A.A.; Kaufman, Y.J.; Stark, R.; Rundquist, D. Novel Algorithms for Remote Estimation of Vegetation Fraction. Remote Sens. Environ. 2002, 80, 76–87. [Google Scholar] [CrossRef]
  33. Mathieu, R.; Pouget, M.; Cervelle, B.; Escadafal, R. Relationships Between Satellite-Based Radiometric Indices Simulated Using Laboratory Reflectance Data and Typic Soil Color of an Arid Environment. Remote Sens. Environ. 1998, 66, 17–28. [Google Scholar] [CrossRef]
  34. Escadafal, R.; Huete, A. Improvement in Remote Sensing of Low Vegetation Cover in Arid Regions by Correcting Vegetation Indices for Soil “Noise”. C. R. Acad. Sci. Ser. II 1991, 312, 1385–1391. [Google Scholar]
  35. Fukunaga, K.; Hostetler, L. The Estimation of the Gradient of a Density Function, with Applications in Pattern Recognition. IEEE Trans. Inf. Theory 1975, 21, 32–40. [Google Scholar] [CrossRef]
  36. Song, N.; Gu, I.; Cao, Z.; Viberg, M. Enhanced Spatial-Range Mean Shift Color Image Segmentation by Using Convergence Frequency and Position. In Proceedings of the 2006 14th European Signal Processing Conference, Florence, Italy, 4–8 September 2006; pp. 1–5. [Google Scholar]
  37. Zhou, H.; Wang, X.; Schaefer, G. Mean Shift and Its Application in Image Segmentation. In Innovations Intelligent Image Analysis, Series: Studies in Computational Intelligence; Kwasnicka, H., Jain, L.C., Eds.; Springer: Berlin/Heidelberg, Germany, 2011; pp. 291–312. ISBN 978-3-642-17934-1. [Google Scholar]
  38. Sun, J. A Fast MEANSHIFT Algorithm-Based Target Tracking System. Sensors 2012, 12, 8218–8235. [Google Scholar] [CrossRef]
  39. Morales, R.; Torres, E.; Sossa, H. Image Segmentation Based on an Iterative Computation of the Mean Shift Filtering for Different Values of Window Sizes. Int. J. Imaging Robot. 2011, 6, 1–19. [Google Scholar]
  40. Collins, R.T. Mean-Shift Blob Tracking Through Scale Space. In Proceedings of the 2003 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, Madison, WI, USA, 18–20 June 2003; pp. 234–240. [Google Scholar]
  41. Jain, A.K. Data Clustering: 50 Years Beyond K-means. Pattern Recognit. Lett. 2010, 31, 651–666. [Google Scholar] [CrossRef]
  42. Xu, R.; Wunsch, D. Survey of Clustering Algorithms. IEEE Trans. Neural Netw. 2005, 16, 645–678. [Google Scholar] [CrossRef]
  43. James, G.; Witten, D.; Hastie, T.; Tibshirani, R. An Introduction to Statistical Learning: With Applications in R; Springer: New York, NY, USA, 2013; ISBN 978-1-4614-7137-0. [Google Scholar]
  44. Celebi, M.E.; Kingravi, H.; Vela, P. A Comparative Study of Efficient Initialization Methods for the K-Means Clustering Algorithm. Expert Syst. Appl. 2013, 40, 200–210. [Google Scholar] [CrossRef]
  45. Scikit-learn. KMeans, Clustering Module. Available online: https://scikit-learn.org/1.5/modules/generated/sklearn.cluster.KMeans.html (accessed on 25 October 2024).
  46. Arthur, D.; Vassilvitskii, S. k-means++: The Advantages of Careful Seeding. In Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms, New Orleans, LA, USA, 7–9 January 2007; Society for Industrial and Applied Mathematics: New Orleans, LA, USA, 2007; pp. 1027–1035. [Google Scholar]
  47. Cohen, J. A Coefficient of Agreement for Nominal Scales. Educ. Psychol. Meas. 1960, 20, 37–46. [Google Scholar] [CrossRef]
  48. Virtanen, O.; Constantinidou, E.; Tyystjärvi, E. Chlorophyll Does Not Reflect Green Light—How to Correct a Misconception. J. Biol. Educ. 2022, 56, 552–559. [Google Scholar] [CrossRef]
Figure 1. Study area of cassava fields captured by the DJI Phantom 4 Pro sensor.
Figure 1. Study area of cassava fields captured by the DJI Phantom 4 Pro sensor.
Agriengineering 06 00250 g001
Figure 2. Study area of cassava fields captured by the DJI Phantom 4 sensor.
Figure 2. Study area of cassava fields captured by the DJI Phantom 4 sensor.
Agriengineering 06 00250 g002
Figure 3. Proposed classification process.
Figure 3. Proposed classification process.
Agriengineering 06 00250 g003
Figure 4. Boxplot of the spectral value of classes.
Figure 4. Boxplot of the spectral value of classes.
Agriengineering 06 00250 g004
Figure 5. Kappa coefficient of K-means, RF, and the proposed classification process.
Figure 5. Kappa coefficient of K-means, RF, and the proposed classification process.
Agriengineering 06 00250 g005
Figure 6. Classification results using the proposed classification process: (a) Plot 1, showing results from an area with patchy weeds and thin weed patches; (b) Plot 5, showing results from an area with fewer weed patches and dense weed coverage; (c) Plot 8, showing results from an area with varying light illumination.
Figure 6. Classification results using the proposed classification process: (a) Plot 1, showing results from an area with patchy weeds and thin weed patches; (b) Plot 5, showing results from an area with fewer weed patches and dense weed coverage; (c) Plot 8, showing results from an area with varying light illumination.
Agriengineering 06 00250 g006
Table 1. Information of studied site.
Table 1. Information of studied site.
Plot IDSensorTaken DateCassava Canopy
Diameter (cm)
WeedSoilSample Site
Plot 1FC631028 April 201857.42 ± 8.25ScatterSandy soilSample Site 1
Plot 2FC631028 April 201852.11 ± 9.09ScatterSandy soilSample Site 2
Plot 3FC631028 April 201871.28 ± 9.05DenseSandy soilSample Site 3
Plot 4FC631028 April 201870.36 ± 8.37DenseSandy soilSample Site 4
Plot 5FC631028 April 201852.14 ± 9.25DenseSandy soilSample Site 5
Plot 6FC3305 September 201865.26 ± 11.56ScatterReddish-brownSample Site 6
Plot 7FC3305 July 202187.83 ± 15.04DenseReddish-brownSample Site 7
Plot 8FC33021 May 202175.80 ± 13.27DenseReddish-brown-
Plot 9FC33021 May 202186.38 ± 14.92DenseReddish-brown-
Plot 10FC33021 May 202183.38 ± 15.91DenseReddish-brown-
Table 3. Result from RGB combination and the input and parameters yield high classification accuracy.
Table 3. Result from RGB combination and the input and parameters yield high classification accuracy.
ProcessCombinationMean-Shift ParameterKappa Coefficient
spsrAverageS.D.
Soil ClassificationR-G-B5200.92480.0891
B-VARI-CI5100.95130.0358
B-VARI-CI10100.94630.0369
B-VARI-BI5100.94540.0528
B-ExB-CI5100.94500.0436
B-VARI-BI1050.94460.0423
Vegetation
Classification
R-G-B5250.79930.1091
G-ExR-ExG10200.82260.1045
G-ExR-NGRDI10200.82060.1086
G-ExR-NGRDI25150.82050.0975
G-NGRDI-GLI20150.81980.0991
G-ExR-ExG25150.81950.0980
Table 4. Characteristics of objects from clustered image.
Table 4. Characteristics of objects from clustered image.
GroupIndexSoil ClassificationVegetation Classification
1R, G, B, ExR, ExB, BI, CILow pixel value is vegetationLow pixel value is cassava
High pixel value is soilHigh pixel value is weed
2ExG, ExGR, NGRDI, GLI, VARILow pixel value soilLow pixel value weed
High pixel value is vegetationHigh pixel value is cassava
Table 5. Selected parameter for the proposed classification process.
Table 5. Selected parameter for the proposed classification process.
ProcessInput CombinationMean-Shift ParameterNumber of
Cluster
Classification Rule
spsr
Soil ClassificationB-VARI-CI5103Based on index B
Vegetation ClassificationG-ExR-ExG15104Based on index G
Table 6. Input data and classification accuracy of the K-means, RF, and the proposed classification process.
Table 6. Input data and classification accuracy of the K-means, RF, and the proposed classification process.
Sample SiteCombination for
K-Means and RF
K-MeansRFProposed Classification Process
Kappa
Coefficient
Kappa
Coefficient
Kappa
Coefficient
Soil’s
Accuracy *
Cassava’s
Accuracy *
Weed’s
Accuracy *
Sample Site 1G-GLI-VARI0.69580.74020.77710.92540.80970.8011
Sample Site 2R-B-NGRDI0.24710.67590.67860.93950.71140.5233
Sample Site 3R-G-ExGR0.52350.81850.84670.96640.81730.7933
Sample Site 4G-BI-CI0.34250.82810.80270.98000.85430.8557
Sample Site 5ExR-ExB-BI0.28230.84040.86090.96730.86670.8275
Sample Site 6R-ExG-ExGR0.73000.89500.87500.98080.89450.8733
Sample Site 7R-B-ExB0.83500.99000.96001.00000.96000.9630
Average0.52230.82690.84110.96560.84480.8053
S.D.0.23690.10150.09000.02550.07750.1367
t-value (t(0.05,6) = 1.943)2.3923 **0.6979-----
* The accuracy of each class is calculated as the average of its producer’s accuracy (PA) and user’s accuracy (UA). ** t-test shows a significant (p-value < 0.05) difference between the results from the proposed classification process and the traditional classification process.
Table 7. Classification accuracy and processing time of the classification results.
Table 7. Classification accuracy and processing time of the classification results.
PlotArea (sq.m)Producer AccuracyUser AccuracyOverall
Accuracy
Kappa
Coefficient
Time (min.) *
SoilCassavaWeedSoilCassavaWeed
119,826.80.99490.54490.56030.70760.91920.59090.74670.63445.15
227,816.80.98310.67840.60870.81400.76820.71190.79500.70258.21
356,636.60.99550.85710.84150.87450.97710.85490.89810.847110.02
455,741.41.00000.83240.70050.90770.79320.82520.84430.766510.11
570,671.10.99750.83770.59420.79090.82810.83000.82170.744518.32
63092.981.00000.84440.84440.91840.92680.84440.89630.84441.02
75884.631.00000.96001.00000.98041.00000.98040.98670.98001.04
836,776.51.00000.58440.82680.93900.83330.67020.80380.70565.48
911,657.51.00000.81540.90000.91300.96360.78950.88400.82152.12
104271.51.00000.75000.77500.95240.81080.75610.84170.76251.02
Average0.99710.77050.76510.87980.88200.78540.85180.7809-
S.D.0.00530.13070.14500.08440.08450.10920.06750.0971-
* Measured from indices calculation process to combination the classification map process.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Boonrang, A.; Piyatadsananon, P.; Sritarapipat, T. Efficient UAV-Based Automatic Classification of Cassava Fields Using K-Means and Spectral Trend Analysis. AgriEngineering 2024, 6, 4406-4424. https://doi.org/10.3390/agriengineering6040250

AMA Style

Boonrang A, Piyatadsananon P, Sritarapipat T. Efficient UAV-Based Automatic Classification of Cassava Fields Using K-Means and Spectral Trend Analysis. AgriEngineering. 2024; 6(4):4406-4424. https://doi.org/10.3390/agriengineering6040250

Chicago/Turabian Style

Boonrang, Apinya, Pantip Piyatadsananon, and Tanakorn Sritarapipat. 2024. "Efficient UAV-Based Automatic Classification of Cassava Fields Using K-Means and Spectral Trend Analysis" AgriEngineering 6, no. 4: 4406-4424. https://doi.org/10.3390/agriengineering6040250

APA Style

Boonrang, A., Piyatadsananon, P., & Sritarapipat, T. (2024). Efficient UAV-Based Automatic Classification of Cassava Fields Using K-Means and Spectral Trend Analysis. AgriEngineering, 6(4), 4406-4424. https://doi.org/10.3390/agriengineering6040250

Article Metrics

Back to TopTop