A method for nondestructive testing of green soybeans based on hyperspectral images

By constructing a morphological distribution model and a spectral-morphological coupling operator, the background signal of the pod epidermis is stripped away, and a self-referenced differential spectral feature set is generated. This solves the problem of distinguishing between the bean support area and the pod background in edamame detection, and achieves high-precision identification of hidden defects and adaptive detection.

CN121504920BActive Publication Date: 2026-04-14SICHUAN HONGBO AGRICULTURAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SICHUAN HONGBO AGRICULTURAL TECHNOLOGY CO LTD
Filing Date
2026-01-12
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing edamame detection methods are unable to effectively distinguish between the ridge area supported by the beans and the background of pure pods, resulting in a low signal-to-noise ratio for detecting latent defects such as insect holes and empty shells. They are also unable to adapt to the non-linear changes of different batches of samples, which can easily lead to missed detections or misjudgments.

Method used

By collecting hyperspectral image data, a morphological distribution model is constructed. Using gradient partitioning threshold and spectral-morphological coupling operator, the background signal of the pod epidermis is stripped to generate a self-referenced differential spectral feature set. Anomaly detection is performed by combining long-wavelength spectral response. A closed-loop adaptive optimization mechanism is introduced to dynamically update parameters to adapt to biological differences between different batches.

Benefits of technology

It achieves transparent-level quantitative classification of latent defects, significantly improving detection accuracy and robustness. It can accurately identify the internal state without damaging the integrity of the pods and is suitable for edamame samples from different origins or batches.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121504920B_ABST
    Figure CN121504920B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of nondestructive testing and intelligent sorting of agricultural products, in particular to a kind of soybean based on hyperspectral image nondestructive testing method, comprising: collecting the original hyperspectral image data of soybean sample, generate pre-processing hyperspectral data cube;Calculate spatial gradient field, and apply gradient partition threshold to construct morphological distribution model;Spectrum-morphology coupling operator is constructed, and the output self-referenced differential spectrum feature set;For long-wave band spectral response, execute anomaly detection, generate internal state determination result output detection classification data;According to error distribution characteristics, update the gradient partition threshold of morphological distribution model and the weight parameter of spectrum-morphology coupling operator, generate final detection result for downstream sorting equipment to call;The present application solves the problem that fixed model produces performance drift with sample change, ensures the stability of sorting precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of non-destructive testing and intelligent sorting technology for agricultural products, specifically a non-destructive testing method for edamame based on hyperspectral images. Background Technology

[0002] In the current field of agricultural product quality sorting, hyperspectral imaging technology is widely used for internal quality assessment of pod crops such as edamame. Edamame samples usually have a complex physical structure, and their thick pod epidermis, as a strong scattering medium, will significantly attenuate the penetration depth of light and mask weak physiological signals inside.

[0003] Existing detection methods generally employ global region of interest extraction or analysis based on fixed spectral benchmarks, failing to effectively distinguish between the ridge region supported by beans and the valley region in the pure pod background. Due to biological differences in maturity and growth status among individual edamame beans, the surface color of the pods varies and the thickness distribution is uneven, leading to random drift of the spectral baseline. This fluctuation in background signal makes it difficult for traditional algorithms to extract specific signals characterizing the internal bean state from the mixed spectrum, resulting in low signal-to-noise ratio for detecting latent defects such as insect holes and empty shells. It is also difficult to adapt to the nonlinear changes of different batches of samples, easily causing missed detections or misjudgments. Therefore, how to effectively suppress scattering interference from the pod epidermis and eliminate baseline drift caused by individual biological differences while preserving the integrity of the pod, in order to improve the robustness and accuracy of identifying latent internal defects, has become an urgent technical problem to be solved. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides a non-destructive testing method for edamame based on hyperspectral images. Specifically, the technical solution of this invention includes:

[0005] S1. Collect the raw hyperspectral image data of edamame samples and perform radiometric correction preprocessing to generate a preprocessed hyperspectral data cube;

[0006] S2. Extract short-band morphological feature images from the preprocessed hyperspectral data cube, calculate the spatial gradient field, and apply the gradient partitioning threshold to construct a morphological distribution model. Based on this model, obtain the ridge region mask and valley region mask, where the ridge region corresponds to the bean support region and the valley region corresponds to the bean pod background region.

[0007] S3. Using the spectral data corresponding to the valley region mask as the reference background, and combining it with the spectral data corresponding to the ridge region mask, a spectral-morphological coupling operator is constructed. This operator is used to calculate the spectral differences between the ridge and valley regions, and outputs a self-referenced differential spectral feature set.

