A method for predicting the citric acid content of pineapple based on hyperspectral technology and application thereof
Patent Information
- Application Number
- CN202610635540.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2026-03-13
- Filing Date
- 2026-05-09
- Publication Date
- 2026-10-30
AI Technical Summary
而关于糖酸比直接预测的研究鲜有报道,且现有研究多采用全波段建立模型,导致模型复杂度高、稳健性不足,难以适应在线检测的应用需求
[0017]本发明采用可见/近红外高光谱成像技术,系统比较偏最小二乘回归(PLSR)、岭回归、Lasso回归和弹性网络四种线性回归算法的性能,并探究全波段建模与特征选择建模两种策略的效能差异,最终确定菠萝果实糖酸比预测建模最优方案为“lgA预处理 + Peak-Valley(或SPA)特征选择 + 线性回归建模”(以lgA-Peak-Valley-ElasticNet为代表),筛选出适用于菠萝糖酸比高精度无损检测的最优模型,实现了高精度、高稳定性和低复杂度的最佳平衡。该方案变量少、物理意义明确、易于工程化,便于向低成本多光谱在线检测系统转化,可广泛应用于菠萝采后分级、成熟度监测和品质评价,以期为厚皮水果内部品质在线检测提供简洁、稳定的技术参考,具有重要的理论意义和实际应用价值。
Smart Images

