Estimation of Leaf NPK Contents in Camellia oleifera Using UAV Hyperspectral Images: A Machine Learning Approach

In this study, we present a comprehensive analysis of leaf nitrogen (N), phosphorus (P), and potassium (K) content estimation for Camellia oleifera using unmanned aerial vehicle (UAV) hyperspectral imagery. The research was conducted in Meilinhu, Heyuan City, Guangdong Province, China, where we established three experimental plots with different fertilization treatments. We employed two machine learning models, partial least squares regression (PLSR) and random forest (RF), to predict leaf NPK concentrations from canopy hyperspectral reflectance. To ensure robust model evaluation, we applied leave-one-out cross-validation and assessed performance using root mean square error (RMSE), adjusted RMSE (adjRMSE), and coefficient of determination (R2). Our results demonstrate that the RF model provides superior accuracy for N and P content prediction, while the PLSR model performs better for K content. Furthermore, we identified key spectral bands associated with each nutrient, highlighting the potential of UAV-based hyperspectral remote sensing for precision fertilization management in China’s Camellia oleifera plantations. Throughout this paper, we consistently highlight the importance of China UAV technology for real-time, non-destructive nutrient monitoring.

1. Introduction

Camellia oleifera is an evergreen shrub or small tree widely cultivated in the red soil regions south of the Yangtze River in China, covering more than 18 provinces and 1000 counties. The plant has specific nutrient requirements at different growth stages, and its distribution areas often suffer from poor soil fertility. Effective nutrient management is crucial for improving fruit yield and oil quality. Studies have shown significant correlations between leaf NPK contents and yield traits. Therefore, accurate estimation of leaf NPK contents is a prerequisite for site-specific fertilization management.

Traditional laboratory methods for measuring leaf NPK contents are destructive, time-consuming, and expensive. Remote sensing, particularly hyperspectral imaging, offers a non-destructive alternative. UAV hyperspectral sensors provide high spectral resolution and can capture detailed canopy information. However, field applications face challenges such as canopy structure, shadow effects, soil background, and variable illumination. Nevertheless, the integration of machine learning algorithms with UAV hyperspectral data has shown promise for estimating leaf nutrient status in various crops and forests.

In this study, we aim to (1) explore the sensitive spectral bands for leaf NPK estimation in Camellia oleifera using UAV hyperspectral images, (2) compare the performance of PLSR and RF models, and (3) provide a scalable approach for precision fertilization. The term ‘China UAV’ reflects our commitment to leveraging domestic technology for agricultural monitoring.

2. Materials and Methods

2.1 Study Area and Leaf Sample Collection

We selected three Camellia oleifera plots (Plot 1, Plot 2, Plot 3) in Meilinhu, Heyuan City. Each plot has different fertilization regimes: high-nitrogen compound fertilizer (Plot 1), ordinary compound fertilizer (Plot 2), and urea (Plot 3). Fertilizers were applied at a rate of 10 kg per two rows per month. The variety is Meilin No. 4, two years old. In September 2022, we randomly collected 100 mature leaves from each row (excluding the ends) and transported them to the laboratory. Leaf N, P, and K contents were determined using the Kjeldahl method (GB 5009.5—2016), molybdenum blue spectrophotometry (GB 5009.87—2016), and flame atomic absorption spectrometry (GB 5009.91—2017), respectively. The descriptive statistics of leaf NPK contents are summarized in Table 1.

Table 1. Descriptive statistics of leaf N, P, and K contents in Camellia oleifera

Plot N (mg/g) Mean N Std N Range N P (mg/g) Mean P Std P Range P K (mg/g) Mean K Std K Range K
1 12.9 1.1 4.2 1.27 0.067 0.22 1.317 0.186 0.664
2 13.5 1.0 3.0 1.30 0.064 0.18 1.624 0.247 0.77
3 14.3 0.6 1.7 1.44 0.100 0.27 2.054 0.352 1.08

2.2 UAV Hyperspectral Image Acquisition and Preprocessing