[0008] S4. Input the self-referenced differential spectral feature set into the feature analysis module, perform anomaly detection for the long-wavelength spectral response, generate internal state judgment results, classify and label the edamame samples according to the internal state judgment results, and output detection grading data.

[0009] S5. Compare the detection grading data with the preset quality standard distribution for error assessment. If the error assessment result fails, update the gradient partition threshold of the morphological distribution model and the weight parameters of the spectral-morphological coupling operator according to the error distribution characteristics, and regenerate the final detection result based on the updated parameters for downstream sorting equipment to use.

[0010] Preferably, S1 includes the following steps:

[0011] S11. Raw hyperspectral image data of edamame samples were acquired using a pushbroom hyperspectral imaging device under diffuse light conditions;

[0012] S12. Obtain standard white board reflectance data and dark current noise data, perform reflectance correction operation on the original hyperspectral image data, eliminate the influence of light source non-uniformity and sensor dark noise, and obtain reflectance correction data;

[0013] S13. Perform spatial smoothing filtering and spectral denoising on the reflectance correction data to form a preprocessed hyperspectral data cube containing complete spatial and spectral information.

[0014] Preferably, S2 includes the following steps:

[0015] S21. Select short-band components with weak penetration characteristics from the preprocessed hyperspectral data cube to generate a short-band morphological feature image, wherein the short-band components are chlorophyll strong absorption bands.

[0016] S22. Apply the gradient operator to the short-band morphological feature image to calculate the gradient magnitude and gradient direction of the pixel, and generate a spatial gradient field;

[0017] S23. Based on the spatial gradient field, the local maximum region on the surface of edamame is identified by using the gradient partitioning threshold. The local maximum region is defined as the ridge region formed by the internal bean grains and a ridge region mask is generated.

[0018] S24. Identify local minima on the surface of edamame, define them as gaps between beans or pure pod regions, and generate valley region masks. The ridge region masks and valley region masks together constitute a morphological distribution model.

[0019] Preferably, S3 includes the following steps:

[0020] S31. Extract the average spectrum of the ridge region covered by the ridge region mask, and the average spectrum of the valley region covered by the valley region mask;

[0021] S32. Construct a spectral-morphological coupling operator, which is defined as a ratio function or difference function of the average spectrum of the ridge region and the average spectrum of the valley region, used to mathematically strip the background signal of the pod epidermis.

[0022] S33. Use the spectral-morphological coupling operator to perform full-band decoupling operation on the preprocessed hyperspectral data cube and calculate the ridge-valley difference index for each wavelength;

[0023] S34. Combine the ridge-valley difference indices across the entire wavelength band according to the wavelength sequence to form a self-referenced differential spectral feature set that can reflect the physical state of the interface between the internal beans and pods.

[0024] Preferably, S4 includes the following steps:

[0025] S41. Extract long-wavelength near-infrared components from the self-referenced differential spectral feature set, wherein the long-wavelength near-infrared components correspond to the water absorption peak or the scattering sensitive band of biological tissue.

[0026] S42. Calculate the spectral intensity or slope of the long-wavelength near-infrared component as a scattering gain feature. If the value of the scattering gain feature is greater than the preset air gap scattering threshold, it is determined that there is an air layer inside, and the internal state determination result of empty shell or shriveled particle is generated.

[0027] S43. Analyze the oxidation characteristic band in the self-reference differential spectral feature set, calculate the intensity change rate of the band relative to the reference background, and if the intensity change rate is greater than the preset browning threshold, it is determined that there is biological erosion inside, resulting in an internal state determination result of insect infestation or mold.

[0028] S44. If the scattering gain characteristic is less than or equal to the air gap scattering threshold and the intensity change rate is less than or equal to the browning threshold, then a full and normal internal state determination result is generated, and all results are summarized to output detection grading data.

[0029] Preferably, S5 includes the following steps:

[0030] S51. Statistical analysis of the spectral dispersion and classification confidence distribution of various categories in graded data;

[0031] S52. Calculate the intra-class distance and inter-class distance of the current batch of test results, and generate a clustering validity index as the error evaluation result;

[0032] S53. Compare the clustering effectiveness index with the preset benchmark index. If the clustering effectiveness index is lower than the benchmark index, it indicates that the morphological partitioning is inaccurate or the spectral decoupling is incomplete, triggering the parameter update mechanism.

[0033] S54. In the parameter update mechanism, fine-tune the gradient threshold used to generate the ridge region mask in S2, or adjust the baseline correction coefficient of the spectral-morphological coupling operator in S3 to maximize the inter-class distance.

[0034] S55. Output the final detection result after parameter optimization and confirmation, and generate sorting control instructions based on the final detection result.

[0035] Preferably, the sorting control instructions generated in S55 follow the following sorting rules:

