Next Article in Journal
Fruit Orchard Canopy Recognition and Extraction of Characteristics Based on Millimeter-Wave Radar
Previous Article in Journal
Spatial-Temporal Coordination of Agricultural Quality and Water Carrying Capacity in Chengdu-Chongqing
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Hyperspectral Imaging for Non-Destructive Moisture Prediction in Oat Seeds

1
College of Computer and Information Engineering, Inner Mongolia Agricultural University, Hohhot 010018, China
2
INNER Mongolia Autonomous Region Key Laboratory of Big Data Research and Application of Agriculture and Animal Husbandry, Hohhot 010030, China
*
Author to whom correspondence should be addressed.
Agriculture 2025, 15(13), 1341; https://doi.org/10.3390/agriculture15131341
Submission received: 20 April 2025 / Revised: 25 May 2025 / Accepted: 18 June 2025 / Published: 22 June 2025
(This article belongs to the Section Digital Agriculture)

Abstract

Oat is a highly nutritious cereal crop, and the moisture content of its seeds plays a vital role in cultivation management, storage preservation, and quality control. To enable efficient and non-destructive prediction of this key quality parameter, this study presents a modeling framework integrating hyperspectral imaging (HSI) technology with a dual-optimization machine learning strategy. Seven spectral preprocessing techniques—standard normal variate (SNV), multiplicative scatter correction (MSC), first derivative (FD), second derivative (SD), and combinations such as SNV + FD, SNV + SD, and SNV + MSC—were systematically evaluated. Among them, SNV combined with FD was identified as the optimal preprocessing scheme, effectively enhancing spectral feature expression. To further refine the predictive model, three feature selection methods—successive projections algorithm (SPA), competitive adaptive reweighted sampling (CARS), and principal component analysis (PCA)—were assessed. PCA exhibited superior performance in information compression and modeling stability. Subsequently, a dual-optimized neural network model, termed Bayes-ASFSSA-BP, was developed by incorporating Bayesian optimization and the Adaptive Spiral Flight Sparrow Search Algorithm (ASFSSA). Bayesian optimization was used for global tuning of network structural parameters, while ASFSSA was applied to fine-tune the initial weights and thresholds, improving convergence efficiency and predictive accuracy. The proposed Bayes-ASFSSA-BP model achieved determination coefficients (R2) of 0.982 and 0.963, and root mean square errors (RMSEs) of 0.173 and 0.188 on the training and test sets, respectively. The corresponding mean absolute error (MAE) on the test set was 0.170, indicating excellent average prediction accuracy. These results significantly outperformed benchmark models such as SSA-BP, ASFSSA-BP, and Bayes-BP. Compared to the conventional BP model, the proposed approach increased the test R2 by 0.046 and reduced the RMSE by 0.157. Moreover, the model produced the narrowest 95% confidence intervals for test set performance (Rp2: [0.961, 0.971]; RMSE: [0.185, 0.193]), demonstrating outstanding robustness and generalization capability. Although the model incurred a slightly higher computational cost (480.9 s), the accuracy gain was deemed worthwhile. In conclusion, the proposed Bayes-ASFSSA-BP framework shows strong potential for accurate and stable non-destructive prediction of oat seed moisture content. This work provides a practical and efficient solution for quality assessment in agricultural products and highlights the promise of integrating Bayesian optimization with ASFSSA in modeling high-dimensional spectral data.

1. Introduction

Oat (Avena sativa L.) is a highly nutritious whole grain crop, rich in protein, dietary fiber, vitamins, and minerals, and is widely used in food processing and functional food development. The moisture content of [1] oat seeds is a key parameter that affects storage stability, processing adaptability, and quality grading. Accurately and rapidly obtaining moisture information is of great significance for grain storage, deep processing, and quality control.
Currently, commonly used moisture detection methods include oven drying [2], Karl Fischer titration [3], and capacitive moisture meters [4]. Although these methods perform well in terms of measurement accuracy, they generally suffer from long detection cycles, complex operations, destructiveness, and difficulty in achieving online monitoring, making them insufficient to meet the practical demands of modern agriculture for efficient, non-destructive, and automated detection.
In recent years, with the development of agricultural informatization and smart sensing technologies [5], non-destructive detection methods based on near-infrared spectroscopy (NIR) and hyperspectral imaging (HSI) have gained widespread attention. HSI combines the advantages of both imaging and spectral analysis, enabling the simultaneous acquisition of the spatial and spectral information of samples. It is characterized by its high dimensionality, visualization and non-contact and non-destructive detection, and has been widely applied in moisture and nutrient content modeling for crops such as wheat, corn, and rice. For instance, Li et al. used HSI [6] combined with partial least squares regression (PLSR) to rapidly predict moisture content in wheat grains; Caporaso et al. studied the relationship between near-infrared spectral features and moisture content in oat flour under different baking conditions [7]; and Mahesh et al. combined NIR with support vector machines (SVMs) [8] for moisture modeling in grains, demonstrating the feasibility and potential of machine learning methods.
Despite the progress made in previous studies, several challenges remain in the non-destructive moisture detection modeling of oats: (1) traditional regression models such as PLSR and SVM have a limited ability to fit complex nonlinear relationships; (2) hyperspectral data suffer from severe dimensional redundancy, and improper feature selection may lead to overfitting and model instability; and (3) modeling processes are often confined to local optimization, lacking coordinated regulation of preprocessing, feature selection, and model structure parameters.
To address the aforementioned challenges, this study proposes a hyperspectral modeling method that integrates a multi-stage optimization strategy for non-destructive moisture detection in oat seeds. To overcome the issue of local optima in traditional backpropagation (BP) neural networks, a dual-optimization framework, Bayes-ASFSSA-BP, is designed, combining Bayesian optimization [9] with the Adaptive Spiral Flight Sparrow Search Algorithm (ASFSSA) [10]. This model employs Bayesian optimization for the global hyperparameter search, while ASFSSA is used to fine-tune the initial weights and thresholds of the BP network, thereby improving both the search efficiency and modeling performance in a coordinated manner.
In conclusion, the Bayes-ASFSSA-BP framework integrates Bayesian optimization with the Adaptive Spiral Flight Sparrow Search Algorithm to resolve local optima and data redundancy [11] in hyperspectral modeling. This method improves oat seed moisture prediction accuracy and stability, providing a new approach for efficient, non-destructive moisture detection and supporting agricultural informatization and intelligent monitoring technologies.

2. Materials and Methods

2.1. Seed Sample Preparation

To investigate the moisture characteristics of oat seeds, eight representative oat cultivars were collected on 3 October 2024 from the oat breeding experimental base located in Wuchuan County, Hohhot, Inner Mongolia, China. These cultivars included four hulled oat varieties (Dingyan 2, Baiyan 6, Baiyan 12, and Baiyan 23) and four hulless oat varieties (Bayou 6, Bayou 3, Bayou 17, and Pinyan 7), representing the dominant types widely cultivated across northern China. These materials exhibited well-defined genetic backgrounds and stable regional adaptability, making them highly representative for both breeding promotion and field production. To improve data consistency and enhance spectral modeling performance, typical samples with moisture contents ranging from 12% to 16% were selected. This range corresponds to the harvest moisture levels of dominant cultivars in the region and helps to avoid extreme values that may compromise model robustness. The morphological characteristics of the seeds from each cultivar are shown in Figure 1.
For each cultivar, 20 independent samples were collected, with each sample weighing approximately 200 g. Circular Petri dishes with a diameter of 10 cm and a depth of 1 cm (manufactured by Jingda Laboratory Equipment Co., Ltd., Taizhou, Jiangsu, China) were used to evenly spread the seeds for subsequent hyperspectral imaging. To ensure sample quality and data reliability, damaged, diseased, germinated, or malformed seeds were manually removed. The remaining seeds were then sieved using a standard vibrating sieve (model XFS-200, 2.0 mm aperture, manufactured by Xinbiaozhun Analytical Instrument Co., Ltd., Shanghai, China) to retain only uniformly sized and well-filled seeds.
The selected seeds were rinsed twice with deionized water (30 seconds each) while gently stirred to remove surface impurities. After rinsing, the seeds were spread on clean filter paper and air-dried at room temperature (22 ± 2 °C) for 12 hours until no visible surface moisture remained.
Following drying, all samples were vacuum-sealed in aluminum foil bags using a laboratory vacuum packaging machine (model SK-201B, manufactured by Shuke Instrument Co., Ltd., Chengdu, Sichuan, China) and stored at 3–5 °C to maintain moisture stability and prevent deterioration. Prior to experimentation, the samples were removed from cold storage, equilibrated at room temperature for 1 hour, and thoroughly mixed to ensure sample uniformity and representativeness for model development.