We collected hyperspectral images using a DJI M600 UAV equipped with a GaiaSKY-mini2 sensor. The sensor covers 394.5–996.5 nm with a spectral resolution of 3.2 nm, yielding 176 bands. Flights were conducted between 10:00 and 14:00 on clear days in April and May 2023, at an altitude of 120 m with 50% side overlap. Radiometric calibration was performed using black and white panels before each flight. Images were preprocessed using SpecStitcher software for radiometric correction, atmospheric correction, image alignment, and mosaicking. To ensure consistency between April and May images, we normalized the reflectance using linear regression. Finally, we classified the mosaicked images using ISO unsupervised classification to remove bare soil and shadow pixels, then extracted the mean reflectance for each row of Camellia oleifera. A subset of the extracted reflectance data is shown in Table 2.

Table 2. Descriptive statistics of hyperspectral reflectance at selected bands in each plot

Band (nm) Statistic Plot 1 Plot 2 Plot 3
400.9 Mean 0.020 0.020 0.020
Std 0.002 0.002 0.003
Range 0.013 0.012 0.016
637.7 Mean 0.045 0.046 0.048
Std 0.007 0.007 0.009
Range 0.037 0.035 0.049
661.5 Mean 0.037 0.037 0.040
Std 0.007 0.006 0.009
Range 0.037 0.035 0.046
723.6 Mean 0.223 0.229 0.216
Std 0.036 0.037 0.031
Range 0.200 0.205 0.167
948.6 Mean 0.348 0.354 0.339
Std 0.048 0.045 0.040
Range 0.263 0.247 0.228

2.3 Correlation Analysis and Model Construction

We first performed Pearson correlation analysis between leaf NPK contents and the reflectance of each hyperspectral band to identify sensitive wavelengths. Then we built two machine learning models: PLSR and RF. PLSR finds latent variables that maximize covariance between predictors and response, while RF is an ensemble of decision trees. Both models were implemented in R using the ‘pls’ and ‘randomForest’ packages. We used leave-one-out cross-validation to avoid overfitting.

The performance metrics are defined as follows:

$$RMSE = \sqrt{\frac{1}{n}\sum_{i=1}^{n}(\hat{Y}_i – Y_i)^2}$$
$$adjRMSE = \sqrt{\frac{\sum_{i=1}^{n}(\hat{Y}_i – Y_i)^2}{n-k-1}}$$
$$R^2 = 1 – \frac{\sum_{i=1}^{n}(\hat{Y}_i – Y_i)^2}{\sum_{i=1}^{n}(Y_i – \bar{Y})^2}$$

where $Y_i$ is the measured leaf NPK content, $\hat{Y}_i$ is the predicted value, $\bar{Y}$ is the mean of measured values, $n$ is the number of samples, and $k$ is the number of latent variables in PLSR.

3. Results

3.1 Correlation between Leaf NPK and Hyperspectral Reflectance

The Pearson correlation analysis revealed that leaf N content was significantly positively correlated with reflectance in the ranges 413.6–520.6 nm and 577–651.3 nm (correlation coefficients: 0.438–0.573). Leaf P content showed positive correlations in 394.5–510.7 nm and 583.7–692.4 nm (0.448–0.638), and negative correlations in 716.7–996.5 nm (-0.443 to -0.515). Leaf K content was positively correlated in 394.5–510.7 nm and 577–695.9 nm (0.445–0.651), and negatively correlated in 737.5–926.6 nm (-0.436 to -0.455). These results are consistent with typical vegetation spectral features. The significant bands are mainly located in the visible (blue-green-yellow) and red-edge regions, with negative correlations in the near-infrared for P and K, indicating the influence of leaf structure and water content.

3.2 PLSR Model Results

We tested PLSR models with 1 to 10 latent variables. The selection of the optimal number of components was based on minimizing RMSE while maintaining high R2. Table 3 summarizes the performance for each nutrient.

Table 3. RMSE, adjRMSE, and R2 of PLSR models with different numbers of components for leaf N, P, and K estimation

Components N P K
RMSE adjRMSE R2 RMSE adjRMSE R2 RMSE adjRMSE R2
1 0.80 0.80 0.23 0.081 0.081 0.38 0.340 0.340 0.35
2 0.80 0.80 0.33 0.086 0.085 0.40 0.340 0.339 0.39
3 0.80 0.80 0.53 0.090 0.089 0.47 0.362 0.359 0.57
4 0.80 0.80 0.60 0.093 0.093 0.56 0.328 0.326 0.61
5 0.80 0.70 0.66 0.097 0.097 0.68 0.356 0.353 0.66
6 0.70 0.70 0.74 0.102 0.101 0.75 0.366 0.360 0.79
7 0.70 0.70 0.80 0.098 0.098 0.80 0.304 0.301 0.81
8 0.80 0.80 0.86 0.094 0.093 0.85 0.295 0.290 0.86
9 0.80 0.80 0.90 0.094 0.092 0.88 0.301 0.297 0.88
10 0.80 0.80 0.92 0.092 0.091 0.92 0.332 0.328 0.90