[0036] Grade 1 product rule: The internal state judgment result is full and normal, and the baseline fluctuation amplitude of the self-reference differential spectral feature set is less than the preset uniformity threshold;

[0037] Second-level product rule: The internal state judgment result is full and normal, and the baseline fluctuation amplitude is greater than or equal to the preset uniformity threshold and less than or equal to the preset tolerance upper limit;

[0038] Rejection rules: Any of the following conditions must be met: the internal condition is determined to be empty shell, shriveled grain, insect infestation or mold; the baseline fluctuation amplitude is greater than the preset tolerance upper limit; the self-reference differential spectral feature set shows abnormal spectral distortion.

[0039] Preferably, the center wavelength of the short-wavelength component is 450nm. By utilizing the high absorption and low penetration characteristics of light in this wavelength band on the plant epidermis, the physical morphology of the edamame surface can be accurately reconstructed.

[0040] The long-wavelength near-infrared component includes the 970nm moisture absorption band. By utilizing the sensitivity of this band to changes in optical path and the scattering characteristics of the medium, the physical void structure inside the bean pod can be detected.

[0041] Compared with the prior art, the present invention has the following beneficial effects:

[0042] 1. This invention achieves precise separation of physical optical path and morphological region; by extracting short-band components with weak penetration characteristics to construct spatial gradient field, the morphological distribution model is used to accurately distinguish the ridge region supported by internal beans from the valley region with pure bean pod background; this method abandons the traditional global region of interest extraction mode, and uses the high absorption characteristics of specific bands on plant epidermis to reconstruct three-dimensional morphology, clearly defining the boundary between bean-containing and bean-free areas in physical space, and avoiding the mixing of background noise into the effective signal;

[0043] 2. This invention constructs a self-reference detection mechanism, which significantly improves the signal-to-noise ratio. It uses the valley region spectrum as a dynamic reference background and performs differential operations on the ridge region through a spectral morphology coupling operator, which mathematically simulates the process of peeling off the pod epidermis. This mechanism can effectively suppress common-mode interference caused by individual maturity differences, uneven epidermal thickness, or color variations, and eliminate spectral baseline drift, thereby greatly highlighting the heterogeneous signals of the internal beans and solving the problem of strong scattering media masking weak physiological signals.

[0044] 3. This invention achieves a transparent-level quantitative classification of latent defects; for the long-wavelength near-infrared component, by calculating the intensity change rate of scattering gain characteristics and oxidation characteristic bands, qualitative scattering and browning are transformed into quantitative discrimination logic; the sensitivity of the moisture absorption peak to changes in optical path is used to detect the internal air layer, and oxidation characteristics are used to identify biological erosion, thereby accurately distinguishing the internal states such as fullness, empty shells and insect damage without destroying the integrity of the pod.

[0045] 4. This invention possesses closed-loop adaptive optimization capabilities, ensuring the robustness of the algorithm; it introduces an error evaluation mechanism based on clustering effectiveness indicators, which can dynamically update the gradient partition threshold and coupling operator weights in reverse according to the distribution characteristics of the detection and grading data; this closed-loop feedback design ensures that the system can automatically adapt to the biological differences of edamame from different origins or batches, correct the decision boundary in real time, solve the problem of performance drift caused by fixed models as samples change, and ensure the stability of sorting accuracy. Attached Figure Description

[0046] The present invention will be further explained below with reference to the accompanying drawings and embodiments:

[0047] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.

[0049] Example 1:

[0050] Please see Figure 1 A non-destructive testing method for edamame based on hyperspectral images includes the following steps:

[0051] S1. Collect the raw hyperspectral image data of edamame samples and perform radiometric correction preprocessing to generate a preprocessed hyperspectral data cube;

[0052] S2. Extract short-band morphological feature images from the preprocessed hyperspectral data cube, calculate the spatial gradient field, and apply the gradient partitioning threshold to construct a morphological distribution model. Based on this model, obtain the ridge region mask and valley region mask, where the ridge region corresponds to the bean support region and the valley region corresponds to the bean pod background region.

[0053] S3. Using the spectral data corresponding to the valley region mask as the reference background, and combining it with the spectral data corresponding to the ridge region mask, a spectral-morphological coupling operator is constructed. This operator is used to calculate the spectral differences between the ridge and valley regions, and outputs a self-referenced differential spectral feature set.

[0054] S4. Input the self-referenced differential spectral feature set into the feature analysis module, perform anomaly detection for the long-wavelength spectral response, generate internal state judgment results, classify and label the edamame samples according to the internal state judgment results, and output detection grading data.