2.2. Moisture Determination by Gravimetric Method

The moisture content of oat seeds was determined using the oven-drying method. Seed samples were dried in an electric thermostatic blast drying oven at 85 °C (model: DHG-9070A, manufactured by Shanghai Hengke Scientific Instrument Co., Ltd., Shanghai, China ) for 48 h. After drying, the samples were cooled to room temperature in a desiccator and subsequently weighed. The moisture content (mass fraction) was calculated based on the difference in weight before and after drying using the following equation:
s = m 2 m 1 m 2 × %
S—moisture content of the sample (%); m1—mass before drying (g); m2—mass after drying (g).
Table 1 presents the mass before and after drying, as well as the corresponding moisture content of the eight oat varieties. The results indicate significant variation in moisture levels among the samples, ranging from 12.13% to 16.02%, providing a reliable reference basis for subsequent model training.

2.3. Hyperspectral Image Acquisition and Data Processing

To ensure the accuracy and stability of hyperspectral imaging [12] data, all experiments were conducted in a completely dark environment to eliminate interference from ambient stray light.As shown in Figure 2, the hyperspectral images were acquired using a Specim FX10 imaging system, which covers a spectral range of 400–1000 nm with a spectral resolution of 4.8 nm and comprises a total of 125 spectral bands.A Specim FX10 hyperspectral imaging system was used for image acquisition, with a spectral range of 400–1000 nm, a spectral resolution of 4.8 nm, and a total of 125 spectral bands. The spatial resolution was 1024 × 2048 pixels. Each sample was placed in a glass container lined with black velvet to reduce background reflection and maintain image background consistency.
Under the above imaging system and controlled conditions, a total of 160 hyperspectral images were collected from eight representative oat cultivars, with 20 images per cultivar. To ensure sample independence, each image corresponded to a distinct batch of seeds, which were evenly spread in circular Petri dishes with a diameter of 10 cm and a depth of 1 cm. All images were acquired independently under varying experimental conditions to avoid data redundancy and systematic bias caused by repeated imaging.
No manual or subjective filtering was applied during the image processing stage; all captured images were included in the subsequent analysis. Otsu’s adaptive thresholding method was employed to automatically segment seed regions from the background, based on which regions of interest (ROIs) were defined. Each ROI corresponded to a complete, non-overlapping individual seed and was treated as an independent sample. An ROI typically consisted of a cluster of pixels covering the surface of a single oat seed, from which the average reflectance spectrum was extracted. To eliminate background noise, debris, or non-target areas, only contiguous regions with an area between 30 and 80 mm2 were retained as valid ROIs.
To enhance spatial sampling uniformity and reduce systematic bias, a stratified sampling strategy was adopted for ROI selection: each image was divided into several grid regions, and one ROI was randomly selected from each grid. To further improve the diversity and independence of spectral samples, all extracted ROIs were subjected to principal component analysis (PCA) and clustering to identify and remove highly similar redundant samples. On average, approximately 10 valid ROIs were extracted from each image, resulting in a total of 1600 high-quality spectral samples. These samples ensured both representativeness and diversity, providing a solid data foundation for subsequent modeling and analysis.As shown in Figure 3, the raw spectral curves of oat samples were obtained.

2.4. Data Preprocessing

To avoid data leakage and performance overestimation caused by the presence of samples from the same Petri dish in both the training and test sets, this study used individual hyperspectral images as the unit of data partitioning. All regions of interest (ROIs) extracted from a single image were assigned exclusively to either the calibration (training) set or the prediction (test) set. The dataset was split in a 7:3 ratio, and a stratified random sampling strategy was employed to ensure that the distribution of oat cultivars and their associated moisture levels remained consistent across both subsets. This approach effectively reduced sampling bias and improved the generalization capability of the models.
During hyperspectral image acquisition, factors such as environmental light fluctuations, surface heterogeneity of the samples, and light scattering can lead to baseline drift, noise interference, and spectral distortion, thereby compromising the accuracy and robustness of subsequent modeling. To enhance the quality of spectral data and improve feature representation, this study systematically evaluated several commonly used preprocessing techniques from the perspectives of baseline correction [13], noise suppression [14], and feature enhancement. These techniques included multiplicative scatter correction (MSC) [15], standard normal variate transformation (SNV) [16], first derivative (FD) [17], second derivative (SD), and their combinations (e.g., SNV + FD and SNV + SD).
After spectral preprocessing, partial least squares regression (PLSR) was employed to establish preliminary regression models. Model performance was primarily evaluated using the mean squared error (MSE) and coefficient of determination (R2). The results demonstrated that the combination of SNV and FD offered the best overall performance in eliminating baseline drift, reducing random noise, and enhancing informative spectral features, thereby significantly improving model prediction accuracy.
To further prevent information leakage arising from shared training data between preprocessing optimization and model evaluation, a nested cross-validation strategy was implemented. The outer loop used a leave-one-dish-out approach to assess the generalization ability of the models, while the inner loop compared different preprocessing combinations within the training set to identify the optimal preprocessing scheme. Ultimately, the SNV + FD combination was confirmed as the most effective preprocessing method for this study and was subsequently applied in the downstream feature extraction and modeling processes.

2.5. Feature Selection Method

This study systematically compared three typical dimensionality reduction methods: successive projections algorithm (SPA), competitive adaptive reweighted sampling (CARS), and principal component analysis (PCA) [18]. Among them, PCA demonstrated superior performance in compressing the feature space, eliminating redundant information, and enhancing model stability. By linearly transforming the original high-dimensional spectral data into a set of uncorrelated principal components, PCA effectively reduced multicollinearity among variables, accelerated model convergence, and improved predictive accuracy.
It is worth noting that PCA extracts latent components rather than actual wavelengths, which to some extent limits the physical interpretability of the results and may increase the risk of model overfitting. To comprehensively evaluate the generalization capability of these methods, their predictive performances were further assessed on an external independent test set. The results showed that, although SPA and CARS offer strong physical interpretability in wavelength selection, their prediction performance on external samples was relatively weaker, indicating limited generalization ability.
In addition, a quantitative comparison was conducted by integrating the explained variance ratio with multiple model performance metrics, further supporting the differentiation among the tested methods.
In summary, despite certain limitations in interpretability, PCA demonstrated overall advantages in model accuracy, robustness, and computational efficiency. Therefore, it was ultimately selected as the dimensionality reduction method for this study and was applied in subsequent modeling analysis. A schematic illustration of the PCA principle is shown in Figure 4.

2.6. Modeling Method

2.6.1. BP Neural Network Model

The backpropagation (BP) neural network [19] is a feedforward network optimized through error backpropagation, suitable for complex nonlinear tasks. In this study, the BP model was built using MLPRegressor and optimized with GridSearchCV [20]. PCA-extracted principal components were used as input features. Key parameters included a maximum of 100 iterations, ReLU or Tanh activation function, regularization coefficient α (0.0001 to 0.01), learning rate strategy (“constant” or “adaptive”), and single- or double-layer structures (e.g., 50, 100 or 50, 50). The optimal parameters were selected through five-fold cross-validation for high-accuracy moisture prediction.

2.6.2. SSA-BP Model

