In our study, we aimed to develop a rapid, non-destructive, and accurate method for estimating the leaf nitrogen (N), phosphorus (P), and potassium (K) content in Camellia oleifera using unmanned aerial vehicle (UAV) hyperspectral imagery. The ability to frequently monitor foliar nutrient status is critical for precision fertilization management and improving the yield of oil tea. Leveraging drone technology equipped with a hyperspectral sensor, we collected high-resolution canopy reflectance data over three plantation sites with different fertilization regimes in Heyuan, Guangdong Province. By integrating these data with field-measured leaf NPK concentrations, we constructed partial least squares regression (PLSR) and random forest (RF) models and evaluated their performance using leave-one-out cross-validation.

1. Data Acquisition and Preprocessing
Our study area comprised three C. oleifera plots (each approximately 500 m long and 35 m wide) with distinct fertilization treatments: high‑nitrogen compound fertilizer, ordinary compound fertilizer, and urea. In September 2022, we randomly collected 100 mature leaves from each row within each plot. The leaf N, P, and K contents were determined using standard laboratory methods: Kjeldahl digestion for N, molybdenum blue spectrophotometry for P, and flame atomic absorption spectrophotometry for K. The descriptive statistics of the leaf NPK contents are summarized in the following table.
| Plot | N mean | N std | N range | P mean | P std | P range | K mean | K std | K range |
|---|---|---|---|---|---|---|---|---|---|
| 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 |
UAV hyperspectral images were acquired in April and May 2023 using a DJI M600 drone outfitted with a GaiaSKY-mini2 sensor (394.5–996.5 nm, 176 bands, spectral resolution 3.2 nm). Flights were conducted under clear skies between 10:00 and 14:00 at a height of 120 m with 50% side overlap. Radiometric calibration was performed using a white‑black reference panel before each flight, and atmospheric correction was applied using the sensor‑specific software SpecStitcher. To eliminate the confounding effects of bare soil and canopy shadows, we applied ISO unsupervised classification and post‑processing to the hyperspectral mosaics. The classified images were then used to extract the mean reflectance of each row per plot, which was paired with the corresponding leaf NPK data to form the modeling dataset.
2. Methods
2.1 Correlation Analysis
We first performed Pearson correlation analysis between leaf NPK contents and reflectance at each hyperspectral band. The results helped identify the spectral regions most sensitive to nutrient variations. For leaf N, significant positive correlations (p < 0.05) were found in the 413.6–520.6 nm and 577–651.3 nm ranges. Leaf P showed positive correlations in the 394.5–510.7 nm and 583.7–692.4 nm regions, and negative correlations in the 716.7–996.5 nm region. Leaf K exhibited a similar pattern: positive correlations in the 394.5–510.7 nm and 577–695.9 nm ranges, and negative correlations in the 737.5–926.6 nm range. However, correlation alone does not fully exploit the multivariate nature of hyperspectral data; hence we employed two machine learning approaches.
2.2 PLSR Model
Partial least squares regression (PLSR) is a linear dimensionality reduction technique that finds latent variables (components) maximizing the covariance between the predictor matrix (reflectance) and the response (NPK content). The model equation is:
$$
\mathbf{Y} = \mathbf{X} \mathbf{B} + \mathbf{E}
$$
where \(\mathbf{X}\) is the reflectance matrix, \(\mathbf{Y}\) the NPK content vector, \(\mathbf{B}\) the regression coefficients, and \(\mathbf{E}\) the residual. We tested models with 1 to 10 components and selected the optimal number based on the lowest RMSE, adjusted RMSE, and highest R² using leave‑one‑out cross‑validation.
2.3 Random Forest Model
Random forest (RF) is an ensemble learning method that builds multiple decision trees on bootstrapped samples and averages their predictions. It is robust to non‑linear relationships and multicollinearity. We trained RF models with 500 trees and used the %IncMSE (percentage increase in mean squared error) to rank variable importance.
2.4 Evaluation Metrics
We employed the following metrics to assess model performance:
$$
\text{RMSE} = \sqrt{\frac{\sum_{i=1}^{n} (\hat{Y}_i – Y_i)^2}{n}}
$$
$$
\text{RMSE}_{\text{adj}} = \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 value, \(\hat{Y}_i\) the predicted value, \(\bar{Y}\) the mean of measured values, \(n\) the number of samples, and \(k\) the number of PLSR components (for RF, \(k = 0\) in adjRMSE is equivalent to RMSE).
3. Results
3.1 PLSR Model Performance
The PLSR models were evaluated with varying numbers of latent components. The optimal component numbers were determined as 6 for N, 8 for P, and 8 for K, balancing low RMSE and high R². The detailed results for 1–10 components are shown below.
| Comps | N RMSE | N adjRMSE | N R² | P RMSE | P adjRMSE | P R² | K RMSE | K adjRMSE | K R² |
|---|---|---|---|---|---|---|---|---|---|
| 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 the optimal PLSR models, the top 20 important bands (based on absolute regression coefficients) are listed below.
| N model (6 comps) | coefficient | P model (8 comps) | coefficient | K model (8 comps) | 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.2 Random Forest Model Performance
The RF models achieved RMSE values of 0.70 mg/g for N, 0.09 mg/g for P, and 0.349 mg/g for K, with corresponding R² values of 0.84, 0.79, and 0.81. The variable importance (measured by %IncMSE) indicated that the most influential bands for leaf N were located near 637.7, 497.6, 661.5, and 468.3 nm. For leaf P, the top bands were 734.0, 397.7, 583.7, and 587.0 nm. For leaf K, the most important bands were 494.4, 504.2, 500.9, and 497.6 nm.
4. Discussion
Our results highlight the effectiveness of drone technology combined with machine learning for estimating leaf NPK content in C. oleifera. The PLSR and RF models both outperformed simple correlation analysis, demonstrating that multivariate approaches can extract more informative features from the high-dimensional hyperspectral data. Notably, the RF model yielded higher R² for N and P (0.84 and 0.79, respectively) compared to the PLSR model (0.74 and 0.85, respectively) under the same RMSE level, suggesting that non‑linear interactions are better captured by RF for these nutrients. Conversely, the PLSR model for K achieved the lowest RMSE (0.295 mg/g) and highest R² (0.86) among all models, indicating that linear relationships may be more dominant for K estimation in our dataset.
The spectral bands identified as important agree well with previous studies. For instance, the visible and red‑edge regions (e.g., 590–670 nm) are strongly associated with chlorophyll absorption, which is directly linked to nitrogen status. The near‑infrared bands (e.g., 716–734 nm) are influenced by leaf structure and water content, providing indirect information on phosphorus and potassium. The key advantage of using drone technology is its ability to provide high‑resolution spatial and temporal coverage, enabling frequent monitoring of nutrient status across large plantations. However, challenges remain, including the influence of canopy shadowing, soil background, and atmospheric conditions. In our work, we mitigated these effects through image classification and careful preprocessing.
We found that the most informative bands for N and P were often located in similar spectral regions, likely because these elements are co‑limited in many ecosystems and both affect pigment production and energy metabolism. The RF model placed greater weight on the blue‑green region (468–497 nm) for N, whereas the PLSR model emphasized the yellow‑red region (590–607 nm). For K, the PLSR model selected bands in the violet‑blue region (394–423 nm) as the most important, while the RF model focused on the green edge (494–504 nm). These differences underscore the complementarity of linear and non‑linear modeling approaches.
5. Conclusion
In this study, we demonstrated that drone technology equipped with a hyperspectral sensor can be used to accurately estimate leaf N, P, and K contents in Camellia oleifera. By comparing PLSR and random forest models, we found that RF performed better for N and P estimation, while PLSR was superior for K. The identified spectral bands—particularly in the visible, red‑edge, and near‑infrared regions—provide a scientific basis for developing targeted nutrient management strategies. The integration of drone technology with machine learning offers a practical, non‑destructive, and high‑frequency solution for precision fertilization in oil tea plantations, ultimately contributing to improved yield and fruit quality.