[0055] S5. Compare the detection grading data with the preset quality standard distribution for error assessment. If the error assessment result fails, update the gradient partition threshold of the morphological distribution model and the weight parameters of the spectral-morphological coupling operator according to the error distribution characteristics, and regenerate the final detection result based on the updated parameters for downstream sorting equipment to use.

[0056] This embodiment details the overall architecture and core logic of a non-destructive testing method for edamame based on hyperspectral images. This method aims to address the problem of strong scattering by the pod epidermis masking weak internal physiological signals. The system performs data acquisition and standardization steps, collecting raw data and performing radiometric correction to establish a unified physical reflectivity benchmark, providing a linearized data foundation for subsequent spectral decoupling. It then performs morphological feature-guided region segmentation. Unlike traditional global region of interest extraction, this step utilizes short-band images to construct a gradient field in space, accurately distinguishing the ridge region supported by the beans from the valley region of the pure pod background, achieving preliminary separation of the physical optical path. Finally, it performs core spectral decoupling and feature reconstruction, using the spectrum of the valley region as a dynamic reference background. A spectral-morphological coupling operator is used to perform differential operations on the ridge region. This process mathematically simulates the physical process of peeling off the pod epidermis, generating a self-referenced differential spectral feature set that reflects the heterogeneity of the internal beans.

[0057] Based on this, the system inputs the feature set into the feature analysis module to perform anomaly detection on the spectral response features of the long-wavelength band, generating internal state judgment results including fullness, empty shells, or insect damage. A closed-loop adaptive optimization mechanism is introduced, which dynamically updates the gradient partition threshold and coupling operator weights by evaluating the error between the detection grading data and the standard distribution, ensuring that the system can adapt to the biological differences of different batches of edamame. This embodiment creatively realizes a self-reference detection mode by constructing a morphology-spectrum coupling mechanism and using the edamame's own pod signal as a reference light. In the scenario of non-destructive testing of agricultural products, this mode effectively overcomes the technical problem of pod color variations caused by individual maturity differences, which interfere with the spectral baseline. It significantly improves the signal-to-noise ratio for latent defects, making it possible to accurately detect tiny insect holes or empty shells without changing the appearance of the pods without damaging their integrity.

[0058] Example 2:

[0059] S1 includes the following steps:

[0060] S11. Raw hyperspectral image data of edamame samples were acquired using a pushbroom hyperspectral imaging device under diffuse light conditions;

[0061] S12. Obtain standard white board reflectance data and dark current noise data, perform reflectance correction operation on the original hyperspectral image data, eliminate the influence of light source non-uniformity and sensor dark noise, and obtain reflectance correction data;

[0062] S13. Perform spatial smoothing filtering and spectral denoising on the reflectance correction data to form a preprocessed hyperspectral data cube containing complete spatial and spectral information.

[0063] This embodiment further specifies the data acquisition and standardization steps in Embodiment 1, focusing on building a high-quality physical layer data foundation. The system uses a pushbroom hyperspectral imaging device to scan and acquire data in a diffuse light environment. The diffuse environment setting aims to suppress the high-gloss reflection generated by the fuzz on the surface of the soybean, ensuring that the acquired light is diffuse reflection spectrum rather than specular reflection. A reflectance correction calculation is performed to convert the original digital DN value into physical reflectance. The calculation formula is as follows:

[0064] ;

[0065] in, The values ​​are the corrected reflectance data, ranging from 0 to 1; These are the spatial pixel coordinates of the image; For spectral band indexing; The source is the image data collected by the imaging device, and its physical meaning is the raw image data of edamame. The data source is the sensor when the light source is off, and its physical meaning is the sensor's inherent thermal noise and dark current data. The data source is a standard whiteboard made of polytetrafluoroethylene (PTFE), which represents the maximum response of the detector under the current lighting conditions. Multidimensional noise reduction is performed on the corrected data. In the spatial dimension, smoothing filtering is used to remove dead pixels and random speckle, and in the spectral dimension, Savitzky-Golay filtering is used to remove spectral glitches, ultimately generating a preprocessed hyperspectral data cube. This embodiment, through rigorous bright and dark field correction and multidimensional filtering strategies, minimizes the systematic interference from uneven ambient lighting and sensor thermal noise. In the high-speed sorting scenario of edamame, this high signal-to-noise ratio data preprocessing ensures that the small spectral differences between ridges and valleys in subsequent steps, typically less than 5%, are recognized by the system as biological structural differences rather than noise fluctuations, thus guaranteeing the reliability and stability of feature extraction.

[0066] Example 3:

[0067] S2 includes the following steps:

[0068] S21. Select short-band components with weak penetration characteristics from the preprocessed hyperspectral data cube to generate a short-band morphological feature image, wherein the short-band components are chlorophyll strong absorption bands.