This study improves BP neural network optimization by introducing the Sparrow Search Algorithm (SSA), forming the SSA-BP model. SSA, a population-based algorithm simulating sparrow behaviors, offers strong global search capability. By optimizing initial weights and thresholds, SSA avoids local optima, enhancing convergence and prediction accuracy. The SSA-BP model uses network prediction error as the fitness function for iterative parameter search. Key parameters include a population size of 30, 100 iterations, a 20% discoverer ratio, and a 0.6 early-warning threshold. The optimal parameters enhance BP model performance and stability. Experimental results show that SSA-BP outperforms the basic BP model in moisture prediction, confirming SSA’s effectiveness in hyperspectral modeling.

2.6.3. ASFSSA-BP Model

An enhanced ASFSSA-BP optimization model was developed by integrating the improved Adaptive Spiral Flight Sparrow Search Algorithm (ASFSSA). ASFSSA incorporates tent chaotic mapping [21], adaptive weight adjustment, Lévy flight perturbation [22], and a spiral path updating mechanism, enhancing population diversity and global search ability for BP network optimization. The ASFSSA was configured with a population size of 30, 100 iterations, and a 20% discoverer ratio. Tent chaotic mapping initialized the population, Lévy distribution updated step sizes, and a spiral function adjusted individual trajectories during the search. The fitness function, defined as the BP network’s mean squared error (MSE), guided the optimization process.
z i + 1 = 2 z i + r a n d ( 0 , 1 ) × 1 N , 0 z 1 2 , 2 ( 1 z i ) + r a n d ( 0 , 1 ) × 1 N , 1 2 z 1
Here, z i denotes the variable value of the i-th iteration or individual, defined within the interval [0, 1]; z i + 1 represents the next-generation variable value derived from z i ; rand(0, 1) refers to a uniformly distributed random number generated from the interval (0, 1); and N is a positive integer used to control the scaling magnitude of the perturbation term, typically representing the population size or a disturbance factor. The expression 2 × ( 1 z i ) defines a symmetric mapping function that maps the interval [1/2, 1] to [0, 1/2], aiming to enhance the balance and global coverage capability during initialization.
ASFSSA achieves a dynamic balance between global exploration and local exploitation by introducing an adaptive weight mechanism during the search phase, inspired by the dynamic inertia weights in Particle Swarm Optimization (PSO). The weight update formula is as follows:
w ( t ) = 0.2 cos π 2 × 1 t i t e r max
Here, w(t) denotes the weight coefficient at the t-th iteration, itermax represents the maximum number of iterations, and π is the mathematical constant pi. The cosine term is employed to achieve a smooth transition from a larger to a smaller weight, thereby enhancing the algorithm’s exploration capability in the early stages and its convergence performance in the later stages.
Based on the aforementioned mechanisms, the position update formula for discoverers in the improved algorithm is expressed as follows:
X i , j t + 1 = w ( t ) × X i , j t × exp i α × i t e r max , i f   R 2 < S T , w ( t ) × X i , j t + Q × L , i f   R 2 S T .
In this context, X i , j t denotes the position of the i-th individual in the j-th dimension during the t-th iteration, while X i , j t + 1 represents its updated position in the (t + 1)-th iteration. w(t) is a dynamic weight coefficient associated with the iteration count t, typically varying based on a cosine function. i is the index of the individual, usually ranging within [1, N]. α is a scaling factor that controls the rate of exponential decay and is generally set as an empirical constant. itermax denotes the maximum number of iterations. R2 is a random number drawn from the interval (0, 1), used to determine the branch of the update strategy. ST is the alarm threshold, typically ranging between 0 and 1, indicating the proportion of individuals triggering the warning mechanism. Q is a random variable following a standard normal distribution. L is a length vector that controls the direction and magnitude of the search step size.
To enhance the discoverer’s jumping ability and global search efficiency, ASFSSA further incorporates the Lévy flight strategy, with the position update formula expressed as follows:
x i ( t ) = x i ( t ) + l l e v y ( λ )
In this context, x i ( t ) represents the position of the i-th individual during the t-th iteration, and x i ( t ) denotes the new position generated after applying a Lévy flight perturbation. l is the step size coefficient used to control the magnitude of the perturbation. Levy(λ) denotes a random variable following a Lévy distribution, where λ ∈ (1, 3] is the stability index. The symbol ⊕ indicates element-wise perturbation operations, typically implemented as the Hadamard product or vector addition.
In the follower search strategy, ASFSSA integrates the spiral updating mechanism from the Whale Optimization Algorithm [23] to construct a variable-structure spiral flight path, thereby enhancing its local search capability and path diversity. The position update formula is as follows:
X i , j t + 1 = e z l × cos ( 2 π l ) × Q × exp ( X w o r s t t X i , j t i 2 ) , i f         i > n 2 X P t + 1 + X i , j t X P t + 1 × A + × L × e z l × cos 2 π l , o t h e r w i s e z = e k × cos ( π × ( 1 ( i i max ) ) ) .
In this context, X i , j t represents the position of the i-th individual in the j-th dimension during the t-th iteration, while X i , j t + 1 denotes its updated position in the next generation. X w o r s t t indicates the position of the worst-performing individual in the current iteration, and X P t + 1 refers to the guiding individual’s position, typically chosen as the current best-performing individual. ε is a perturbation adjustment factor used to regulate the update magnitude. L is a search step vector that controls the direction and scale of the perturbation. l denotes the perturbation frequency parameter within the cosine function. Q is a random variable following a standard normal distribution. z is a dynamic adjustment factor with nonlinear variation, where k is the exponential control parameter, i is the index of the current individual, and imax denotes the maximum individual index or the maximum dimensional value. In addition, n represents the population size, and t and t + 1 correspond to the current and next iteration numbers, respectively.
In summary, ASFSSA integrates chaotic initialization, adaptive weights, Lévy flight, and spiral search strategies to construct an optimization framework with both global exploration and local exploitation capabilities. This algorithm effectively overcomes the limitations of the original SSA, such as its susceptibility to local optima and limited search diversity, significantly improving stability and convergence efficiency.

2.6.4. Bayes-BP Model

To enhance the optimization capability of the BP neural network, this study introduces Bayesian optimization to adjust the hidden layer size and learning rate. Bayesian optimization performs a global search for optimal hyperparameters, minimizing the root mean square error (RMSE). The model is trained using the Adam optimizer [24] for 400 epochs, with a patience value set to 50, meaning training will stop early if there is no improvement in the loss after 50 epochs. The optimal hyperparameters obtained through Bayesian optimization are used for BP network initialization, improving the model’s prediction accuracy and convergence speed. Experimental results demonstrate that the Bayes-BP model significantly outperforms the baseline BP model in moisture prediction tasks, validating the effectiveness of Bayesian optimization in hyperspectral modeling.

2.6.5. Bayes-ASFSSA-BP Model

Based on the above optimization strategy, this study proposes a dual-stage collaborative optimization model, Bayes-ASFSSA-BP, designed to jointly optimize both the structural hyperparameters and initial weights of the BP neural network. The model integrates the local search capability of the improved Sparrow Search Algorithm (ASFSSA) for weight initialization with the global search efficiency of Bayesian optimization (BO) for hyperparameter tuning, thereby enhancing overall network performance.
The optimization process consists of two stages. In the first stage, ASFSSA is employed to optimize the initial weights and thresholds of the BP network. The population size is set to 30, with a maximum of 100 iterations and 20% of the population designated as discoverers. Initialization is performed using a tent map, combined with Lévy flight and spiral search strategies to enhance both global and local exploration. The parameter search space is set to [−1, 1], and the dimensionality is determined by the network structure. The root mean square error (RMSE) is used as the objective function, and convergence is defined as either the maximum number of iterations being reached or the improvement in RMSE falling below 1 × 10⁴ between successive generations.
In the second stage, Bayesian optimization is used to further search for network hyperparameters, including the number of neurons in the hidden layer, learning rate, and number of network layers. The search space is defined with a hidden layer size [50, 150] and learning rate [0.01, 0.2]; for comparison experiments, narrower ranges of [5, 20] and [1 × 10⁵, 1 × 10−2] are also tested. A Gaussian Process is used as the surrogate model, with a maximum of 20 evaluations. Early stopping is triggered if the improvement in RMSE is less than 1 × 10⁴ between evaluations.
In the hyperparameter optimization process, a fixed activation function configuration was adopted. Specifically, the tansig (hyperbolic tangent sigmoid) function was used in the hidden layer for nonlinear mapping, while the purelin (linear) function was applied in the output layer to support continuous output regression tasks. Although activation functions were not included in the BO search space, this configuration has been widely validated in the literature and practice as a stable and effective structure for BP-based regression models.
Overall, the optimization framework jointly achieves structural and parameter-level tuning with RMSE minimization as the objective, significantly enhancing the prediction accuracy, robustness, and generalization ability of the BP neural network. The overall workflow is illustrated in Figure 5.