Figure CN123008705A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of pineapple quality testing, specifically involving a method for predicting the bromelain-acid ratio content of pineapple based on hyperspectral technology and its application. Background Technology
[0002] Pineapple[ Pineapple Pineapple (L.) Merr. is one of the world's most important tropical fruits. In 2022, the global production was approximately 29.36 million tons, with China's annual production at approximately 1.9 million tons, making it the second largest tropical fruit after bananas. Pineapples have a unique flavor and are rich in nutrients, including vitamin C, manganese, and dietary fiber, making them widely popular in both domestic and international markets.
[0003] The sugar-acid ratio is a core quality indicator determining the flavor balance and consumer acceptance of pineapples, directly affecting the sweet-acid harmony and eating experience of the fruit. Studies by Zhang Xiumei et al. (2010) show that the sugar-acid ratio of pineapples increases during ripening, with the optimal ratio for consumption being 12–16. Fruits with a sugar-acid ratio below 10 or above 20 show a significant decrease in commercial value. The sugar-acid ratio is also closely related to maturity and is an important basis for grading at the production site, post-harvest processing, and commercial packaging. In actual production, the sugar-acid ratio is a key parameter for determining whether pineapples meet harvest standards. Traditional sugar-acid ratio determination relies on destructive chemical analysis, which is cumbersome, time-consuming, damages samples, and is costly, making large-scale rapid detection impossible and unsuitable for real-time sorting at the production site and non-destructive screening in the supply chain. With the pineapple industry developing towards large-scale and standardized operations, and consumers demanding greater consistency in quality, the development of rapid, non-destructive, and accurate internal quality testing technologies for pineapples has become an urgent industry need.
[0004] Hyperspectral imaging technology, with its advantages of being rapid, non-destructive, green, and allowing for simultaneous determination of multiple components, has become the mainstream method for non-destructive testing of the internal quality of fruits. Near-infrared spectroscopy mainly reflects the overtone and combination frequency absorption of hydrogen-containing groups (OH, CH, NH), and is highly correlated with components such as sugars, organic acids, and moisture, possessing a solid chemometric foundation. Domestic and international scholars have achieved good results in predicting the internal quality of fruits such as citrus, mango, peach, and kiwifruit, with prediction set R² mostly ranging from 0.75 to 0.92. However, research on the direct prediction of the sugar-acid ratio is rarely reported, and existing studies mostly use full-band model building, resulting in high model complexity and insufficient robustness, making it difficult to meet the application requirements of online detection. Therefore, research on predicting the sugar-acid ratio of pineapple using hyperspectral imaging technology is an urgent problem to be solved. Summary of the Invention
[0005] This invention employs visible / near-infrared hyperspectral imaging technology to screen out the optimal model suitable for high-precision non-destructive testing of bromelain acid ratio, providing a simple and stable technical reference for online detection of the internal quality of thick-skinned fruits.
[0006] The technical solution of this invention is implemented as follows: A method for constructing a bromelain ratio prediction model based on hyperspectral technology includes the following steps: (1) The original spectrum of the pineapple sample was obtained by measuring the spectral curve. The original spectrum was preprocessed to obtain preprocessed spectral data. The preprocessed spectral data was then screened to select characteristic bands. A linear regression algorithm was used to establish a linear model of the spectrum-sugar-acid ratio.
[0007] Furthermore, in step (1), the preprocessing method is the first derivative (dA), the second derivative (ddA), and / or logarithmic transformation (lgA); in step (1), the spectral curve includes two bands: visible-near infrared (VNIR, 400-1000 nm) and near infrared (NIR, 1000-1700 nm).
[0008] Furthermore, in step (1), the IgA preprocessed spectrum is used, and the SPA or Peak-Valley feature selection method is applied for variable screening.
[0009] Furthermore, in step (1), the number of bands selected by applying the SPA feature selection method is 18, and the number of bands selected by applying the Peak-Valley feature selection method is 17.
[0010] Furthermore, the wavelengths of the bands selected using the SPA feature selection method are: 449.840, 515.016, 551.438, 653.035, 674.121, 706.709, 746.965, 902.236, 975.080, 1002.924, 1082.456, 1161.988, 1250.877, 1372.515, 1442.690, 1554.971, 1681.287, and 1700.0. The wavelengths of the bands selected using the Peak-Valley feature selection method are: 459.425, 469.010, 482.428, 639.617, 672.204, 819.808, 861.981, 865.815, 978.914, 1000.000, 1002.924, 1091.813, 1208.772, 1278.947, 1452.047, 1653.216, and 1657.895.
[0011] Furthermore, in step (2), the linear regression algorithm is PLSR, Ridge, Lasso, or ElasticNet.
[0012] A model for predicting the bromelain-acid ratio is constructed using the method described above.
[0013] The model described above preprocesses the original spectrum using logarithmic transformation (lgA), selects characteristic bands using Peak-Valley or SPA, and constructs the model using linear regression.
[0014] A method for predicting the sugar-acid ratio of thick-skinned fruits based on hyperspectral technology includes the following steps: Spectral data of the pineapple to be tested were measured, and a linear model was established according to the method described above to predict the bromelain-acid ratio.
[0015] Furthermore, the thick-skinned fruit mentioned is a pineapple.
[0016] The above-described prediction methods are applied to improving the ability to predict bromelain-acid ratio, predicting bromelain-acid ratio, non-destructive testing of pineapples, non-destructive grading of pineapples, and / or evaluation of pineapple quality. Beneficial effects
[0017] This invention employs visible / near-infrared hyperspectral imaging technology to systematically compare the performance of four linear regression algorithms: partial least squares regression (PLSR), ridge regression, Lasso regression, and ElasticNet. It also explores the performance differences between full-band modeling and feature selection modeling strategies. Ultimately, the optimal modeling scheme for predicting the sugar-acid ratio of pineapple fruit is determined to be "lgA preprocessing + Peak-Valley (or SPA) feature selection + linear regression modeling" (represented by lgA-Peak-Valley-ElasticNet). This selects the optimal model for high-precision, non-destructive detection of the sugar-acid ratio in pineapple, achieving an optimal balance between high precision, high stability, and low complexity. This scheme has few variables, clear physical meaning, and is easy to engineer, facilitating its transformation into a low-cost multispectral online detection system. It can be widely applied to post-harvest grading, maturity monitoring, and quality evaluation of pineapples, providing a simple and stable technical reference for online detection of the internal quality of thick-skinned fruits. It has significant theoretical and practical application value. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] tú1 It is a hyperspectral imaging system.
[0020] tú2The images show the spectral curves of 121 pineapple samples under different preprocessing conditions, with color gradients in each image illustrating the variations between samples.
[0021] tú3 This is a scatter plot of the predicted and measured sugar-acid ratio values for the full-band optimal model (lgA-PLSR).
[0022] tú4 The distribution of key wavelength points selected by the feature selection method.
[0023] tú5 This is a scatter plot of the predicted and measured sugar-acid ratio values for the optimal model (lgA-Peak-Valley-ElasticNet) in the characteristic band. Detailed Implementation
[0024] The present invention will be further described below with reference to the accompanying drawings and specific embodiments to better understand the invention. Where specific techniques or conditions are not specified in the embodiments, they are performed according to the techniques or conditions described in the literature in the art or according to the product instructions. Reagents or instruments whose manufacturers are not specified are all conventional products that can be obtained commercially.
[0025] Example 1: Model Construction
[0026] 1. Materials and Methods
[0027] 1.1 Experimental Samples The pineapple variety used in the experiment was 'Tainong 16', collected from the South Subtropical Crops Research Institute of the Chinese Academy of Tropical Agricultural Sciences in Zhanjiang City, Guangdong Province. A total of 121 fruits (ranging from green-ripe to fully ripe) of uniform size, free from mechanical damage and pests / diseases, were selected, all suitable for sale as commercial fruit. After the samples were transported to the laboratory, they were equilibrated for 24 hours at a temperature of (25±1)℃ and a relative humidity of (85±5)% to eliminate the effects of field heat and transportation stress, and to ensure that the internal temperature of the samples was consistent with the laboratory environment.
[0028] 1.2 Measurement of physiological indicators Soluble sugar content was determined using the anthrone colorimetric method, measuring absorbance at a wavelength of 620 nm, and the content was calculated based on the glucose standard curve. Titratable acid content was determined using a PAL-BX / ACID9 digital display saccharimetric meter from Atago Corporation (Japan). This instrument has a soluble solids (Brix) measurement range of 0.0%–60.0% (resolution 0.1%, accuracy ±0.2%) and an acidity measurement range of 0.10%–3.50% (calculated as citric acid, resolution 0.01%, accuracy ±0.10%), and features automatic temperature compensation (10.0–40.0℃). For the determination, juice was extracted from the upper, middle, and lower parts of the fruit pulp and added directly for measurement. The sugar-acid ratio was calculated as "soluble sugar content / titratable acid content," and each sample was measured three times, with the average value taken.
[0029] 1.3 Spectral Acquisition The hyperspectral imaging system used in this study consists of two independent band imaging systems: visible-near infrared (VIR, 400–1000 nm) and near-infrared (SWNIR, 900–1700 nm). tú1 Each system hardware component includes a spectral imager (Headwall Photonics, USA), a light source, a motion control platform, and a computer. The light source is a 150 W halogen lamp providing linear array illumination at 1300–2500 nm. Two or four lamps are symmetrically distributed on both sides of the imager, and the light intensity and imaging uniformity are controlled by adjusting the lamp height and beam angle. The motion control platform (customized by Wuhan Hongxingyang Technology Co., Ltd.) can be adjusted in speed from 2–200 mm / s to achieve uniform sample translation and avoid deformation. The computer controls the imager and platform movement via Hyperspec III software and stores the hyperspectral binary data.
[0030] Data acquisition employed a line scan reflectance mode. The system was warmed up for 15 minutes before acquisition to stabilize the light source and instrument baseline. Subsequently, white plate and dark current data were acquired sequentially for reflectance benchmark correction and dark current noise compensation, respectively. After correction, the sample was placed on a black tray and moved at a constant speed through the imaging field of view to complete the line scan. During the acquisition process, white plate and dark current images were reacquired every 1 hour to correct for light source drift. This mode ensures high spatial resolution and spectral integrity, making it suitable for acquiring reflectance spectra of irregularly shaped fruits such as pineapples.
[0031] 1.4 Spectral Data Preprocessing Because hyperspectral data contains external interference and noise, such as electrical noise, anthropogenic noise, and stray light, baseline shifts and drifts occur, affecting the accuracy of spectral prediction. Therefore, compared to the original spectral reflectance, derivative spectral indices can extract richer spectral information, providing more accurate characteristic parameters for spectral analysis. To eliminate baseline drift, scattering interference, and high-frequency noise, the first derivative (dA), second derivative (ddA), and logarithmic transformation (lgA) are calculated for the original spectrum (A).
[0032] 1.5 Characteristic Wavelength Selection Method Hyperspectral data is characterized by high dimensionality and severe collinearity among variables. Feature selection is a crucial step in reducing model complexity, removing redundant information, and improving prediction accuracy and robustness. This study employs three representative feature selection methods: Peak-Valley detection, Competitive Adaptive Reweighted Sampling (CARS), and Continuous Projection Algorithm (SPA), to screen key bands highly correlated with the sugar-acid ratio from the perspectives of spectral curve morphology, regression coefficient weights, and vector projection, respectively.
[0033] 1.6 Regression Model (1) Partial Least Squares Regression (PLSR) is a classic multivariate correction method that extracts latent variables and simultaneously decomposes the spectral matrix X and the target vector Y to maximize their covariance, effectively solving the problem of multicollinearity among variables. In hyperspectral quantitative analysis, PLSR is widely regarded as the benchmark model, especially suitable for scenarios where the number of variables is much larger than the number of samples. The main parameter is the number of latent variables n_components, which in this study has a search range of 1~30 and is automatically determined by cross-validation.
[0034] (2) Ridge regression shrinks the regression coefficients by introducing an L2 regularization term, reducing model variance and making it suitable for high-dimensional data with highly correlated variables. Compared to ordinary least squares regression, Ridge can effectively prevent overfitting. The main parameter is the regularization strength alpha, and the search range in this study is 10. -6 ~10 2 (Logarithmic grid).
[0035] (3) Lasso regression introduces an L1 regularization term, which can shrink the coefficients while precisely compressing some coefficients to zero, thus achieving automatic variable selection. It is suitable for high-dimensional sparse scenarios. The main parameter is the regularization strength alpha, and the search range in this study is 10. -6 ~10 0 (Logarithmic grid).
[0036] (4) ElasticNet combines L1 and L2 regularization, possessing both the variable selection capability of Lasso and the coefficient shrinkage stability of Ridge, making it particularly suitable for situations where there are many highly correlated variables. Key parameters include the total regularization strength alpha (search range 10). -6 ~10 0 ) and L1_ratio (L1 ratio, search range 0.1~0.9).
[0037] All model construction and parameter optimization were performed on the training set, with the prediction set used only for final performance evaluation. Hyperparameter optimization employed grid search combined with 5-fold cross-validation (5-fold CV), aiming to maximize CV_R². Model prediction performance was primarily based on the prediction set results, with evaluation metrics including the coefficient of determination (R², closer to 1 is better), root mean square error (RMSE, smaller is better), and residual prediction bias (RPD = prediction set standard deviation / RMSEP). The RPD evaluation criteria were: RPD < 1.5 indicates poor prediction performance, 1.5–2.0 indicates some predictive ability, 2.0–2.5 indicates rough quantitative prediction capability, and > 2.5 indicates good or excellent prediction accuracy. Simultaneously, cross-validation metrics (CV_R² mean ± std and CV_RPD) were reported to assess model stability and ensure that the selected model possesses both high accuracy and strong generalization ability.
[0038] 1.7 Data Analysis All data processing and model building were completed in a Python 3.12 environment. The scikit-learn (version 1.3.0) machine learning library was primarily used for regression algorithms and cross-validation, pandas (version 2.0.3) for data management, numpy (version 1.24.3) for numerical computation, and matplotlib (version 3.7.2) and seaborn (version 0.12.2) for plotting. Hyperspectral data preprocessing and feature selection were implemented using custom scripts combined with scipy (version 1.10.1).
[0039] 2 Results and Analysis
[0040] 2.1 Statistical analysis of sugar-acid ratio in pineapple samples The samples were randomly divided into a training set and an independent test set in a 7:3 ratio using a fixed random seed (random_state=713). The training set was used for model parameter optimization and feature selection, while the independent test set was used for final performance evaluation to ensure the objectivity of the model's generalization ability. This division ratio balances the sufficiency of training samples with the representativeness of test samples (Table 1).
[0041] Table 1. Sugar-acid ratio statistics for training and test sets. xùnliànjí 713 84 34.35 20.74 26.41 3.133 cèshìjí 713 37 35.98 19.00 27.16 3.826
[0042] 2.2 Spectral Analysis like tú2 As shown, this study collected raw and preprocessed spectra of 121 pineapple samples in the visible-near infrared (VNIR, 400-1000 nm) and near-infrared (NIR, 1000-1700 nm) bands. The raw VNIR spectrum exhibited a low reflectance plateau in the 400-600 nm range, with a characteristic absorption valley caused by chlorophyll a around 680 nm. Reflectance then increased sharply at the red edge of 700 nm, and a broad, shallow second OH overtone absorption band appeared at 970 nm. The raw NIR spectrum generally showed a downward trend, with the most significant strong absorption valley for the first OH overtone appearing at 1450 nm. Only at the shoulder of 1200 nm and the rebound at 1650-1700 nm did the first OH overtone information from sugars be present.
[0043] To extract effective features from strong backgrounds, three preprocessing methods were compared: logarithmic transformation (lgA) deepened the water absorption peak while maintaining the spectral morphology, making the data distribution closer to the absorbance form; first derivative (dA) transformed absorption valleys into zero-crossing points and effectively corrected baseline drift; second derivative (ddA) showed the most significant advantage in processing thick-skinned, high-moisture samples. It generated sharp fingerprint peaks by highlighting curvature changes, specifically enhancing weak feature signals in the 750-900 nm (CH combination), 1200-1300 nm (carbohydrate second-order overtones), and 1655-1685 nm (cellulose-related) ranges, effectively decoupling overlapping absorption peaks and providing a high-quality data foundation for subsequent accurate quantitative modeling.
[0044] 2.3 Screening of Spectral Preprocessing Methods To screen the optimal spectral preprocessing method, this study first used PLSR to model the full-band data with four preprocessing methods: original spectrum (A), first derivative (dA), second derivative (ddA), and logarithmic transformation (lgA). The best preprocessing method was then selected based on the performance of the prediction set. The results showed that logarithmic transformation (lgA) preprocessing achieved the highest prediction accuracy, with a Best_Test_R² of 0.7774 and a CV_RPD of 1.66, indicating that the model has a certain quantitative prediction capability. In contrast, the Best_Test_R² of the full-band PLSR for the original spectrum (A) was 0.7364, while the performance of the first and second derivative preprocessing methods was even lower (Best_Test_R² < 0.65), and the CV_RPD did not exceed 1.5. This indicates that logarithmic transformation can effectively reduce the influence of light scattering and enhance the correlation between absorption characteristics and the sugar-acid ratio, thereby significantly improving the performance of the full-band model (Table 2).
[0045] Table 2. Performance comparison of full-band PLSR models under different preprocessing methods yuánshǐguāngpǔ(A) 22 0.8542 0.5436 ± 0.2553 0.7364 1.676 1.9978 0.0609 yījiēdǎoshù(dA) 18 0.9423 0.4085 ± 0.2217 0.6271 1.406 2.3522 0.0739 èrjiēdǎoshù(ddA) 21 0.9970 0.3084 ± 0.2579 0.5022 1.294 2.5498 0.0800 duìshùbiànhuàn(lgA) 22 0.8619 0.5732 ± 0.1694 0.7774 1.660 1.9939 0.0608
[0046] 2.4 Comparative Analysis of Different Models for Full-Band Modeling Using fixed IGA full-band data, the prediction performance of four linear regression algorithms (PLSR, Ridge, Lasso, and ElasticNet) was compared (Table 3). PLSR performed best (Best_Test_R²=0.7774, CV_RPD=1.66), followed by ElasticNet (Best_Test_R²=0.7552, CV_RPD=1.697), Lasso (Best_Test_R²=0.7477, CV_RPD=1.707), and Ridge (Best_Test_R²=0.7417, CV_RPD=1.596). The cross-validation stability (CV_R² mean± std) of the four algorithms was between 0.54 and 0.60, with a standard deviation of approximately 0.15, indicating that although the full-band model can achieve a certain prediction accuracy, its stability is generally poor due to high-dimensional redundancy and collinearity. tú3 ).
[0047] Table 3. Performance comparison of different models across the entire band using IGA preprocessing.
[0048] 2.5 Screening of Feature Wavelength Extraction Methods Based on full-band modeling, this study further applied three feature selection methods: Peak-Valley, CARS, and SPA, selecting variables only for logarithmic transform spectroscopy (lgA). The results are shown in Table 4. The lgA combined with SPA feature selection performed best, using only 18 feature bands. The PLSR model achieved a Test R² of 0.7457 and an RPD of 2.010, with prediction accuracy only about 4% lower than the optimal full-band model, but the number of variables was reduced by nearly 97%, achieving a good balance between simplifying the model and maintaining accuracy. The CARS subset (28 bands) combined with PLSR achieved a Test R² of 0.6982 and an RPD of 1.846, slightly lower than SPA, but still maintaining high predictive ability. tú4 The Peak-Valley subset (17 bands) combined with PLSR has a Test R² of 0.7136 and an RPD of 1.894, with the fewest variables and predictive performance between the two.
[0049] Table 4 List of characteristic bands 1 lgA_CARS_lgAvnir59 511.182 lgA_SPA_lgAvnir27 449.840 lgA_Peak-Valley_lgAvnir32 459.425 2 lgA_CARS_lgAvnir75 541.853 lgA_SPA_lgAvnir61 515.016 lgA_Peak-Valley_lgAvnir37 469.010 3 lgA_CARS_lgAvnir110 608.946 lgA_SPA_lgAvnir80 551.438 lgA_Peak-Valley_lgAvnir44 482.428 4 lgA_CARS_lgAvnir111 610.863 lgA_SPA_lgAvnir133 653.035 lgA_Peak-Valley_lgAvnir126 639.617 5 lgA_CARS_lgAvnir143 672.204 lgA_SPA_lgAvnir144 674.121 lgA_Peak-Valley_lgAvnir143 672.204 6 lgA_CARS_lgAvnir168 720.128 lgA_SPA_lgAvnir161 706.709 lgA_Peak-Valley_lgAvnir220 819.808 7 lgA_CARS_lgAvnir221 821.725 lgA_SPA_lgAvnir182 746.965 lgA_Peak-Valley_lgAvnir242 861.981 8 lgA_CARS_lgAvnir294 961.661 lgA_SPA_lgAvnir263 902.236 lgA_Peak-Valley_lgAvnir244 865.815 9 lgA_CARS_lgAnir53 1143.275 lgA_SPA_lgAvnir301 975.080 lgA_Peak-Valley_lgAvnir303 978.914 10 lgA_CARS_lgAnir63 1190.058 lgA_SPA_lgAnir23 1002.924 lgA_Peak-Valley_lgAvnir314 1000.000 11 lgA_CARS_lgAnir70 1222.807 lgA_SPA_lgAnir40 1082.456 lgA_Peak-Valley_lgAnir23 1002.924 12 lgA_CARS_lgAnir75 1246.199 lgA_SPA_lgAnir57 1161.988 lgA_Peak-Valley_lgAnir42 1091.813 13 lgA_CARS_lgAnir77 1255.556 lgA_SPA_lgAnir76 1250.877 lgA_Peak-Valley_lgAnir67 1208.772 14 lgA_CARS_lgAnir79 1264.912 lgA_SPA_lgAnir102 1372.515 lgA_Peak-Valley_lgAnir82 1278.947 15 lgA_CARS_lgAnir81 1274.269 lgA_SPA_lgAnir117 1442.690 lgA_Peak-Valley_lgAnir119 1452.047 16 lgA_CARS_lgAnir84 1288.304 lgA_SPA_lgAnir141 1554.971 lgA_Peak-Valley_lgAnir162 1653.216 17 lgA_CARS_lgAnir97 1349.123 lgA_SPA_lgAnir168 1681.287 lgA_Peak-Valley_lgAnir163 1657.895 18 lgA_CARS_lgAnir111 1414.620 lgA_SPA_lgAnir172 1700.000 19 lgA_CARS_lgAnir117 1442.690 20 lgA_CARS_lgAnir140 1550.292 21 lgA_CARS_lgAnir141 1554.971 22 lgA_CARS_lgAnir142 1559.649 23 lgA_CARS_lgAnir144 1569.006 24 lgA_CARS_lgAnir145 1573.684 25 lgA_CARS_lgAnir146 1578.363 26 lgA_CARS_lgAnir147 1583.041 27 lgA_CARS_lgAnir152 1606.433 28 lgA_CARS_lgAnir162 1653.216 Cross-validation results show that the mean CV_R² and stability of the three feature selection subset models are comparable to or slightly better than the full-band model. The SPA subset has the smallest standard deviation, indicating low band collinearity and strong model robustness. The CARS subset also shows good performance in removing noise and irrelevant variables. Overall, the PLSR model combining IGA preprocessing and SPA feature selection maintains high prediction accuracy (Test R²>0.74, RPD>2.0) while significantly simplifying variables, making it the optimal feature selection scheme suitable for subsequent non-destructive online detection of bromelain-acid ratio.
[0050] Table 5. Comparison of PLSR performance of different feature selection methods under IgA preprocessing
[0051] 2.6 Comparative Analysis of Different Models for Characteristic Band Modeling Variable selection was performed on the preprocessed IGA spectra using two feature selection methods, SPA and Peak-Valley (selecting 18 and 17 variables respectively, a reduction rate >95%), and four linear regression algorithms (PLSR, Ridge, Lasso, and ElasticNet) were used for modeling. Results show that the prediction accuracy of the two feature subset models is slightly lower than that of the full-band model overall, but the number of variables is significantly reduced, resulting in a significant decrease in model complexity. The Peak-Valley subset performs better: the Test R² of the ElasticNet and Ridge models reaches 0.7639 and 0.7634 respectively, while the Test R² of the PLSR and Lasso models also exceeds 0.74, with overall prediction accuracy higher than the SPA subset. The CV_RPD of this subset model is between 1.661 and 1.678, and the cross-validation RMSE and MAPE are low (approximately 1.96–1.98 and 0.0638–0.0645, respectively), indicating that the peak-valley bands screened have a strong correlation with the sugar-acid ratio, and can maintain high predictive ability while greatly simplifying the model.
[0052] The SPA subset exhibits a significant advantage in stability: the cross-validation standard deviations of the four linear models are all relatively small (0.0785–0.0821), significantly lower than those of the Peak-Valley subset (0.1764–0.1986) and the full-band model, with mean CV_R² values remaining between 0.57 and 0.59. Specifically, the PLSR model has a Test R² of 0.7118 and CV_RPD = 1.613, while the Test R² values for ElasticNet, Lasso, and Ridge range from 0.689 to 0.700. These results demonstrate that SPA effectively reduces inter-band collinearity and improves model robustness and repeatability.
[0053] In summary, linear models combining IGA with Peak-Valley feature subsets (especially ElasticNet and Ridge) demonstrate superior prediction accuracy, achieving a Test R² of up to 0.7639, only about 1.7% lower than the optimal model across the entire band. Conversely, models combining IGA with SPA feature subsets exhibit the best stability, with minimal cross-validation fluctuations, making them more suitable for real-world detection scenarios with significant sample variation. Both feature subset models achieve a good balance between model simplification and performance. The Peak-Valley subset prioritizes accuracy, while the SPA subset prioritizes stability. The optimal solution can be selected based on specific application requirements (such as the speed and stability requirements of online detection) (Table 6).
[0054] Table 6. Performance comparison of linear regression models for different feature subsets under lgA preprocessing. Peak-Valley-ElasticNet α=0.001425, L1_ratio=0.1 0.7167 0.5839 ±0.1764 0.7639 1.677 1.9643 Peak-Valley-Ridge α=0.100000 0.7178 0.5835 ±0.1786 0.7634 1.678 1.9633 Peak-Valley-PLSR n=13 0.7247 0.5730 ±0.1986 0.7473 1.669 1.9747 Peak-Valley-Lasso α=0.001456 0.725 0.5715 ±0.1943 0.7412 1.661 1.9827 SPA-PLSR n=7 0.6745 0.5865 ±0.0821 0.7118 1.613 2.0315 SPAElasticNet α=0.007017, L1_ratio=0.5 0.686 0.5811 ±0.0785 0.7002 1.6 2.044 SPALasso α=0.012068 0.6862 0.5738 ±0.0792 0.6968 1.586 2.0624 SPARidge α≈0.01 (güsuàn) ≈0.685 ≈0.580 ± 0.080 0.6893 ≈1.599 ≈2.050 3. Conclusion In the modeling of sugar-acid ratio prediction for pineapple fruits, the optimal solution is "lgA preprocessing + Peak-Valley (or SPA) feature selection + linear regression modeling" (represented by lgA-Peak-Valley-ElasticNet), achieving the best balance between high accuracy, high stability, and low complexity. This solution has few variables, clear physical meaning, and is easy to engineer, facilitating its transformation into a low-cost multispectral online detection system. It can be widely applied to post-harvest grading, maturity monitoring, and quality evaluation of pineapples, providing a reliable technical reference for rapid and non-destructive detection of the internal quality of thick-skinned fruits, and has significant theoretical and practical application value. Future research could further expand sample diversity, integrate nonlinear models, and conduct online validation to improve the technology's universality and industrialization level.
[0055] Example 2: Optimal Model Validation To further verify the predictive performance of the optimal feature subset model (lgA-Peak-Valley-ElasticNet), commercial 'Tainong 16' pineapples were randomly selected for sale. The optimal feature subset model was used to predict the sugar-acid ratio of the pineapples, and the sugar-acid ratio was measured simultaneously. A scatter plot of the predicted and measured values was then plotted. tú5 The scatter plot shows a high linear correlation between the predicted and measured values, with the clusters of points closely distributed on both sides of the 1:1 line. The R² value reaches 0.7639, indicating that the model has good predictive ability across the entire sugar-acid ratio range and no significant systematic bias. Combined with CV_RPD=1.677, this model fully meets the requirements for non-destructive testing and grading of pineapple sugar-acid ratio, providing reliable technical support for post-harvest quality evaluation and online sorting, and contributing to the development of the fruit industry towards intelligence, standardization, and green practices.
[0056] The specific embodiments of the present invention have been described in detail above, but they are merely examples, and the present invention is not limited to the specific embodiments described above. For those skilled in the art, any equivalent modifications and substitutions to the present invention are also within the scope of the present invention. Therefore, all equivalent transformations and modifications made without departing from the spirit and scope of the present invention should be covered within the scope of the present invention.
Claims
1. A method for constructing a bromelain ratio prediction model based on hyperspectral technology, characterized in that, Includes the following steps: (1) The original spectrum of the pineapple sample was obtained by measuring the spectral curve. The original spectrum was preprocessed to obtain preprocessed spectral data. The preprocessed spectral data was then screened to select characteristic bands. A linear regression algorithm was used to establish a linear model of the spectrum-sugar-acid ratio.
2. The construction method as described in claim 1, characterized in that, In step (1), the preprocessing method is the first derivative (dA), the second derivative (ddA), and / or logarithmic transformation (lgA); in step (1), the spectral curve includes two bands: visible-near infrared (VNIR, 400-1000 nm) and near infrared (NIR, 1000-1700 nm).
3. The construction method as described in claim 1, characterized in that, In step (1), IgA preprocessing of the spectrum is used, and variable selection is performed using SPA or Peak-Valley feature selection methods.
4. The construction method as described in claim 1, characterized in that, In step (1), the number of bands selected by applying the SPA feature selection method is 18, and the number of bands selected by applying the Peak-Valley feature selection method is 17.
5. The construction method as described in claim 1, characterized in that, The wavelengths selected using the SPA feature selection method are: 449.840, 515.016, 551.438, 653.035, 674.121, 706.709, 746.965, 902.236, 975.080, 1002.924, 1082.456, 1161.988, 1250.877, 1372.515, 1442.690, 1554.971, 1681.287, and 1700.
000. The wavelengths of the bands selected using the Peak-Valley feature selection method are: 459.425, 469.010, 482.428, 639.617, 672.204, 819.808, 861.981, 865.815, 978.914, 1000.000, 1002.924, 1091.813, 1208.772, 1278.947, 1452.047, 1653.216, and 1657.
895.
6. The construction method as described in claim 1, characterized in that, In step (2), the linear regression algorithm is PLSR, Ridge, Lasso, or ElasticNet.
7. A model for predicting the bromelain-acid ratio, characterized in that, It is constructed using the construction method described in any one of claims 1-6.
8. The model as described in claim 7, characterized in that, The model described above preprocesses the original spectrum using logarithmic transformation (lgA), selects characteristic bands using Peak-Valley or SPA, and constructs the model using linear regression.
9. A method for predicting the sugar-acid ratio of thick-skinned fruits based on hyperspectral technology, characterized in that, Includes the following steps: Spectral data of the pineapple to be tested were measured, and a linear model was established according to the method described above to predict the bromelain-acid ratio. Preferably, the thick-skinned fruit is a pineapple.
10. The application of the prediction method as described in claim 9 in improving the ability to predict bromelain-acid ratio, predicting bromelain-acid ratio, non-destructive testing of pineapple, non-destructive grading of pineapple and / or evaluation of pineapple quality.