[0069] S22. Apply the gradient operator to the short-band morphological feature image to calculate the gradient magnitude and gradient direction of the pixel, and generate a spatial gradient field;

[0070] S23. Based on the spatial gradient field, the local maximum region on the surface of edamame is identified by using the gradient partitioning threshold. The local maximum region is defined as the ridge region formed by the internal bean grains and a ridge region mask is generated.

[0071] S24. Identify local minimum regions on the surface of edamame, define them as gaps between beans or pure pod regions, and generate valley region masks. The ridge region masks and valley region masks together constitute a morphological distribution model.

[0072] The center wavelength of the short-wavelength component is preferably 450nm. By utilizing the high absorption and low penetration characteristics of light in this wavelength band on the plant epidermis, the physical morphology of the edamame surface can be accurately reconstructed.

[0073] This embodiment further specifies the morphological feature-guided region segmentation step in Embodiment 1, and incorporates a preferred specific physical band; the system selects the short-band component with a center wavelength of 450nm from the preprocessed hyperspectral data cube as the morphological feature image. This band was chosen because it lies within the strong absorption band of chlorophyll and carotenoids in plants, resulting in extremely shallow light penetration. The Sobel operator was applied to calculate the gradient magnitude of each pixel. The calculation formula is: ;

[0074] in , Convolutional kernels in both horizontal and vertical directions; based on gradient partitioning thresholds. ,in, The initial value is calculated by taking the global average gradient of the short-band morphological feature image in the current preprocessed hyperspectral data cube. And multiply by a preset scaling factor Determine that the threshold can be dynamically updated in S5 to segment the gradient field: generate ridge region masks. When the pixel satisfies and When the region is identified as a ridge, it is marked. , here To obtain the grayscale baseline value based on the Otsu algorithm, only non-zero pixels in the preprocessed hyperspectral data cube or pixels in the edamame region after simple thresholding to remove the background are selected for Otsu calculation, in order to eliminate the interference of the dark background of the conveyor belt on the bimodal characteristics of the grayscale histogram; high gradient and high brightness are used together to constrain and locate the protruding parts supported by the beans, generating valley region masks. When the pixel satisfies or When it is determined to be background or gap, it is marked. This embodiment introduces variable... A morphological distribution model was constructed, and the physical characteristics of the 450nm band were used to recover the three-dimensional morphological information in the two-dimensional image. The pixel-level boundaries between the bean-containing and bean-free regions were clarified, providing adjustable geometric control variables for parameter closed-loop optimization in the subsequent step S5.

[0075] Example 4:

[0076] S3 includes the following steps:

[0077] S31. Extract the average spectrum of the ridge region covered by the ridge region mask, and the average spectrum of the valley region covered by the valley region mask;

[0078] S32. Construct a spectral-morphological coupling operator, which is defined as a ratio function or difference function of the average spectrum of the ridge region and the average spectrum of the valley region, used to mathematically strip the background signal of the pod epidermis.

[0079] S33. Use the spectral-morphological coupling operator to perform full-band decoupling operation on the preprocessed hyperspectral data cube and calculate the ridge-valley difference index for each wavelength;

[0080] S34. Combine the ridge-valley difference indices across the entire wavelength band according to the wavelength sequence to form a self-referenced differential spectral feature set that can reflect the physical state of the interface between the internal beans and pods.

[0081] This embodiment further specifies the spectral decoupling and feature reconstruction steps in Embodiment 1, and elaborates on the mathematical process of self-referenced feature extraction. The system calculates the average pixel value within the ridge region mask and valley region mask respectively, and extracts the average spectrum of the ridge region and the average spectrum of the valley region. A spectral-morphological coupling operator is constructed, which is defined as a difference ratio function to calculate the ridge-valley difference index at each wavelength, as shown in the following formula:

[0082] ;

[0083] The source is the decoupling operation result, and its physical meaning is the ridge valley difference index, which quantifies the signal gain of the internal object relative to the background pod. The source is the ridge region mask extraction, and its physical meaning is the average spectral signal within the ridge region, which contains composite information of pods and beans; The source is valley region mask extraction, and its physical meaning is the average spectral signal within the valley region, which serves as a pure bean pod background reference; The source is feedback adjustment or preset value, and its physical meaning is baseline correction coefficient, used to balance the thickness differences of pods in different parts; in this embodiment, Defined as a scalar coefficient applicable across the entire band, it is used to linearly scale the overall amplitude of the background signal in the valley region, thereby simulating the overall attenuation effect of light intensity on pods of different thicknesses. The initial value is preferably set between 0.8 and 1.2, for example, 1.0, which represents the initial assumption that the background transmittance of the ridge region and the valley region are approximately equal; The source is a very small constant, such as 1e-5, and its physical meaning is a zero-prevention smoothing term;