2.7. Performance Metrics

To evaluate the model’s prediction accuracy and computational efficiency, this study uses the root mean square error (RMSE), R-squared (R2) [25], and runtime (Time) as performance metrics. RMSE measures the deviation between the predicted and actual values, with smaller values indicating higher accuracy. R2 indicates the goodness of fit, with values closer to 1 representing better fitting. Runtime reflects the training time, with shorter times indicating higher computational efficiency and faster convergence. The formulas for these metrics are as follows:
The formula for calculating the root mean square error (RMSE) is as follows:
R M S E = 1 M i = 1 m y i y ^ 2
The formula for calculating the R-squared (R2) is as follows:
R 2 = 1 i = 1 m y i y ^ 2 i = 1 m ( y ¯ y i ) 2
The formula for calculating the runtime is as follows:
T i m e = e n d s t a r t
In the formula, y i represents the true observed values, y ^ represents the predicted values, y ¯ represents the mean of the true observed values, end represents the end time, and start represents the start time.

3. Results and Discussion

3.1. Preprocessing Results and Discussion

To address issues such as baseline drift, spectral overlap, and high-frequency noise in the raw hyperspectral data, this study introduces several preprocessing methods for systematic processing of the spectral data. These methods include standard normal variate (SNV), multiplicative scatter correction (MSC), first derivative (FD), second derivative (SD), and their combined strategies (SNV + MSC, SNV + FD, and SNV + SD), with the processing results shown in Figure 6.
Figure 6a,b shows the baseline correction effects of SNV and MSC. Both methods effectively eliminate vertical shifts between spectra in the 500 nm to 900 nm range, resulting in more consistent spectral distributions across different samples. However, Figure 6b still exhibits some fluctuations around 1000 nm, indicating that the scattering correction capability of MSC in the mid- to far-infrared region is slightly weaker than that of SNV (Figure 6a).
Figure 6c,d demonstrates the performance of FD and SD in enhancing spectral details. While both methods amplify high-frequency information, they also introduce noticeable fluctuations in the spectral curves, particularly in the edge regions (e.g., 400–500 nm and 950–1000 nm). The high-frequency noise is not fully suppressed, leading to decreased overall spectral stability.
Figure 6e–g illustrates the effects of three combined strategies. Specifically, SNV + MSC (Figure 6e) enhances overall consistency but does not significantly highlight detailed features. SNV + FD (Figure 6f) not only achieves good baseline correction across the entire spectral range but also clearly preserves significant feature variations in moisture-sensitive regions such as 700–900 nm. In contrast, SNV + SD (Figure 6g) still exhibits considerable high-frequency fluctuations. The spectral curve for SNV + FD remains stable with minimal noise interference, demonstrating superior spectral discernibility.
To quantitatively assess the impact of each preprocessing strategy on the modeling performance, this study constructed models based on the preprocessed data, using the mean squared error (MSE) and coefficient of determination (R²) as evaluation metrics. The results, shown in Table 2, indicate that the SNV + FD method outperforms all other methods across all evaluation metrics (MSE = 0.19, R² = 0.88), demonstrating the strongest modeling adaptability and stability. In summary, SNV + FD performs best in baseline drift correction, feature enhancement, and noise suppression, making it the optimal spectral preprocessing method for this study. It will be used in subsequent feature selection and modeling analysis.

3.2. Feature Selection Results

To address the issue of dimensional redundancy in hyperspectral data [26] and improve modeling performance, this study compared three representative feature selection methods: successive projections algorithm (SPA) [27], competitive adaptive reweighted sampling (CARS), and principal component analysis (PCA) [28]. Each method was combined with a BP neural network for modeling, and their performance was comprehensively evaluated based on prediction accuracy, confidence intervals, and training time.
PCA effectively reduced the original 200-dimensional spectral data to 60 principal components while retaining 95.2% of the cumulative explained variance. This dimensionality reduction was achieved without compromising modeling performance. As shown in Table 3, the SNV + FD-PCA-BP model achieved the highest coefficient of determination (R2 = 0.908) and the lowest root mean square error (RMSE = 0.163) in cross-validation. The corresponding 95% confidence intervals were [0.903, 0.913] for R2 and [0.150, 0.197] for RMSE, indicating excellent stability and predictive accuracy (see Figure 7).
In contrast, although SPA and CARS offer certain physical interpretability by selecting actual wavelengths, their modeling performance was inferior to that of PCA. Specifically, the SNV + FD-CARS-BP and SNV + FD-SPA-BP models yielded R2 values of 0.894 and 0.882, and RMSE values of 0.232 and 0.497, respectively, with wider confidence intervals, suggesting less model stability and a weaker generalization ability.
On the external independent test set, PCA again demonstrated the best performance, achieving an R2 of 0.918 and an RMSE of 0.262, outperforming CARS (R2 = 0.893, RMSE = 0.232) and SPA (R2 = 0.782, RMSE = 0.345) (see Table 4). PCA also exhibited narrower confidence intervals—[0.914, 0.923] for R2 and [0.249, 0.295] for RMSE—and smaller error fluctuations, further confirming its strong generalization capability.
Although PCA retains latent components rather than actual wavelength variables and thus has limitations in interpretability, its advantages in modeling accuracy, stability, and overall performance were significantly superior to those of the other methods. Therefore, PCA was selected as the optimal variable selection strategy in this study and was applied in the subsequent modeling analysis.
To identify key wavelengths closely associated with moisture variation, this study performed a loading analysis on the preprocessed hyperspectral data using principal component analysis (PCA). As shown in Figure 8, the eigenvalue distribution (Figure 8a) indicates that the first two principal components explain the majority of spectral variance [29], demonstrating a significant information compression effect. Further examination of the loading curves for PC1 and PC2 (Figure 8b,c) reveals prominent peaks at 680 nm, 735 nm, 780 nm, 865 nm, 907 nm, and 988 nm, suggesting that these wavelengths contribute substantially to the construction of the principal components.
The spectral characteristics of these wavelengths provide meaningful physical insights. Specifically, 680 nm and 735 nm lie within the visible to red-edge region, which is typically associated with chlorophyll content and water status. In contrast, the 780–988 nm range falls within the near-infrared region, encompassing strong water absorption bands widely used in crop moisture estimation and physiological monitoring. Therefore, these wavelengths can be regarded as moisture-sensitive features with clear spectral and physical relevance.
It should be noted that, in this study, no differentiation was made among crop varieties or sample categories during modeling. All data were treated as a unified dataset. As a result, the identified key wavelengths primarily reflect the dominant trends of moisture variation across the overall sample population and may not fully capture variety-specific spectral responses.

3.3. Comparison Results of BP-Based Prediction Models

