A nondestructive detection method for protein content of kidney bean seeds based on hyperspectral imaging
By combining hyperspectral imaging technology with multiple feature extraction methods and model construction, the destructive nature of traditional bean seed protein detection and the redundancy of existing hyperspectral detection methods have been solved. This enables rapid, accurate, and non-destructive detection of bean seed protein content, which is suitable for breeding and industrial grading.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEILONGJIANG UNIV
- Filing Date
- 2026-04-08
- Publication Date
- 2026-06-30
AI Technical Summary
Traditional methods for detecting protein in common bean seeds are highly destructive, cumbersome, and time-consuming. Existing hyperspectral detection technologies suffer from redundancy, inaccurate feature extraction, and poor model adaptability, making it difficult to achieve high-precision, high-throughput non-destructive detection.
By employing hyperspectral imaging technology, combined with SFE (EDA+PCA+statistical features), PLS-VIP+Pearson+p-value, and KNN-MI nonlinear screening method to extract features, support vector regression (SVR), K nearest neighbor (KNN), and decision tree (DT) models are constructed to achieve non-destructive detection of protein content in bean seeds.
It enables rapid, accurate, and non-destructive detection of protein content in bean seeds, improving detection precision and allowing seeds to be sown normally, thus meeting the needs of breeding and industrial grading.
Abstract
Description
Technical Field
[0001] This invention relates to the field of non-destructive testing technology for agricultural products, specifically to a non-destructive testing method for protein content in bean seeds based on hyperspectral imaging. Background Technology
[0002] Common beans are an important edible legume crop widely cultivated globally. The protein content of their seeds is a core indicator of quality, directly determining their edible value, processing suitability, and market price, playing a crucial role in breeding selection and quality grading. According to statistics from the Food and Agriculture Organization of the United Nations (FAO), common beans account for over 20% of global legume production and are a major source of protein for residents in some regions. They are cultivated throughout my country, both in the north and south, possessing both nutritional and economic value.
[0003] Traditional protein detection methods, represented by the Kjeldahl method, while accurate, are cumbersome, time-consuming (lasting several hours), consume large amounts of chemical reagents, and generate harmful waste. More importantly, they are destructive to samples, rendering the seeds unusable for sowing or breeding research, severely limiting the utilization efficiency of valuable seed resources. Furthermore, other methods such as the biuret method and the Folin-Ciocalteu reagent method suffer from low sensitivity and susceptibility to interference, failing to meet the demands for high-precision, high-throughput detection. Hyperspectral imaging technology, a core technology in the field of non-destructive testing, combines image and spectral information, offering advantages such as non-contact, speed, and comprehensive information, and has been initially applied in agricultural product quality testing. However, existing technologies still have shortcomings in the detection of protein in bean seeds: the raw hyperspectral data has many redundant bands and significant noise interference, leading to computational complexity in direct modeling; the feature extraction methods are not optimized for the spectral characteristics of bean proteins, making it difficult to accurately capture effective information; and the feature-model fit is poor, failing to form a stable and efficient detection system, limiting prediction accuracy and generalization ability.
[0004] Therefore, in view of the pain points of traditional detection methods and the shortcomings of existing hyperspectral technology, there is an urgent need for a non-destructive detection technology that can achieve rapid, accurate and non-destructive detection of protein content in bean seeds, and provide technical support for agricultural breeding and industrial grading. Summary of the Invention
[0005] To address the technical problems of traditional detection methods being highly destructive, cumbersome, and inefficient, as well as the redundancy, inaccurate feature extraction, and poor model adaptability of existing hyperspectral detection technologies, this invention proposes a non-destructive detection method for the protein content of common bean seeds based on hyperspectral imaging. This method aims to achieve rapid, accurate, and non-destructive detection of the protein content of common bean seeds, while simultaneously meeting the dual needs of "detection and seed preservation" in agricultural breeding.
[0006] The technical solution adopted by the present invention to solve the above problems is as follows:
[0007] This invention proposes a non-destructive method for detecting protein content in common bean seeds based on hyperspectral imaging, comprising the following steps: Step 1, Sample preparation and protein reference value determination: After screening, the seeds of common bean were grouped, and the protein content of each group of seeds was determined by the Kjeldahl method as the protein content reference value. Step 2, Hyperspectral Image Acquisition: In a controlled darkroom environment, a hyperspectral imager with a spectral detection range of 384~1022nm was used to acquire hyperspectral images of each group of bean seeds. Step 3: Hyperspectral image preprocessing and average spectrum extraction: The 20th band of the hyperspectral image is selected as the reference grayscale image for Gaussian filtering and noise reduction. The Sauvola adaptive binarization algorithm is used to segment the seed target and the background. After morphological erosion, dilation, hole filling and contour filtering, the reflectance of each band of a single bean seed is extracted and the average spectrum of a single seed is calculated. Then, the average spectrum of the single seed of all seeds in each group is taken to obtain the average spectrum of each sample. Step 4: Spectral data preprocessing: Randomly select some samples from all samples for exploratory data analysis, draw a full-band reflectance trend map and a band correlation coefficient matrix heat map, remove redundant bands from 384~683nm, and retain effective spectral data from 684~1022nm. Step 5, Feature Extraction: Use any one of the following methods to extract features related to protein content to obtain a feature set: SFE (EDA+PCA+Statistical Features), PLS-VIP+Pearson+p-value joint screening method, and KNN-MI nonlinear screening method. The EDA+PCA+statistical feature extraction method is as follows: Principal component analysis is performed on the effective spectral data to reduce dimensionality, and six statistical features are extracted for each wavelength: mean, standard deviation, skewness, kurtosis, maximum value, and minimum value, forming a 6-dimensional feature set. SFE stands for Statistical Feature Extraction, which extracts six statistical features such as mean and standard deviation; EDA (Exploratory Data Analysis) uses visualization and statistical methods to uncover the inherent features of data; and PCA (Principal Component Analysis) is used for data dimensionality reduction and redundancy removal. The PLS-VIP+Pearson+p-value joint screening method is as follows: after smoothing and standard normal variable transformation of the effective spectral data, a partial least squares regression model is constructed to calculate the variable projection importance VIP value, and the Pearson correlation coefficient and the univariate significance p-value are combined to perform multi-criteria screening to obtain a subset of characteristic wavelengths; PLS-VIP (Partial Least Squares-Variable Importance in Projection) measures the contribution of bands to the model. The KNN-MI nonlinear screening method is as follows: set the nearest neighbor number K=5, calculate the nonlinear mutual information value between each wavelength and the protein content, and screen the feature wavelength subset according to the mutual information value; KNN-MI (K-Nearest Neighbors-Mutual Information) is used to capture non-linear association features.
[0008] Step 6: Prediction Model Construction and Protein Content Detection: The extracted feature set is randomly divided into training and validation sets in a 75:25 ratio. After Min-Max normalization, at least one regression model is constructed, including Support Vector Regression (SVR, using Radial Basis Function (RBF) as the kernel function), K-Nearest Neighbor Regression (KNN, combining bagging algorithm to optimize stability), and Decision Tree (DT, using CART algorithm, with minimization of mean square error as the splitting criterion). The optimal model is selected by the coefficient of determination R² (coefficient of determination, measuring the goodness of fit of the model) and root mean square error RMSE (root mean square error, measuring the prediction error of the model) of the validation set. The features obtained from the processing of the bean seeds in steps 2 to 5 are input into the optimal model, and the predicted protein content value is output.
[0009] Furthermore, the screening criteria for the bean seeds mentioned in step 1 are as follows: damaged, insect-infested, moldy, and deformed seeds are removed, and seeds with a particle size of 5.5~6.5mm are screened using a standard sieve with a 6mm aperture. Each sample group contains 12 screened bean seeds. The determination process of the Kjeldahl method is as follows: the seeds of common bean are ground into fine powder, 0.2g of the powder is weighed and mixed with a catalyst of potassium sulfate and copper sulfate in a ratio of 15:1 and concentrated sulfuric acid. The mixture is digested at 400℃ until the solution is clear. The solution is then distilled and titrated using a Kjeldahl nitrogen analyzer. Each sample is measured 3 times and the average value is taken as the reference value for protein content.
[0010] Furthermore, the hyperspectral imager mentioned in step 2 is a HY-6010-S type pushbroom hyperspectral imager with a spectral resolution better than 2.8nm, a spectral sampling interval of 0.5nm, equipped with a 1920×1200 pixel CMOS detector, and using a 4×4 pixel binning method; the conditions of the controllable environment of the darkroom are as follows: four 100W cold light source halogen lamps are symmetrically distributed on both sides of the optical axis of the imager at a 45° direction, the distance between the sample and the imager lens is 53cm, and the light intensity fluctuation is controlled within ±5%.
[0011] Furthermore, the Gaussian filtering in step 3 is a 5×5 Gaussian filtering; the parameters of the Sauvola adaptive binarization algorithm are: local window size 15×15, sensitivity parameter k=0.3; the morphological erosion uses a 7×7 square structuring element, and the morphological dilation uses a 5×5 square structuring element.
[0012] Furthermore, in step 4, the random sampling of some samples is to randomly select 10 samples. The exploratory data analysis needs to take into account the high, medium and low distribution characteristics of protein content in the samples. The criteria for determining redundant bands are: the correlation coefficient between bands is close to 0.99, and the spectral reflectance curves are highly overlapping between different samples, which cannot reflect the differences in protein content between samples.
[0013] Furthermore, the multiple criteria for the PLSVIP+Pearson+p-value joint screening method in step 5 are: VIP>1.0, |Pearson correlation coefficient|>0.25 and p<0.05; the smoothing process is third-order Savitzky-Golay smoothing with a polynomial window of 15; the screening criteria for the KNN-MI nonlinear screening method in step 5 are: sorted in descending order of mutual information value, and the first 6 wavelengths with mutual information value ≥0.3 are retained as the feature wavelength subset.
[0014] Furthermore, the stratification of the random partitioning in step 6 is based on protein content, ensuring that the distribution ratio of high, medium, and low protein content samples in the training set and validation set is consistent; the statistical parameters of the Min-Max normalization are calculated only based on the training set, and the validation set and the test samples reuse the statistical parameters for normalization.
[0015] Furthermore, in step 6, the SVR model uses the radial basis function (RBF) as the kernel function, and the model parameters are: regularization parameter C=1.0, kernel function coefficient is scale, and error tolerance ε=0.01; the KNN model uses the bagging algorithm for optimization, with a decision tree of depth 5 as the base learner and 150 base learners; the DT model uses the classification and regression tree (CART) algorithm, with the minimization of mean squared error as the node splitting criterion.
[0016] Furthermore, the optimal model mentioned in step 6 is a combination of a 6-dimensional feature set obtained by EDA+PCA+statistical feature extraction and an SVR model. The model's validation set has a determination coefficient R² ≥ 0.976 and a root mean square error RMSE ≤ 0.233.
[0017] This invention also proposes a non-destructive detection method for protein content in common bean seeds based on hyperspectral imaging. This method can be applied to the screening of high-protein single plants in common bean breeding, the automated grading of common bean seed quality, or, after parameter adjustment, to the non-destructive detection of protein content in seeds of other edible legume crops such as peas, chickpeas, and cowpeas. The seeds tested can be sown normally.
[0018] The beneficial effects of this invention are: 1. This invention innovatively proposes three targeted feature extraction schemes to adapt to different detection needs: the SFE (EDA+PCA+statistical features) scheme reduces dimensionality and improves quality, the PLS-VIP+Pearson+p-value scheme has strong anti-collinearity, and the KNN-MI scheme captures nonlinear correlations; it effectively solves the problem that existing feature extraction methods do not fit the spectral characteristics of bean seed proteins, and achieves accurate extraction of features related to protein content.
[0019] 2. This invention clarifies the “feature-model” adaptation rule for protein detection in common bean seeds, determines the optimal combination as SFE+SVR, achieves a validation set R² of 0.976 and RMSE of 0.233, and demonstrates significantly better detection accuracy than similar studies, effectively improving the accuracy and stability of predicting protein content in common bean seeds. 3. This invention accurately removes redundant bands through EDA analysis: Based on the trend chart and correlation coefficient heatmap of 10 samples, the first 200 bands in the 384~683nm range are removed, and 100 effective spectra are retained, achieving dimensionality reduction and efficiency improvement; 4. This invention features non-destructive testing throughout the entire process, allowing seeds to be sown normally after testing. It resolves the core contradiction of "testing and retention" in breeding, with a single sample processing time of ≤30s, meeting high-throughput requirements. Detailed Implementation
[0020] Implementation Method 1: This implementation method proposes a non-destructive detection method for protein content in bean seeds based on hyperspectral imaging. The method includes the following steps: Step 1: Sample preparation and determination of protein reference values: After screening for appearance integrity and size consistency, the green bean seeds were grouped. The screening criteria for green bean seeds were as follows: damaged, insect-infested, moldy, and deformed seeds were removed, and seeds with a particle size of 5.5~6.5mm were screened using a standard sieve with a 6mm aperture. Each sample group contained 12 screened green bean seeds.
[0021] The protein content of each group of seeds was determined using the Kjeldahl method as a reference value. The determination process of the Kjeldahl method is as follows: the beans are ground into fine powder, 0.2g of the powder is weighed and mixed with a catalyst of potassium sulfate and copper sulfate in a ratio of 15:1 and concentrated sulfuric acid. The mixture is digested at 400℃ until the solution is clear, and then distilled and titrated using a Kjeldahl nitrogen analyzer. Each sample is measured 3 times and the average value is taken as the reference value of protein content to ensure the reliability of the data benchmark.
[0022] Step 2, Hyperspectral Image Acquisition: In a controlled darkroom environment, a spectral detection range of 384~1022nm was used. A hyperspectral imager was used to acquire hyperspectral images of each group of bean seeds. Preferably, the hyperspectral imager mentioned in step 2 is a HY-6010-S type pushbroom hyperspectral imager with a spectral resolution better than 2.8nm, a spectral sampling interval of 0.5nm, equipped with a 1920×1200 pixel CMOS detector, and using a 4×4 pixel merging method. The controlled environment conditions in the darkroom are as follows: four 100W cold light source halogen lamps are symmetrically distributed on both sides of the optical axis of the imager at a 45° angle, the distance between the sample and the imager lens is 53cm, and the light intensity fluctuation is controlled within ±5% to ensure data stability.
[0023] Step 3: Hyperspectral image preprocessing and average spectrum extraction: The 20th band of the hyperspectral image was used as the reference grayscale image for Gaussian filtering and noise reduction. The Sauvola adaptive binarization algorithm was used to segment the seed target and the background. After morphological erosion, dilation, hole filling and contour filtering, the reflectance of each band of a single bean seed was extracted and the average spectrum of a single seed was calculated. Then, the average spectrum of the single seed of all seeds in each group was taken to obtain the average spectrum of each sample. The Gaussian filtering is a 5×5 Gaussian filter; the parameters of the Sauvola adaptive binarization algorithm are: local window size 15×15, sensitivity parameter k=0.3; the morphological erosion uses a 7×7 square structuring element, and the morphological dilation uses a 5×5 square structuring element to achieve accurate seed segmentation and extract the average spectrum of a single seed and the average spectrum of the sample.
[0024] Step 4: Spectral data preprocessing: Randomly select some samples from all samples for exploratory data analysis, draw a full-band reflectance trend map and a band correlation coefficient matrix heat map, remove redundant bands from 384~683nm, retain effective spectral data from 684~1022nm, and reduce data dimensionality and noise interference. The random sample selection refers to 10 samples. The exploratory data analysis needs to take into account the high, medium and low protein content distribution characteristics of the samples. The criteria for determining the redundant bands are: the correlation coefficient between the bands is close to 0.99, and the spectral reflectance curves are highly overlapping between different samples, which cannot reflect the differences in protein content between samples.
[0025] Step 5, Feature Extraction: Use any of the following methods to extract features related to protein content, ensuring effective capture of both linear and nonlinear correlation features; a) EDA+PCA+Statistical Feature Extraction Method: Principal component analysis is performed on the effective spectral data to reduce dimensionality and extract six statistical features for each wavelength: mean, standard deviation, skewness, kurtosis, maximum value, and minimum value, forming a six-dimensional feature set; b) PLSVIP+Pearson+p-value joint screening method: After smoothing and standard normal variable transformation of the effective spectral data, a partial least squares regression model is constructed to calculate the variable projection importance VIP value. The Pearson correlation coefficient and the univariate significance p-value are combined to screen according to multiple criteria to obtain a subset of characteristic wavelengths. The multiple criteria for the PLSVIP+Pearson+p-value joint screening method are: VIP>1.0, |Pearson correlation coefficient|>0.2 and p<0.05; the smoothing process is third-order Savitzky-Golay smoothing with a polynomial window of 15.
[0026] c) KNN-MI nonlinear screening method: Set the nearest neighbor number K=5, calculate the nonlinear mutual information value between each wavelength and protein content, and filter the characteristic wavelength subset according to the mutual information value; The screening criteria for the KNN-MI nonlinear screening method are as follows: sorted in descending order of mutual information value, and the first 6 wavelengths with mutual information value ≥ 0.3 are retained as a subset of characteristic wavelengths.
[0027] Step 6: Prediction Model Construction and Protein Content Detection: The extracted feature set is randomly divided into training and validation sets in a 75:25 ratio. After Min-Max normalization, at least one regression model is constructed from Support Vector Regression (SVR), K-Nearest Neighbors (KNN), and Decision Tree (DT). The optimal model is selected by the coefficient of determination (R²) and root mean square error (RMSE) of the validation set. The features obtained from the processing of the bean seeds in steps 2 to 5 are input into the optimal model, and the predicted protein content value is output.
[0028] The stratification of random partitioning is based on protein content, ensuring that the distribution ratio of high, medium, and low protein content samples in the training set and validation set is consistent. The statistical parameters of the Min-Max normalization are calculated only based on the training set, and the validation set and the test samples reuse the statistical parameters for normalization.
[0029] The SVR model uses the radial basis function (RBF) as the kernel function, and the model parameters are: regularization parameter C=1.0, kernel function coefficient scale, and error tolerance ε=0.01; the KNN model is optimized using the bagging algorithm, with a decision tree of depth 5 as the base learner and 150 base learners; the DT model uses the classification and regression tree (CART) algorithm, with the minimization of mean squared error as the node splitting criterion.
[0030] The optimal model is a combination of a 6-dimensional feature set obtained by EDA+PCA+statistical feature extraction and an SVR model. The model's validation set has a determination coefficient R² ≥ 0.976 and a root mean square error RMSE ≤ 0.233.
[0031] Implementation Method 2: This implementation method proposes the application of a non-destructive detection method for protein content in common bean seeds based on hyperspectral imaging in the screening of high-protein single plants in common bean breeding. Non-destructive hyperspectral detection and protein content prediction are performed on the seeds of the common bean single plants to be tested. High-protein single plants are screened based on the prediction results, and the tested seeds can be used for sowing normally.
[0032] Implementation Method 3: This implementation method proposes the application of a non-destructive testing method for protein content in bean seeds based on hyperspectral imaging in the standardization and grading of bean seed quality. A protein content threshold is set, and the predicted protein content of the bean seeds to be tested after non-destructive testing is compared with the threshold to achieve automated and full-scale grading of bean seeds.
[0033] Implementation Method 4: This implementation method proposes the application of the non-destructive detection method for protein content in common bean seeds based on hyperspectral imaging to the non-destructive detection of protein content in other edible legume crops. The method is adapted to any one or more legume crops such as peas, chickpeas, and cowpeas. By adjusting the sample selection criteria, feature extraction parameters, and model hyperparameters, the non-destructive detection of protein content in the seeds of the corresponding legume crops can be achieved.
[0034] Example: I. Experimental Materials and Equipment: 1. Common bean seeds: Xiangguan common beans, provided by the Horticulture Laboratory of the College of Modern Agriculture and Ecological Environment of Heilongjiang University, planted at the Hulan Horticulture Research and Demonstration Base, harvested in October 2022, and naturally dried until the moisture content meets the standard; 2. Testing equipment: HY-6010-S type hyperspectral imager (spectral range 384~1022nm, spectral resolution 2.8nm, sampling interval 0.5nm), Kjeldahl nitrogen analyzer, grinder, 6mm aperture standard sieve, 100W cold light source halogen lamp, dark room (1m×1m×1.5m). 3. Data processing software: Matlab R2021b.
[0035] II. Implementation Steps: 1. Sample preparation: 2400 seeds were randomly selected and divided into 200 groups (12 seeds per group) after screening according to standards; the protein content was determined by the Kjeldahl method, with a reference range of 213.11~292.44 g / kg; 2. Hyperspectral image acquisition: In a darkroom environment, four halogen lamps were symmetrically distributed at 45° on both sides of the optical axis of the imager. The distance between the sample and the lens was adjusted to 53cm. 200 sets of sample images were acquired, and the light intensity was calibrated every 2 hours. 3. Image preprocessing and spectral extraction: 3.1 Select the 20th band as the reference grayscale image and apply a 5×5 Gaussian filter for noise reduction; 3.2 Sauvola adaptive binarization (15×15 window, k=0.3) segmentation of seed and background; 3.3 7×7 erosion to eliminate noise points, 5×5 expansion to fill holes, and screening of contours after hole filling (removing areas with an area < 5 pixels); 3.4 Extract the average reflectance of each band of a single seed, and calculate the average spectrum of each group of 12 seeds by column; 4. Spectral preprocessing: Ten samples were randomly selected from 200 samples for EDA analysis. A full-band trend map and a correlation coefficient heatmap were plotted. The first 200 redundant bands in the range of 384-683nm were removed, and 100 effective spectra in the range of 684-1022nm were retained. 5. Feature extraction: Feature extraction can be performed using any of the following three methods: 5.1 SFE scheme: After performing PCA dimensionality reduction on the effective spectral data, extract six statistical features: mean, standard deviation, skewness, kurtosis, maximum value, and minimum value. 5.2 PLS-VIP+Pearson+p value scheme: After performing SNV (Standard Normal Variation) preprocessing on the effective spectral data to eliminate sample scale differences, a PLS model is constructed, and characteristic wavelengths are selected according to VIP>1.0, >0.25, and p<0.05; 5.3 KNN-MI scheme: Set K=5, calculate the mutual information value between wavelength and protein content, and retain the first 6 features with mutual information value ≥0.3; 6. Model Building and Validation: 6.1 The feature sets extracted by the three schemes are randomly divided into a training set (150 groups) and a validation set (50 groups) in a 75:25 stratified manner, and the Min-Max is normalized to [0,1]. 6.2 Construct SVR (RBF kernel, C=1.0, ε=0.01), KNN (Bagging optimization, 150 base learners), and DT (CART algorithm) models; among which SVR (Support Vector Regression) uses the radial basis function (RBF) as the kernel function; 6.3 Validation results: The SFE+SVR combination is optimal, with a validation set R²=0.976 and RMSE=0.233; PLS+KNN (R²=0.947) and KNN-MI+DT (R²=0.892) are alternative combinations. 7. Practical Applications: 7.1 Breeding and screening: 500 F2 generation seeds were tested, and 32 high-protein single plants were selected, with a sowing survival rate of 98%; 7.2 Quality Grading: Full testing of 1000kg of seeds, automated grading based on protein content ≥250g / kg (Grade 1) and 200~250g / kg (Grade 2). Compared with traditional grading methods, the testing and grading efficiency is improved by 90%.
[0036] III. Implementation Results: This embodiment achieves non-destructive detection of protein content in common bean seeds through a standardized process. The optimal model has a prediction accuracy of R² of 0.976, and the processing time for a single sample is ≤30s. The seeds can be used normally after detection. This not only meets the accuracy requirements of breeding and screening, but also adapts to the high-throughput requirements of industrial grading, and can be extended to the detection of other legume crops.
[0037] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent substitutions, and improvements made to the above embodiments without departing from the scope of the present invention, based on the technical essence of the present invention and within the spirit and principles of the present invention, shall still fall within the protection scope of the present invention.
Claims
1. A non-destructive method for detecting protein content in common bean seeds based on hyperspectral imaging, characterized in that, The method includes the following steps: Step 1, Sample preparation and protein reference value determination: After screening, the seeds of common bean were grouped, and the protein content of each group of seeds was determined by the Kjeldahl method as the protein content reference value. Step 2, Hyperspectral Image Acquisition: In a controlled darkroom environment, a hyperspectral imager with a spectral detection range of 384~1022nm was used to acquire hyperspectral images of each group of bean seeds. Step 3: Hyperspectral image preprocessing and average spectrum extraction: The 20th band of the hyperspectral image is selected as the reference grayscale image for Gaussian filtering and noise reduction. The Sauvola adaptive binarization algorithm is used to segment the seed target and the background. After morphological erosion, dilation, hole filling and contour filtering, the reflectance of each band of a single bean seed is extracted and the average spectrum of a single seed is calculated. Then, the average spectrum of the single seed of all seeds in each group is taken to obtain the average spectrum of each sample. Step 4: Spectral data preprocessing: Randomly select some samples from all samples for exploratory data analysis, draw a full-band reflectance trend map and a band correlation coefficient matrix heat map, remove redundant bands from 384~683nm, and retain effective spectral data from 684~1022nm. Step 5, Feature Extraction: Use any one of the following methods to extract features related to protein content to obtain a feature set: EDA+PCA+statistical feature extraction, PLS-VIP+Pearson+p-value joint screening, and KNN-MI nonlinear screening. The EDA+PCA+statistical feature extraction method is as follows: Principal component analysis is performed on the effective spectral data to reduce dimensionality, and six statistical features are extracted for each wavelength: mean, standard deviation, skewness, kurtosis, maximum value, and minimum value, forming a 6-dimensional feature set. The PLS-VIP+Pearson+p-value joint screening method is as follows: after smoothing and standard normal variable transformation of the effective spectral data, a partial least squares regression model is constructed to calculate the variable projection importance VIP value, and the Pearson correlation coefficient and the univariate significance p-value are combined to perform multi-criteria screening to obtain a subset of characteristic wavelengths; The KNN-MI nonlinear screening method is as follows: set the nearest neighbor number K=5, calculate the nonlinear mutual information value between each wavelength and the protein content, and screen the feature wavelength subset according to the mutual information value; Step 6: Prediction Model Construction and Protein Content Detection: The extracted feature set is randomly divided into training and validation sets in a 75:25 ratio. After Min-Max normalization, at least one regression model is constructed from Support Vector Regression (SVR), K-Nearest Neighbors (KNN), and Decision Tree (DT). The optimal model is selected by the coefficient of determination (R²) and root mean square error (RMSE) of the validation set. The features obtained from the processing of the bean seeds in steps 2 to 5 are input into the optimal model, and the predicted protein content value is output.
2. The non-destructive detection method for protein content in common bean seeds based on hyperspectral imaging according to claim 1, characterized in that, The screening criteria for the bean seeds mentioned in step 1 are as follows: damaged, insect-infested, moldy, and deformed seeds are removed, and seeds with a particle size of 5.5~6.5mm are screened using a standard sieve with a 6mm aperture. Each sample group contains 12 screened bean seeds. The determination process of the Kjeldahl method is as follows: the seeds of common bean are ground into fine powder, 0.2g of the powder is weighed and mixed with a catalyst of potassium sulfate and copper sulfate in a ratio of 15:1 and concentrated sulfuric acid. The mixture is digested at 400℃ until the solution is clear. The solution is then distilled and titrated using a Kjeldahl nitrogen analyzer. Each sample is measured 3 times and the average value is taken as the reference value for protein content.
3. The non-destructive detection method for protein content in common bean seeds based on hyperspectral imaging according to claim 1, characterized in that, The hyperspectral imager mentioned in step 2 is a HY-6010-S type pushbroom hyperspectral imager with a spectral resolution better than 2.8nm, a spectral sampling interval of 0.5nm, and equipped with a 1920×1200 pixel CMOS detector, using a 4×4 pixel binning method. The controllable environment conditions of the darkroom are as follows: four 100W cold light source halogen lamps are symmetrically distributed on both sides of the optical axis of the imager at a 45° angle, the distance between the sample and the imager lens is 53cm, and the light intensity fluctuation is controlled within ±5%.
4. The non-destructive detection method for protein content in common bean seeds based on hyperspectral imaging according to claim 1, characterized in that, The Gaussian filtering in step 3) is a 5×5 Gaussian filtering; the parameters of the Sauvola adaptive binarization algorithm are: local window size 15×15, sensitivity parameter k=0.3; the morphological erosion uses a 7×7 square structuring element, and the morphological dilation uses a 5×5 square structuring element.
5. The non-destructive detection method for protein content in common bean seeds based on hyperspectral imaging according to claim 1, characterized in that, In step 4), the random sampling of samples refers to randomly selecting 10 samples. The exploratory data analysis needs to take into account the high, medium, and low distribution characteristics of protein content in the samples. The criteria for determining redundant bands are: the correlation coefficient between bands is close to 0.99, and the spectral reflectance curves highly overlap between different samples, failing to reflect the differences in protein content between samples.
6. The non-destructive detection method for protein content in common bean seeds based on hyperspectral imaging according to claim 1, characterized in that, The multiple criteria for the PLSVIP+Pearson+p-value joint screening method in step 5 are: VIP>1.0, |Pearson correlation coefficient|>0.25 and p<0.05; the smoothing process is third-order Savitzky-Golay smoothing with a polynomial window of 15. The screening criteria for the KNN-MI nonlinear screening method described in step 5 are as follows: sorted in descending order of mutual information value, and the first 6 wavelengths with mutual information value ≥ 0.3 are retained as a subset of characteristic wavelengths.
7. The non-destructive detection method for protein content in common bean seeds based on hyperspectral imaging according to claim 1, characterized in that, The stratification of random partitioning in step 6) is based on protein content to ensure that the distribution ratio of high, medium and low protein content samples in the training set and validation set is consistent; the statistical parameters of the Min-Max normalization are calculated only based on the training set, and the validation set and the test samples reuse the statistical parameters for normalization.
8. The non-destructive detection method for protein content in common bean seeds based on hyperspectral imaging according to claim 1, characterized in that, In step 6), the SVR model uses the radial basis function (RBF) as the kernel function, and the model parameters are: regularization parameter C=1.0, kernel function coefficient is scale, and error tolerance ε=0.01; the KNN model is optimized using the bagging algorithm, with a decision tree of depth 5 as the base learner and 150 base learners; the DT model uses the classification and regression tree (CART) algorithm, with the minimization of mean squared error as the node splitting criterion.
9. The non-destructive detection method for protein content in common bean seeds based on hyperspectral imaging according to claim 1, characterized in that, The optimal model mentioned in step 6) is a combination of a 6-dimensional feature set obtained by EDA+PCA+statistical feature extraction and an SVR model. The model's validation set has a determination coefficient R² ≥ 0.976 and a root mean square error RMSE ≤ 0.
233.
10. A non-destructive method for detecting protein content in common bean seeds based on hyperspectral imaging according to any one of claims 1 to 9, characterized in that, The method can be applied to the screening of high-protein single plants in common bean breeding and the automated grading of common bean seed quality. Alternatively, after parameter adjustment, it can be applied to the non-destructive detection of protein content in seeds of other edible legume crops such as peas, chickpeas, and cowpeas. Seeds that have been tested can be sown normally.