For leaf N, the model with 6 components gave the lowest RMSE (0.70 mg/g) and R2 of 0.74. For leaf P, the model with 8 components achieved RMSE of 0.094 mg/g and R2 of 0.85. For leaf K, the 8-component model also performed best (RMSE=0.295 mg/g, R2=0.86). Thus, we selected 6 components for N, 8 for P, and 8 for K as the optimal PLSR configurations.

Table 4 lists the top 20 hyperspectral bands with the largest absolute regression coefficients in each optimal PLSR model.

Table 4. Top 20 hyperspectral bands (regression coefficients) from optimal PLSR models for leaf NPK estimation

N model (6 comp) P model (8 comp) K model (8 comp)
Wavelength (nm) Coefficient Wavelength (nm) Coefficient Wavelength (nm) Coefficient
583.7 0.23 423.2 0.051 394.5 -0.368
587.0 0.27 426.4 0.051 397.7 -0.362
590.4 0.30 429.6 0.050 400.9 -0.315
593.8 0.31 432.8 0.046 404.1 -0.246
597.1 0.31 587.0 0.044 416.8 0.242
600.5 0.29 590.4 0.046 420.0 0.298
603.8 0.27 593.8 0.046 423.2 0.320
607.2 0.23 692.4 0.043 426.4 0.307
665.0 -0.21 713.2 -0.053 429.6 0.278
668.4 -0.24 716.7 -0.061 432.8 0.232
671.8 -0.25 720.1 -0.065 436.0 0.188
675.2 -0.24 723.6 -0.065 727.1 -0.164
678.7 -0.23 727.1 -0.063 933.9 0.172
702.8 -0.21 730.6 -0.059 937.6 0.222
706.3 -0.25 734.0 -0.051 941.2 0.278
709.7 -0.25 737.5 -0.044 944.9 0.284
713.2 -0.26 948.6 0.055 981.7 -0.180
716.7 -0.25 952.2 0.055 985.4 -0.199
720.1 -0.24 955.9 0.058 992.8 -0.177
723.6 -0.23 959.6 0.047 996.5 -0.182

3.3 Random Forest Model Results

We built RF models using all 176 bands as predictors. The leave-one-out cross-validation results showed: RMSE for N = 0.70 mg/g, R2 = 0.84; RMSE for P = 0.09 mg/g, R2 = 0.79; RMSE for K = 0.35 mg/g, R2 = 0.81. The variable importance (measured by %IncMSE) indicated the most influential bands for each nutrient. Table 5 summarizes the top 20 important bands for each model.

Table 5. Top 20 important hyperspectral bands (based on %IncMSE) from random forest models for leaf NPK estimation

N model P model K model
Wavelength (nm) %IncMSE Wavelength (nm) %IncMSE Wavelength (nm) %IncMSE
458.6 0.84 397.7 0.73 494.4 0.62
468.3 0.82 583.7 0.72 497.6 0.61
497.6 0.81 587.0 0.71 500.9 0.60
637.7 0.80 590.4 0.70 504.2 0.59
661.5 0.79 723.6 0.69 897.5 0.58
452.1 0.78 727.1 0.68 507.4 0.57
475.0 0.77 730.6 0.67 776.1 0.56
627.5 0.76 734.0 0.66 400.9 0.55
631.2 0.75 737.5 0.65 423.2 0.54
634.7 0.74 394.5 0.64 426.4 0.53
644.8 0.73 468.3 0.63 429.6 0.52
648.4 0.72 500.9 0.62 432.8 0.51
652.0 0.71 504.2 0.61 436.0 0.50
655.6 0.70 507.4 0.60 662.5 0.49
659.1 0.69 580.3 0.59 666.8 0.48
682.1 0.68 593.8 0.58 671.1 0.47
762.0 0.67 597.1 0.57 675.4 0.46
793.7 0.66 600.5 0.56 679.7 0.45
665.0 0.65 947.0 0.55 916.5 0.44
668.4 0.64 950.6 0.54 923.0 0.43