To systematically evaluate model performance in the task of oat seed moisture prediction, five models were developed in this study: the baseline BP neural network (BP), a model optimized using the Sparrow Search Algorithm (SSA-BP), an enhanced version incorporating adaptive strategies (ASFSSA-BP), a model with Bayesian optimization (Bayes-BP), and the proposed dual-optimization fusion model (Bayes-ASFSSA-BP). Table 5 summarizes each model’s performance in terms of the coefficient of determination (R²), root mean square error (RMSE), mean absolute error (MAE), 95% confidence interval (CI) [30], and runtime on both the training and test sets.
(1) Performance analysis of the baseline BP model
The baseline BP model achieved R2 values of 0.922 and 0.917 on the training and test sets, respectively, with RMSE values of 0.257 and 0.345. The corresponding 95% confidence intervals were [0.912, 0.928] and [0.339, 0.351]. The model yielded a test MAE of 0.276, indicating a moderate level of average deviation. These results indicate that while the model possesses basic fitting ability, the relatively high error on the test set suggests limited generalization and a tendency toward overfitting [31]. This highlights the BP model’s limitations in handling high-dimensional spectral data, and points to the need for further optimization of the network structure and initial parameters.
(2) Improvement via SSA (SSA-BP)
The SSA-BP model reduced the RMSE on the test set to 0.216 (CI: [0.210, 0.222]) and achieved an R2 of 0.902 (CI: [0.901, 0.915]), with a corresponding MAE of 0.208, demonstrating that the Sparrow Search Algorithm effectively enhanced the model’s predictive ability. However, the performance on the training set remained largely unchanged, indicating that the improvement mainly benefits generalization. Nonetheless, the model still suffers from instability in the search process and susceptibility to local optima. The runtime was recorded at 130.2 s.
(3) Enhanced model with adaptive strategy (ASFSSA-BP)
The ASFSSA-BP model achieved R2 values of 0.973 (training) and 0.954 (testing), with RMSEs of 0.197 and 0.478, respectively. The corresponding confidence intervals were [0.953, 0.964] for R2 and [0.472, 0.482] for RMSE. The model’s MAE on the test set was 0.382, the highest among the five models, suggesting that although the fitting ability was significantly improved, the error distribution was slightly more dispersed. These results demonstrate that the model significantly improved fitting ability and alleviated the local optima issue inherent in the original SSA, enhancing global search performance. However, the runtime increased to 203.3 s, indicating a higher computational cost [32].
(4) Bayesian optimization model (Bayes-BP)
The Bayes-BP model achieved an R2 of 0.939 and RMSE of 0.554 on the training set. On the test set, the R2 was 0.924 (CI: [0.917, 0.929]) and RMSE was 0.395 (CI: [0.386, 0.395]), with an MAE of 0.326. Although the network structure was effectively optimized, the model lacked initial weight optimization, leading to unstable performance on the test set and a risk of getting trapped in local minima. The runtime was 315.7 s.
(5) Comprehensive advantages of the Bayes-ASFSSA-BP model
The Bayes-ASFSSA-BP model achieved the highest R2 values of 0.982 (training) and 0.963 (testing), along with the lowest RMSE values of 0.173 and 0.188. The corresponding confidence intervals were Rp2 [0.961, 0.971] and RMSEp [0.185, 0.193], the narrowest among all models. It also achieved the lowest MAE of 0.170, indicating superior prediction stability and minimal fluctuation. Although the runtime was the longest at 480.9 s, this computational cost is justified by the significant improvements in accuracy and robustness. The synergistic effect of dual optimization—combining ASFSSA for initial weight optimization with Bayesian optimization for fine-tuning the network structure—enabled this model to achieve an optimal balance between performance and stability.
In summary, the Bayes-ASFSSA-BP model outperformed all other models in terms of prediction accuracy, model stability, and generalization capability, demonstrating strong application potential and scalability in oat seed moisture prediction and other hyperspectral modeling tasks.
Figure 9 illustrates the prediction performance of each model on the training and testing sets, with the x-axis representing the actual moisture content and the y-axis representing the predicted values. Blue points represent training samples, while red points represent testing samples. As optimization strategies are introduced, the distribution of prediction points gradually approaches the ideal diagonal, significantly improving the model’s fitting performance. The basic BP model (Figure 9a) shows a scattered distribution of prediction points with noticeable bias; after introducing SSA (Figure 9b), the points become more concentrated, and fitting accuracy improves. The Bayes-BP model (Figure 9c) fits well on the training set, but there is still some bias on the testing set. The ASFSSA-BP model (Figure 9d) shows stable performance with a concentrated distribution of points on both the training and testing sets. The Bayes-ASFSSA-BP model (Figure 9e) achieves the closest alignment to the diagonal with the smallest error and the best fitting performance on both datasets, demonstrating superior accuracy, robustness, and generalization capability compared to the other models.

3.4. Detailed Analysis of the Bayes-ASFSSA-BP Model

To comprehensively evaluate the performance of the proposed Bayes-ASFSSA-BP model in modeling oat seed moisture content, a systematic analysis was conducted from multiple perspectives, focusing on regression fitting ability and error characteristics.
As shown in Figure 10, the predicted values by the model exhibit a high degree of agreement with the measured values across the training, validation, test, and full datasets, with data points closely aligned along the ideal diagonal line. The corresponding correlation coefficients (R) were 0.982 (training set), 0.973 (validation set) [33], 0.963 (test set), and 0.978 (full dataset), indicating excellent fitting accuracy and strong generalization capability under different data partitions.
Further insights are provided in Figure 11, which presents sample-wise prediction results for both the training and test sets. In these plots, the red curve represents the measured moisture values, while the blue curve shows the predicted values. The results reveal that the model achieved R2 = 0.982 and RMSE = 0.173 on the training set, and R2 = 0.963 and RMSE = 0.188 on the test set, confirming not only strong fitting performance on seen samples but also robust predictive ability on unseen data. These findings validate the model’s adaptability and robustness in hyperspectral modeling tasks.
To further analyze the distribution characteristics and potential systematic bias of the model’s prediction errors, Figure 12 present the Bland–Altman plot and the residual plot based on the full dataset. The residual plot shows that most prediction errors fall within the range of ±0.3 and are evenly distributed around zero, with no noticeable deviation trend. The Bland–Altman plot reinforces this observation, indicating a mean prediction error of −0.005 and 95% limits of agreement (LoAs) ranging from [−0.287, 0.277]. The vast majority of sample errors fall within this interval, demonstrating that the model possesses strong predictive consistency and robustness across the entire sample space.
In summary, the Bayes-ASFSSA-BP model demonstrates outstanding performance in terms of fitting accuracy, error stability, and generalization capability, confirming its feasibility and practical value as an efficient and robust tool for hyperspectral moisture content prediction.

4. Conclusions

This study proposes a non-destructive [34] method for predicting oat seed moisture content by integrating hyperspectral imaging with a dual-optimization machine learning algorithm [35]. Through a systematic comparison of seven spectral preprocessing strategies, the combination of standard normal variate (SNV) transformation and first derivative (FD) was identified as the optimal approach, significantly enhancing the expressive power of spectral features. Subsequently, principal component analysis (PCA) was employed for effective dimensionality reduction of the high-dimensional spectral data, which not only preserved critical information but also reduced modeling complexity and improved both the stability and generalization capability of the models.
To further enhance modeling accuracy, a Bayes-ASFSSA-BP dual-optimization model was developed by integrating Bayesian optimization with an Adaptive Spiral-Flight Sparrow Search Algorithm (ASFSSA). In this framework, Bayesian optimization performs a global search for optimal structural hyperparameters, while ASFSSA fine-tunes the initial weights and thresholds of the BP neural network. This synergistic strategy substantially improves the robustness and learning capability of the network in high-dimensional nonlinear modeling tasks. Experimental results demonstrated that the Bayes-ASFSSA-BP model achieved coefficients of determination (R2) of 0.982 and 0.963 on the training and test sets, respectively, with corresponding RMSE values of 0.173 and 0.188—outperforming the conventional BP model and other optimized variants. The model also exhibited the narrowest 95% confidence intervals on the test set (Rp2: [0.961, 0.971]; RMSEp: [0.185, 0.193]), indicating its superior stability and generalization ability [36].
In conclusion, the Bayes-ASFSSA-BP model demonstrated outstanding performance and strong application potential in oat seed moisture prediction, validating the effectiveness of the dual-optimization strategy in hyperspectral modeling. Future research could further explore the applicability of this approach to other grain crops such as wheat and maize, offering a more accurate and efficient technical solution for moisture monitoring and quality control in agricultural production [37].