[0084] The operator is used to perform full-band decoupling operations, and the results are combined to form a self-referenced differential spectral feature set. In this embodiment, a robust self-reference mechanism is constructed by dynamically using the spectrum of the valley region to calibrate the spectrum of the ridge region. When processing edamame from different origins or different batches, this mechanism can automatically cancel the baseline drift caused by changes in the overall color depth. Regardless of whether the edamame is dark green or light green, its own background signal can be effectively stripped away, thereby greatly highlighting the specific signal of the internal beans and improving the versatility of the detection algorithm.

[0085] Example 5:

[0086] S4 includes the following steps:

[0087] S41. Extract long-wavelength near-infrared components from the self-referenced differential spectral feature set, wherein the long-wavelength near-infrared components correspond to the water absorption peak or the scattering sensitive band of biological tissue.

[0088] S42. Calculate the spectral intensity or slope of the long-wavelength near-infrared component as a scattering gain feature. If the value of the scattering gain feature is greater than the preset air gap scattering threshold, it is determined that there is an air layer inside, and the internal state determination result of empty shell or shriveled particle is generated.

[0089] S43. Analyze the oxidation characteristic band in the self-reference differential spectral feature set, calculate the intensity change rate of the band relative to the reference background, and if the intensity change rate is greater than the preset browning threshold, it is determined that there is biological erosion inside, resulting in an internal state determination result of insect infestation or mold.

[0090] S44. If the scattering gain characteristic is less than or equal to the air gap scattering threshold and the intensity change rate is less than or equal to the browning threshold, then generate a full and normal internal state judgment result, summarize all results and output detection grading data.

[0091] The long-wavelength near-infrared component includes the 970nm moisture absorption band. By utilizing the sensitivity of this band to changes in optical path and the scattering characteristics of the medium, the physical void structure inside the bean pod can be detected.

[0092] This embodiment further specifies the internal state determination step in Embodiment 1, and utilizes long-wavelength features for defect classification; the system uses a self-referenced differential spectral feature set. Extract the long-wavelength near-infrared component; calculate the scattering gain characteristics at the 970nm band. This feature is defined as the local slope of the spectrum at the left shoulder of the moisture absorption peak, and is calculated using the following formula: ;

[0093] like , If a preset air gap scattering threshold is set, for example to 0.05, then strong multiple scattering of light at the tissue-air-tissue interface is determined, indicating the presence of an internal air layer, resulting in the determination of empty shells or shriveled particles; the oxidation characteristics of the visible light red edge region are analyzed, and the intensity change rate is calculated. : ;

[0094] in, This indicates the summation of data across all wavelength bands within the range of 600nm to 700nm; if , If a browning threshold is preset, for example, 0.15, the cell is determined to have undergone oxidative browning, and a result indicating pest infestation or mold is generated. If none of the above characteristics exceed the standard, a result indicating fullness and normality is generated. This embodiment uses clear mathematical definitions, slope and integral ratio to transform qualitative scattering and browning into computer-executable quantitative logic, thereby achieving a see-through level detection of the internal physical structure.

[0095] Example 6:

[0096] S5 includes the following steps:

[0097] S51. Statistical analysis of the spectral dispersion and classification confidence distribution of various categories in graded data;

[0098] S52. Calculate the intra-class distance and inter-class distance of the current batch of test results, and generate a clustering validity index as the error evaluation result;

[0099] S53. Compare the clustering effectiveness index with the preset benchmark index. If the clustering effectiveness index is lower than the benchmark index, it indicates that the morphological partitioning is inaccurate or the spectral decoupling is incomplete, triggering the parameter update mechanism.

[0100] S54. In the parameter update mechanism, fine-tune the gradient threshold used to generate the ridge region mask in S2, or adjust the baseline correction coefficient of the spectral-morphological coupling operator in S3 to maximize the inter-class distance.

[0101] S55. Output the final detection result after parameter optimization and confirmation, and generate sorting control instructions based on the final detection result; the sorting control instructions generated in S55 follow the following sorting rules: Grade 1 product rule: the internal state judgment result is full and normal, and the baseline fluctuation amplitude of the self-reference differential spectral feature set is less than the preset uniformity threshold; Grade 2 product rule: the internal state judgment result is full and normal, and the baseline fluctuation amplitude is greater than or equal to the preset uniformity threshold and less than or equal to the preset tolerance upper limit; Rejected product rule: meet any of the following conditions: the internal state judgment result is empty shell, shriveled grain, insect damage or mold; the baseline fluctuation amplitude is greater than the preset tolerance upper limit; the self-reference differential spectral feature set shows abnormal spectral distortion.