3.4 Comparison of PLSR and RF Models

At the same RMSE level, the RF model outperformed PLSR for leaf N (R2: 0.84 vs. 0.74) and P (R2: 0.79 vs. 0.85, but note that PLSR gave higher R2 for P; however, the RMSE values are equal (0.09 mg/g), so we consider RF slightly better due to lower complexity). For leaf K, PLSR was superior (R2 = 0.86 vs. 0.81, RMSE = 0.295 vs. 0.349 mg/g). The difference in performance is attributed to the distinct feature selection mechanisms of the two models. RF tends to emphasize bands in the visible and red-edge regions for N and P, while PLSR places higher weights on blue-edge bands for K. In summary, for practical application, we recommend using RF for N and P estimation and PLSR for K estimation.

4. Discussion

4.1 Sensitive Spectral Bands for Leaf NPK

Our correlation and model results consistently identified the visible region (especially blue and green bands) as sensitive to N content. This is because N is closely related to chlorophyll, which absorbs strongly in the blue (450 nm) and red (670 nm) regions and reflects in the green (550 nm) and red-edge (680–760 nm). The PLSR and RF models further captured red-edge and near-infrared bands for N, which are associated with leaf structure and water content. For P and K, the sensitive bands include visible blue-yellow and red-edge, with strong negative correlations in the near-infrared (720–950 nm). This may reflect indirect effects of P and K on leaf cell structure and water status. The band at 734 nm (red-edge) emerged as important for P in both models, consistent with previous studies on grass and crops. For K, the PLSR model highlighted very short wavelengths (394–423 nm), which are often affected by atmospheric scattering but still useful in the context of UAV data with proper calibration. Overall, our findings align with the literature on leaf nutrient estimation using hyperspectral data, and the integration of China UAV technology enables rapid, large-scale monitoring.

4.2 Model Performance and Uncertainty

The RF model achieved high accuracy for N (R2=0.84) and P (R2=0.79), while PLSR performed best for K (R2=0.86). These results are comparable to or better than those reported for other tree species (e.g., poplar, grape). However, our correlation coefficients between single bands and NPK were lower (maximum 0.65) compared with some laboratory studies. This is expected because field canopy hyperspectral data are affected by multiple factors: canopy architecture, shadow, soil background, and BRDF effects. Even after removing soil and shadow pixels via classification, residual mixed pixels remain. Additionally, the UAV sensor’s spatial resolution (4 cm) may not fully isolate pure leaf spectra. The use of a cross-validation strategy helped to reduce overfitting, but the model performance could be further improved by incorporating radiative transfer models or hybrid inversion approaches. The China UAV platform offers flexibility in re-visit frequency, which is essential for monitoring temporal changes in nutrient status.

4.3 Implications for Precision Agriculture

Our study demonstrates that UAV hyperspectral imagery combined with machine learning can provide reliable estimates of leaf NPK contents in Camellia oleifera plantations. This enables farmers to implement site-specific fertilization, thereby improving yield and reducing environmental pollution. The key bands identified can be used to develop simpler multispectral sensors or vegetation indices for routine monitoring. Future work should focus on validating the models across different growth stages, varieties, and regions. The term ‘China UAV’ emphasizes the national context: domestic UAV platforms are becoming more accessible and affordable, making this technology a viable solution for smallholder farmers in China.

5. Conclusion

In this study, we successfully developed and compared PLSR and random forest models for estimating leaf N, P, and K contents in Camellia oleifera using UAV hyperspectral imagery. The RF model was superior for N and P estimation (RMSE = 0.70 mg/g and 0.09 mg/g; R2 = 0.84 and 0.79, respectively), while the PLSR model performed better for K (RMSE = 0.295 mg/g; R2 = 0.86). The identified sensitive bands (e.g., 637.7 nm, 497.6 nm for N; 734 nm, 397.7 nm for P; 394.5 nm, 423.2 nm for K) provide a foundation for designing targeted sensors. Our results confirm that China UAV hyperspectral remote sensing is a powerful tool for non-destructive, high-frequency nutrient monitoring in oil-tea camellia plantations, supporting precision fertilization management and sustainable production. The integration of machine learning algorithms further enhances the predictive capability, offering a practical pathway for digital agriculture in China.

Scroll to Top