Author Contributions

P.Z. and J.L. contributed equally to this work. Conceptualization, P.Z.; data curation, P.Z.; methodology, P.Z.; software, P.Z. and J.L.; validation, P.Z. and J.L.; formal analysis, P.Z.; investigation, P.Z.; resources, J.L.; writing—original draft, P.Z.; writing—review and editing, P.Z. and J.L.; visualization, P.Z.; supervision, J.L.; project administration, J.L.; funding acquisition, J.L. All authors have read and agreed to the published version of the manuscript.

Funding

This study was supported by the Young Teachers Research Ability Promotion Project of Inner Mongolia Agricultural University (Grant No. BR220116), the Excellent Doctoral Talent Introduction and Research Launch Project (Grant No. NDYB2023-32), the Sub-project of the National Key Research and Development Program of China (Grant No. 2023YFD1600702-04), and the Startup Support Program for Returnee Innovation and Entrepreneurship funded by the Inner Mongolia Autonomous Region.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data are not publicly available due to confidentiality agreements and project constraints, but may be obtained from the corresponding author upon reasonable request.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Zhang, J.; Zhang, Y.; Zhang, F.; Tian, L.; Ma, Z.; Wu, X.; Zhou, Q.; Zhang, Q.; Mu, X.; Fan, Y.; et al. Genetic Dissection of Maize Grain Moisture Content and Dehydration Rate Using High-Density Bin Mapping in a Recombinant Inbred Line Population. BMC Plant Biol. 2025, 25, 369. [Google Scholar] [CrossRef] [PubMed]
  2. Decker, B.L.A.; Filho, E.D.G.A.; E Silva, L.M.A.; Riceli Vasconcelos Ribeiro, P.; Sousa De Brito, E.; Narciso Fernandes, F.A.; Vidal Fonteles, T.; Rodrigues, S. Ultrasound-Assisted Extraction of Anthocyanins from Grape Pomace Using Acidified Water: Assessing Total Monomeric Anthocyanin and Specific Anthocyanin Contents. Food Res. Int. 2024, 194, 114910. [Google Scholar] [CrossRef]
  3. Ricchiuti, G.; Dabrowska, A.; Pinto, D.; Ramer, G.; Lendl, B. Dual-Beam Photothermal Spectroscopy Employing a Mach–Zehnder Interferometer and an External Cavity Quantum Cascade Laser for Detection of Water Traces in Organic Solvents. Anal. Chem. 2022, 94, 16353–16360. [Google Scholar] [CrossRef] [PubMed]
  4. Islam, T.; Tehseen, Z.; Kumar, L. Highly Sensitive Thin-film Capacitive Sensor for Online Moisture Measurement in Transformer Oil. IET Sci. Meas. Amp Tech. 2020, 14, 416–422. [Google Scholar] [CrossRef]
  5. Alimam, H.; Mazzuto, G.; Tozzi, N.; Emanuele Ciarapica, F.; Bevilacqua, M. The Resurrection of Digital Triplet: A Cognitive Pillar of Human-Machine Integration at the Dawn of Industry 5.0. J. King Saud. Univ. -Comput. Inf. Sci. 2023, 35, 101846. [Google Scholar] [CrossRef]
  6. Li, X.; Liu, Z.; Chen, L.; Wang, Y.; Zhao, Q. Three-Dimensional Imaging of Dual-Frequency Lidar Based on Full-Phase Fast Fourier Transform and Compressive Sensing. J. Opt. Photonics Res. 2023, 1, 70–82. [Google Scholar] [CrossRef]
  7. Kartakoullis, A.; Caporaso, N.; Whitworth, M.B.; Fisk, I.D. Gaussian Mixture Model Clustering Allows Accurate Semantic Image Segmentation of Wheat Kernels from Near-Infrared Hyperspectral Images. Chemom. Intell. Lab. Syst. 2025, 259, 105341. [Google Scholar] [CrossRef]
  8. Dallahi, Y.; Malaainine, M.E.I.; Dansou, C.; Hbiak, I.; Boujraf, A.; Orlando, C.A. Prediction of Current and Future Gully Erosion Susceptibility in the Oued Zat Watershed in the High Atlas Region of Morocco Using an SVM-Based Machine Learning Approach. Arid. Land. Res. Manag. 2025, 39, 151–179. [Google Scholar] [CrossRef]
  9. Wan, S.; Li, S.; Chen, Z.; Tang, Y.; Li, J. A Hybrid Ultrasound-AI Method for Predicting Voiding Defects in Concrete-Filled Steel Tubes Based on Bayesian Optimization-Enhanced XGBoost. Case Stud. Constr. Mater. 2025, 23, e04359. [Google Scholar] [CrossRef]
  10. Ouyang, C.; Qiu, Y.; Zhu, D. Adaptive Spiral Flying Sparrow Search Algorithm. Sci. Program. 2021, 2021, 6505253. [Google Scholar] [CrossRef]
  11. Li, Z.; Yu, Y.; Yin, C.; Shi, Y. AdaNet: A Competitive Adaptive Convolutional Neural Network for Spectral Information Identification. Pattern Recognit. 2025, 163, 111472. [Google Scholar] [CrossRef]
  12. Mannarsamy, V.; Mahalingam, P.; Kalivarathan, T.; Amutha, K.; Paulraj, R.K.; Ramasamy, S. Sift-BCD: SIFT-CNN Integrated Machine Learning-Based Breast Cancer Detection. Biomed. Signal Process. Control. 2025, 106, 107686. [Google Scholar] [CrossRef]
  13. Li, Y.; Xu, X.; Wu, W.; Zhu, Y.; Gao, L.; Jiang, X.; Meng, Y.; Yang, G.; Xue, H. Hyperspectral Estimation of Chlorophyll Content in Grapevine Based on Feature Selection and GA-BP. Sci. Rep. 2025, 15, 8029. [Google Scholar] [CrossRef]
  14. Zhang, J.; Guo, Y.; Dong, X.; Wang, T.; Wang, J.; Ma, X.; Wang, H. Opportunities and Challenges of Noise Interference Suppression Algorithms for Dynamic ECG Signals in Wearable Devices: A Review. Measurement 2025, 250, 117067. [Google Scholar] [CrossRef]
  15. Ahmed, M.W.; Sprigler, A.; Emmert, J.L.; Kamruzzaman, M. Non-Destructive Pre-Incubation Sex Determination in Chicken Eggs Using Hyperspectral Imaging and Machine Learning. Food Control. 2025, 173, 111233. [Google Scholar] [CrossRef]
  16. Zhang, L.; Wang, H.; Cai, L.; Yu, C.; Sun, T. Rapid and Nondestructive Detection of Hollow Defects in Pecan Nuts Based on Near-Infrared Spectroscopy and Voting Method. J. Food Compos. Anal. 2025, 141, 107381. [Google Scholar] [CrossRef]
  17. Zhong, L.; Fan, Y.; Wu, Y.; Gao, Y.; Gao, Z.; Zhou, A.; Shao, Q.; Zhang, A. Data Fusion Strategy for Rapid Prediction of Glyceryl Trioleate and Polysaccharide Content in Ganoderma Lucidum Spore Powder Based on Near-Infrared Spectroscopy and Hyperspectral Imaging. J. Food Compos. Anal. 2025, 141, 107403. [Google Scholar] [CrossRef]
  18. Gao, P.; Yan, Q.; Liu, H.; Xiang, C.; Chen, K. Research on Fault Characteristics and Signal Transfer Path Mechanism of the Gear Transmission System. Mech. Syst. Signal Process. 2025, 228, 112471. [Google Scholar] [CrossRef]
  19. Wang, J.; Zhang, C.; Jiao, F.; Cao, Y. Parameters Optimization for 2.5D Needled Cf/SiC in Longitudinal Torsional Ultrasonic-Assisted Laser Milling on PSO-BP-PSO. CIRP J. Manuf. Sci. Technol. 2025, 58, 87–106. [Google Scholar] [CrossRef]
  20. Burukanli, M.; Yumuşak, N. StackGridCov: A Robust Stacking Ensemble Learning-Based Model Integrated with GridSearchCV Hyperparameter Tuning Technique for Mutation Prediction of COVID-19 Virus. Neural Comput. Applic 2024, 36, 22379–22401. [Google Scholar] [CrossRef]
  21. Shao, T.; Xu, X.; Su, Y. Evaluation and Prediction of Agricultural Water Use Efficiency in the Jianghan Plain Based on the Tent-SSA-BPNN Model. Agriculture 2025, 15, 140. [Google Scholar] [CrossRef]
  22. Wang, J.; Sun, Y. Load Frequency Active Disturbance Rejection Control Based on Improved Particle Swarm Optimization. Electronics 2024, 13, 1268. [Google Scholar] [CrossRef]
  23. Shafieenejad, I. Maximizing the Velocity Deflection of Asteroid Didymos Using the Whale Optimization Algorithm. Planet. Space Sci. 2025, 258, 106075. [Google Scholar] [CrossRef]
  24. Xie, X.; Lin, Z.; Toh, K.-C.; Zhou, P. LoCo: Low-Bit Communication Adaptor for Large-Scale Model Training. IEEE Trans. Pattern Anal. Mach. Intell. 2025, 47, 4285–4298. [Google Scholar] [CrossRef]
  25. Bao, X.; Huang, D.; Yang, B.; Li, J.; Opeyemi, A.T.; Wu, R.; Weng, H.; Cheng, Z. Combining Deep Convolutional Generative Adversarial Networks with Visible-near Infrared Hyperspectral Reflectance to Improve Prediction Accuracy of Anthocyanin Content in Rice Seeds. Food Control. 2025, 174, 111218. [Google Scholar] [CrossRef]
  26. Yang, Q.-T.; Xu, X.-X.; Zhan, Z.-H.; Zhong, J.; Kwong, S.; Zhang, J. Evolutionary Multitask Optimization for Multiform Feature Selection in Classification. IEEE Trans. Cybern. 2025, 55, 1673–1686. [Google Scholar] [CrossRef]
  27. Shaikh, A.; Rahman, W.; Roksana, K.; Islam, T.; Rahman, M.M.; Alshahrani, H.; Sulaiman, A.; Reshan, M.S.A. An Improved Deep CNN-Based Freshwater Fish Classification with Cascaded Bio-Inspired Networks. Automatika 2025, 66, 249–280. [Google Scholar] [CrossRef]
  28. Schillemans, D.; Tauler, R.; Haverkorn, M.; Tinnevelt, G.H.; Jansen, J.J.; Ghaffari, M. Enhancing Chemical Image Analysis: Utilizing the Successive Projection Algorithm for Unmixing. Spectrochim. Acta Part A Mol. Biomol. Spectrosc. 2025, 338, 126201. [Google Scholar] [CrossRef]
  29. Lamb, G.W.; Taylor, R.S. Spectral Variance in a Stochastic Gravitational-Wave Background from a Binary Population. Astrophys. J. Lett. 2024, 971, L10. [Google Scholar] [CrossRef]
  30. Golovko, V.V. Improving Confidence Intervals and Central Value Estimation in Small Datasets through Hybrid Parametric Bootstrapping. Inf. Sci. 2025, 716, 122254. [Google Scholar] [CrossRef]
  31. Yan, J.; Fang, Y.; Liu, X.; Jiang, W.; Liu, Y. Opinion-Unaware Blind Stereoscopic Image Quality Assessment: A Comprehensive Study. Pattern Recognit. 2025, 167, 111749. [Google Scholar] [CrossRef]
  32. Zhang, J.; Zhang, R.; Huang, X.; Zhang, Z.; Cai, B.; Lv, X.; Shao, Z.; Li, D. Joint Content-Aware and Difference-Transform Lightweight Network for Remote Sensing Images Semantic Change Detection. Inf. Fusion. 2025, 123, 103276. [Google Scholar] [CrossRef]
  33. Lorenzi, D.A.; Gambarotta, A.; Morini, M.; Rossi, M.; Saletti, C. Corrigendum to ‘Setup and Testing of Smart Controllers for Small-Scale District Heating Networks: An Integrated Framework’ [Energy Volume 205 (2020) 118054]. Energy 2025, 326, 136145. [Google Scholar] [CrossRef]
  34. Hong, J.; Kang, M.; Choi, H.; Min, J.; Ju, M.; Park, K. Non-Destructive Evaluation of Micro-Damage near Concrete Anchors under Dynamic Loading. Constr. Build. Mater. 2025, 469, 140466. [Google Scholar] [CrossRef]
  35. Kamoun, A.; Boujelbane, R.; Boujelben, S. A Prediction Model to Detect Non-Compliant Taxpayers Using a Supervised Machine Learning Approach: Evidence from Tunisia. J. Bus. Anal. 2025, 8, 116–133. [Google Scholar] [CrossRef]
  36. Nassabeh, M.; You, Z.; Keshavarz, A.; Iglauer, S. Data-Driven Strategy for Contact Angle Prediction in Underground Hydrogen Storage Using Machine Learning. J. Energy Storage 2025, 114, 115908. [Google Scholar] [CrossRef]
  37. Zeddies, H.H.; Parlasca, M.; Qaim, M. Agrivoltaics Increases Public Acceptance of Solar Energy Production on Agricultural Land. Land Use Policy 2025, 156, 107604. [Google Scholar] [CrossRef]