[0102] This embodiment is a further specification of the closed-loop adaptive optimization steps in Embodiment 1; the system statistically analyzes the class centers of the current batch of detection data. Similarity to class variance Calculate the clustering effectiveness index The simplified Fisher criterion is as follows: ;

[0103] in, The feature mean of the full and normal class, The feature mean of the defect class; Compared with benchmark indicators In comparison, if This triggers the parameter update mechanism, performing the following iterative optimization: adjusting the baseline correction coefficients of the spectral-morphological coupling operator. : ,in, For sign functions; partial derivatives The learning rate is calculated using the numerical difference method; The preferred value range is 0.01 to 0.05, and in this embodiment it is set to 0.02; the perturbation quantity in the numerical difference method Set as current 1% of the value or a fixed value of 0.001, to balance calculation accuracy and truncation error; that is, by giving Apply perturbation Post-calculation get;

[0104] Preset benchmark indicators The offline calibration method was used to obtain the clustering effectiveness index: a batch of standard edamame samples with a classification accuracy of over 98% confirmed by manual verification were selected, and their clustering effectiveness index was calculated according to steps S51 to S52. The average value or 90th percentile of the index of this batch was taken as the benchmark index for system operation. ;

[0105] Initial iteration step size Set as the current gradient partition threshold 10% of Adjust gradient partitioning threshold : ,in The symbol is composed of The changing trend determines: the default initial iteration direction If it is a positive value, then after iteration Then maintain the direction; if the updated Then execute To achieve reverse search and step size convergence, the system attempts to expand or shrink the ridge region to reduce background noise interference; the system searches within the parameter space until... Maximize or reach the preset iteration limit of 50; generate the final sorting instruction based on the optimized parameters: responding to internal judgments that the feature set baseline fluctuation is normal and full. Marked as Grade 1 product; responding to internal normal but If a product is marked as a Level 2 product, it is otherwise subject to rejection rules. This embodiment introduces the Fisher criterion as the objective function, establishing a framework from detection performance to algorithm parameters. The mathematical feedback loop ensures the classification decision boundary. The optimality of the model across different batches of samples addresses the issue of model drift due to individual biological differences.

[0106] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A non-destructive testing method for edamame based on hyperspectral images, characterized in that, Includes the following steps: S1. Collect the raw hyperspectral image data of edamame samples and perform radiometric correction preprocessing to generate a preprocessed hyperspectral data cube; S2. Extract short-band morphological feature images from the preprocessed hyperspectral data cube, calculate the spatial gradient field, and apply the gradient partitioning threshold to construct a morphological distribution model. Based on this model, obtain the ridge region mask and valley region mask, where the ridge region corresponds to the bean support region and the valley region corresponds to the bean pod background region. S3. Using the spectral data corresponding to the valley region mask as the reference background, and combining it with the spectral data corresponding to the ridge region mask, a spectral-morphological coupling operator is constructed. This operator is used to calculate the spectral differences between the ridge and valley regions, and outputs a self-referenced differential spectral feature set. S4. Input the self-referenced differential spectral feature set into the feature analysis module, perform anomaly detection for the long-wavelength spectral response, generate internal state judgment results, classify and label the edamame samples according to the internal state judgment results, and output detection grading data. S5. Compare the detection grading data with the preset quality standard distribution for error assessment. If the error assessment result fails, update the gradient partition threshold of the morphological distribution model and the weight parameters of the spectral-morphological coupling operator according to the error distribution characteristics, and regenerate the final detection result based on the updated parameters for downstream sorting equipment to use. S3 includes the following steps: S31. Extract the average spectrum of the ridge region covered by the ridge region mask, and the average spectrum of the valley region covered by the valley region mask; S32. Construct a spectral-morphological coupling operator, which is defined as a ratio function or difference function of the average spectrum of the ridge region and the average spectrum of the valley region, used to mathematically strip the background signal of the pod epidermis. S33. Use the spectral-morphological coupling operator to perform full-band decoupling operation on the preprocessed hyperspectral data cube and calculate the ridge-valley difference index for each wavelength; S34. Combine the ridge-valley difference indices across the entire wavelength band according to the wavelength sequence to form a self-referenced differential spectral feature set that can reflect the physical state of the interface between the internal beans and pods.

2. The non-destructive testing method for edamame based on hyperspectral images according to claim 1, characterized in that, S1 includes the following steps: S11. Raw hyperspectral image data of edamame samples were acquired using a pushbroom hyperspectral imaging device under diffuse light conditions; S12. Obtain standard white board reflectance data and dark current noise data, perform reflectance correction operation on the original hyperspectral image data, eliminate the influence of light source non-uniformity and sensor dark noise, and obtain reflectance correction data; S13. Perform spatial smoothing filtering and spectral denoising on the reflectance correction data to form a preprocessed hyperspectral data cube containing complete spatial and spectral information.

3. The non-destructive testing method for edamame based on hyperspectral images according to claim 2, characterized in that, S2 includes the following steps: S21. Select short-band components with weak penetration characteristics from the preprocessed hyperspectral data cube to generate a short-band morphological feature image, wherein the short-band components are chlorophyll strong absorption bands. S22. Apply the gradient operator to the short-band morphological feature image to calculate the gradient magnitude and gradient direction of the pixel, and generate a spatial gradient field; S23. Based on the spatial gradient field, the local maximum region on the surface of edamame is identified by using the gradient partitioning threshold. The local maximum region is defined as the ridge region formed by the internal bean grains and a ridge region mask is generated. S24. Identify local minima on the surface of edamame, define them as gaps between beans or pure pod regions, and generate valley region masks. The ridge region masks and valley region masks together constitute a morphological distribution model.

4. The non-destructive testing method for edamame based on hyperspectral images according to claim 3, characterized in that, S4 includes the following steps: S41. Extract long-wavelength near-infrared components from the self-referenced differential spectral feature set, wherein the long-wavelength near-infrared components correspond to the water absorption peak or the scattering sensitive band of biological tissue. S42. Calculate the spectral intensity or slope of the long-wavelength near-infrared component as a scattering gain feature. If the scattering gain feature value is greater than the preset air gap scattering threshold, it is determined that there is an air layer inside, generating an internal state determination result of empty shell or shriveled particle. S43. Analyze the oxidation feature band in the self-reference differential spectral feature set, calculate the intensity change rate of the band relative to the reference background, and if the intensity change rate is greater than the preset browning threshold, it is determined that there is biological erosion inside, resulting in an internal state determination result of insect infestation or mold. S44. If the scattering gain characteristic is less than or equal to the air gap scattering threshold and the intensity change rate is less than or equal to the browning threshold, then generate a full and normal internal state judgment result, and summarize all results to output detection grading data.

5. The non-destructive testing method for edamame based on hyperspectral images according to claim 4, characterized in that, S5 includes the following steps: S51. Statistical analysis of the spectral dispersion and classification confidence distribution of various categories in graded data; S52. Calculate the intra-class distance and inter-class distance of the current batch of test results, and generate a clustering validity index as the error evaluation result; S53. Compare the clustering effectiveness index with the preset benchmark index. If the clustering effectiveness index is lower than the benchmark index, it indicates that the morphological partitioning is inaccurate or the spectral decoupling is incomplete, triggering the parameter update mechanism. S54. In the parameter update mechanism, fine-tune the gradient threshold used to generate the ridge region mask in S2, or adjust the baseline correction coefficient of the spectral-morphological coupling operator in S3 to maximize the inter-class distance. S55. Output the final detection result after parameter optimization and confirmation, and generate sorting control instructions based on the final detection result.

6. The non-destructive testing method for edamame based on hyperspectral images according to claim 5, characterized in that, The sorting control instructions generated in S55 follow the following sorting rules: Grade 1 product rule: The internal state judgment result is full and normal, and the baseline fluctuation amplitude of the self-reference differential spectral feature set is less than the preset uniformity threshold; Second-level product rule: The internal state judgment result is full and normal, and the baseline fluctuation amplitude is greater than or equal to the preset uniformity threshold and less than or equal to the preset tolerance upper limit; Rejection rules: Items meeting any of the following conditions: The internal condition is determined to be empty shell, shriveled grain, infested with insects, or moldy; The baseline fluctuation is greater than the preset tolerance limit. The self-referenced differential spectral feature set shows anomalous spectral distortion.

7. The non-destructive testing method for edamame based on hyperspectral images according to claim 4, characterized in that, The center wavelength of the short-wavelength component is 450nm. By utilizing the high absorption and low penetration characteristics of this wavelength of light on the plant epidermis, the physical morphology of the edamame surface can be accurately reconstructed. The long-wavelength near-infrared component includes a 970nm moisture absorption band. By utilizing the sensitivity of this band to changes in optical path and the scattering characteristics of the medium, the physical void structure inside the bean pod can be detected.

Citation Information

Patent Citations

  • Method for automatically extracting area-of-interest from hyperspectral image of green soybeans based on iteration threshold value

    CN104573689A

  • Intelligent monitoring system for prevention and control of diseases and insect pests for bean planting

    CN121190982A