Figure 1. The figure displays images of various oat varieties, including (a) BaYou 6, (b) BaYou 3, (c) BaYou 17, (d) Pinyan 7, (e) Dingyan 2, (f) Baiyan 6, (g) Baiyan 12, and (h) Baiyan 23.
Figure 1. The figure displays images of various oat varieties, including (a) BaYou 6, (b) BaYou 3, (c) BaYou 17, (d) Pinyan 7, (e) Dingyan 2, (f) Baiyan 6, (g) Baiyan 12, and (h) Baiyan 23.
Agriculture 15 01341 g001
Figure 2. Laboratory hyperspectral image acquisition setup.
Figure 2. Laboratory hyperspectral image acquisition setup.
Agriculture 15 01341 g002
Figure 3. Raw spectral curves of oat samples.
Figure 3. Raw spectral curves of oat samples.
Agriculture 15 01341 g003
Figure 4. Comparison of band correlations before and after hyperspectral data dimensionality reduction: (a) correlation plot of the original data; and (b) correlation plot after PCA dimensionality reduction.
Figure 4. Comparison of band correlations before and after hyperspectral data dimensionality reduction: (a) correlation plot of the original data; and (b) correlation plot after PCA dimensionality reduction.
Agriculture 15 01341 g004
Figure 5. Overall optimization flowchart of the Bayes-ASFSSA-BP model.
Figure 5. Overall optimization flowchart of the Bayes-ASFSSA-BP model.
Agriculture 15 01341 g005
Figure 6. Seven preprocessed spectral images. (a) Spectral image after SNV preprocessing; (b) spectral image after MSC preprocessing; (c) spectral image after FD preprocessing; (d) spectral image after SD preprocessing; (e) spectral image after SNV + MSC preprocessing; (f) spectral image after SNV + FD preprocessing; (g) spectral image after SNV + SD preprocessing.
Figure 6. Seven preprocessed spectral images. (a) Spectral image after SNV preprocessing; (b) spectral image after MSC preprocessing; (c) spectral image after FD preprocessing; (d) spectral image after SD preprocessing; (e) spectral image after SNV + MSC preprocessing; (f) spectral image after SNV + FD preprocessing; (g) spectral image after SNV + SD preprocessing.
Agriculture 15 01341 g006
Figure 7. Comparison of the predictive performance of BP models constructed using three feature selection methods combined with the SNV + FD preprocessing strategy on the test set. Error bars represent 95% confidence intervals. (a) Comparison of the coefficient of determination (R2); and (b) comparison of the root mean square error (RMSE).
Figure 7. Comparison of the predictive performance of BP models constructed using three feature selection methods combined with the SNV + FD preprocessing strategy on the test set. Error bars represent 95% confidence intervals. (a) Comparison of the coefficient of determination (R2); and (b) comparison of the root mean square error (RMSE).
Agriculture 15 01341 g007
Figure 8. PCA analysis illustration. (a) Eigenvalue plot of principal components; (b) loading plot of PC1; and (c) loading plot of PC2.
Figure 8. PCA analysis illustration. (a) Eigenvalue plot of principal components; (b) loading plot of PC1; and (c) loading plot of PC2.
Agriculture 15 01341 g008
Figure 9. Fitting performance between predicted and reference values on the training and test sets for different models. Each scatter point represents a region of interest (ROI) sample, with the reference moisture value obtained from the corresponding oat cultivar using the standard oven-drying method. (ae) illustrate the fitting performance under the SNV + FD + PCA preprocessing strategy combined with different modeling algorithms: (a) traditional BP neural network; (b) BP model optimized by SSA; (c) BP model optimized by Bayesian optimization; (d) BP model optimized by ASFSSA; and (e) BP model optimized by the combined Bayes-ASFSSA approach.
Figure 9. Fitting performance between predicted and reference values on the training and test sets for different models. Each scatter point represents a region of interest (ROI) sample, with the reference moisture value obtained from the corresponding oat cultivar using the standard oven-drying method. (ae) illustrate the fitting performance under the SNV + FD + PCA preprocessing strategy combined with different modeling algorithms: (a) traditional BP neural network; (b) BP model optimized by SSA; (c) BP model optimized by Bayesian optimization; (d) BP model optimized by ASFSSA; and (e) BP model optimized by the combined Bayes-ASFSSA approach.
Agriculture 15 01341 g009
Figure 10. Illustration of regression fitting performance. (a) Fitting results on the training set. (b) Good fitting performance on the validation set. (c) The fitted curve on the test set closely aligns with the ideal line. (d) Overall fitting results for all samples.
Figure 10. Illustration of regression fitting performance. (a) Fitting results on the training set. (b) Good fitting performance on the validation set. (c) The fitted curve on the test set closely aligns with the ideal line. (d) Overall fitting results for all samples.
Agriculture 15 01341 g010
Figure 11. Prediction performance illustration of the Bayes-ASFSSA-BP model: (a) Comparison of prediction results on the test set samples. (b) Comparison of prediction results on the training set.
Figure 11. Prediction performance illustration of the Bayes-ASFSSA-BP model: (a) Comparison of prediction results on the test set samples. (b) Comparison of prediction results on the training set.
Agriculture 15 01341 g011
Figure 12. Evaluation of the prediction performance of the Bayes-ASFSSA-BP model on the full dataset. (a) Bland–Altman plot for assessing prediction consistency. (b) Residual plot for analyzing the distribution of prediction errors.
Figure 12. Evaluation of the prediction performance of the Bayes-ASFSSA-BP model on the full dataset. (a) Bland–Altman plot for assessing prediction consistency. (b) Residual plot for analyzing the distribution of prediction errors.
Agriculture 15 01341 g012
Table 1. Actual moisture content of eight oat varieties.
Table 1. Actual moisture content of eight oat varieties.
No.Sample NameWeight Before Drying (g)Dry Weight (g)Moisture Content
(g)
1Bayou No. 6220.93194.1312.13
2Pinyan No. 7244.51206.6615.48
3Bayou No. 17254.83215.0115.63
4Bayou No. 3245.27214.0412.73
5Baiyan No. 23196.86172.5312.36
6Baiyan No. 6200.72168.5616.02
7Dingyan No. 2200.48169.4815.46
8Baiyan No. 12203.54176.8813.1
Table 2. Performance comparison of different preprocessing methods.
Table 2. Performance comparison of different preprocessing methods.
Preprocessing MethodsMSER2 Score
SNV0.280.86
MSC0.560.82
FD0.230.87
SD0.370.87
SNV + MSC0.530.83
SNV + FD0.190.88
SNV + SD0.420.87
Table 3. Performance comparison of different variable selection methods.
Table 3. Performance comparison of different variable selection methods.
Variable Filtering MethodR2RMSER2 95% CLRMSE 95% CLTTR
SNV + FD-SPA-BP0.8820.497[0.876, 0.888][0.473, 0.574]20.2 s
SNV + FD-CARS-BP0.8940.232[0.888, 0.899][0.221, 0.273]18.6 s
SNV + FD-PCA-BP0.9080.163[0.903, 0.913][0.150, 0.197]19.2 s
Note: The 95% confidence intervals for R2 and RMSE were calculated using 1000 bootstrap resamples of the prediction residuals.
Table 4. Performance comparison of different feature selection methods on the external test set.
Table 4. Performance comparison of different feature selection methods on the external test set.
Variable Filtering MethodR2RMSER2 95% CLRMSE 95% CLTTR
SNV + FD-SPA-BP0.7820.345[0.779, 0.791][0.328, 0.392]18.2 s
SNV + FD-CARS-BP0.8930.232[0.888, 0.898][0.221, 0.273]24.6 s
SNV + FD-PCA-BP0.9180.262[0.914, 0.923][0.249, 0.295]17.2 s
Note: The 95% confidence intervals for R2 and RMSE were calculated using 1000 bootstrap resamples of the prediction residuals.
Table 5. Comparison of different prediction models.
Table 5. Comparison of different prediction models.
Prediction ModelTraining SetTest SetRun TimeMAEpRp2 95% CLRMSEp 95% CLHardware and Running Platform
Rc2RMSEcRp2RMSEp
SNV + FD-PCA-BP0.9220.2570.9170.34595.1 s0.276[0.912, 0.928][0.339, 0.351]VSCode1.92.2, Inteli7-11800H@2.30 GHz, 16 GBRAM, Windows 10
SNV + FD-PCA-SSA-BP0.9190.2340.9020.216130.2 s0.208[0.901, 0.915][0.210, 0.222]
SNV + FD-PCA-ASFSSA-BP0.9730.1970.9540.478203.3 s0.382[0.953, 0.964][0.472, 0.482]
SNV + FD-PCA-Bayes-BP0.9390.5540.9240.395315.7 s0.326[0.911, 0.927][0.386, 0.395]
SNV + FD-PCA-Bayes-ASFSSA-BP0.9820.1730.9630.188480.9 s0.17[0.961, 0.971][0.185, 0.193]
Note: The 95% confidence intervals for R2 and RMSE were calculated using 1000 bootstrap resamples of the prediction residuals.
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

Zhang, P.; Liu, J. Hyperspectral Imaging for Non-Destructive Moisture Prediction in Oat Seeds. Agriculture 2025, 15, 1341. https://doi.org/10.3390/agriculture15131341

AMA Style

Zhang P, Liu J. Hyperspectral Imaging for Non-Destructive Moisture Prediction in Oat Seeds. Agriculture. 2025; 15(13):1341. https://doi.org/10.3390/agriculture15131341

Chicago/Turabian Style

Zhang, Peng, and Jiangping Liu. 2025. "Hyperspectral Imaging for Non-Destructive Moisture Prediction in Oat Seeds" Agriculture 15, no. 13: 1341. https://doi.org/10.3390/agriculture15131341

APA Style

Zhang, P., & Liu, J. (2025). Hyperspectral Imaging for Non-Destructive Moisture Prediction in Oat Seeds. Agriculture, 15(13), 1341. https://doi.org/10.3390/agriculture15131341

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop