A method and system for detecting the maturity of waxberries based on hyperspectrum

By combining hyperspectral imaging technology with adaptive filtering parameter optimization and a three-dimensional convolutional neural network model, the problem of poor variety adaptability in bayberry maturity detection has been solved, achieving high-precision, low-loss, and rapid multi-variety detection, thereby improving detection efficiency and market competitiveness.

CN121236611BActive Publication Date: 2026-03-24ZHEJIANG ACADEMY OF AGRICULTURE SCIENCES
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing waxberry maturity testing technologies suffer from limitations in accuracy and robustness when dealing with different varieties, making it difficult to achieve non-destructive, rapid testing applicable to multiple varieties.

Method used

Hyperspectral images of bayberry fruits were acquired using hyperspectral imaging technology. A bayberry maturity detection model was constructed by adaptively matching image filtering parameters and combining it with a three-dimensional convolutional neural network model for detection. This included adaptive adjustment of filtering parameters and image enhancement strategies to optimize the input of the prediction model.

Benefits of technology

It achieves high-precision, low-loss, and rapid maturity detection of bayberries, applicable to multiple varieties, improving the accuracy and efficiency of detection, reducing labor costs, and enhancing market competitiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121236611B_ABST
    Figure CN121236611B_ABST
Patent Text Reader

Abstract

The embodiment of the specification discloses a red bayberry maturity detection method and system based on hyperspectrum, wherein the maturity detection method comprises the following steps: acquiring multiple sample red bayberries of multiple varieties and a red bayberry to be detected, and collecting hyperspectrum images to obtain original hyperspectrum images; acquiring respective corresponding filtering parameters based on noise characteristic parameters of each original hyperspectrum image, and performing filtering processing on the original hyperspectrum images based on the filtering parameters to obtain processed hyperspectrum images; acquiring respective corresponding chemical detection data of each sample red bayberry; training a to-be-trained model based on the respective corresponding chemical detection data of each sample red bayberry and the processed hyperspectrum images to obtain a prediction model; and taking the processed hyperspectrum image of the red bayberry to be detected as an input of the prediction model to obtain prediction data for measuring the maturity of the red bayberry to be detected. The red bayberry maturity detection is realized to be fast, accurate and convenient, and the problem of poor variety adaptability in detection is overcome.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present specification relate to the technical field of fruit ripeness detection, and in particular to the optimization of a waxberry ripeness detection method. BACKGROUND

[0002] Due to the short ripening period, the lack of outer skin covering, and the susceptibility to damage of waxberries, accurate detection of the ripeness of waxberries is directly related to the picking quality, preservation ability, and market competitiveness. Traditional methods of judgment relying on human experience are highly subjective, have non-uniform standards, and can easily cause fruit loss. Although destructive physicochemical detection methods have high precision, they cannot meet the needs of large-scale non-destructive detection. Therefore, it is of great significance to develop efficient and non-destructive ripeness detection techniques to ensure the sustainable development of the waxberry industry.

[0003] Existing waxberry ripeness detection techniques are mainly based on optical imaging methods. Some methods use RGB color images to extract color features through color conversion (such as RGB to LAB space). Other methods use hyperspectral imaging technology to capture spectral information of the fruit to invert internal quality parameters. In addition, some studies combine machine learning models (such as convolutional neural networks) to process image data, achieving automatic classification or prediction of ripeness.

[0004] However, existing techniques have significant defects when dealing with differences between different varieties of waxberries. Different varieties (such as the Euryale ferox and Dongkui varieties) have inherent differences in fruit size, shape, and surface hair density. These differences lead to unstable optical response signals, limiting the precision and robustness of existing methods and making it difficult to achieve reliable non-destructive detection in practical applications. SUMMARY

[0005] Embodiments of the present specification provide a hyperspectral-based waxberry ripeness detection method and system. By acquiring hyperspectral images of waxberry fruits, adaptively matching image filtering parameters, and constructing a waxberry ripeness detection model, the problem of poor variety adaptability in non-destructive detection of waxberry ripeness is overcome, achieving a high-precision, low-loss, fast, and multi-variety applicable detection method.

[0006] The technical solution is as follows:

[0007] In a first aspect, embodiments of the present specification provide a hyperspectral-based waxberry ripeness detection method, comprising the following steps:

[0008] Obtain multiple sample waxberries of multiple varieties and a to-be-detected waxberry belonging to any of the varieties, and perform hyperspectral image acquisition to obtain original hyperspectral images corresponding to each of the to-be-detected waxberry and the sample waxberries;

[0009] The noise characteristic parameter of each original hyperspectral image is used to obtain the corresponding filtering parameter, and the original hyperspectral image is filtered based on the filtering parameter to obtain the processed hyperspectral image corresponding to each sample bayberry and each sample bayberry, and the filtering parameter includes a filtering window size and a polynomial order.

[0010] The chemical detection data corresponding to each sample bayberry is obtained.

[0011] The training model is trained based on the chemical detection data corresponding to each sample bayberry and the processed hyperspectral image to obtain a prediction model.

[0012] The processed hyperspectral image of the bayberry to be detected is used as the input of the prediction model to obtain prediction data for measuring the maturity of the bayberry to be detected.

[0013] As a preferred scheme, the noise characteristic parameter of each original hyperspectral image is used to obtain the corresponding filtering parameter, including:

[0014] Each original hyperspectral image is averaged and smoothed based on a preset window size to obtain a smoothed image;

[0015] The spectral noise variance corresponding to each original hyperspectral image is obtained as the noise characteristic parameter based on each original hyperspectral image and the corresponding smoothed image thereof;

[0016] The spectral noise variance corresponding to each original hyperspectral image is obtained as the noise characteristic parameter based on each original hyperspectral image and the corresponding smoothed image thereof;

[0017] As a preferred scheme, the noise characteristic parameter of each original hyperspectral image is used to obtain the corresponding filtering parameter, including:

[0018] The spectral noise variance threshold interval corresponding to each sample bayberry of each variety is obtained based on the spectral noise variance corresponding to each original hyperspectral image of all sample bayberries of the same variety;

[0019] The boundary value between each variety is obtained based on the spectral noise variance threshold interval corresponding to each sample bayberry of each variety;

[0020] The filtering parameter-spectral noise variance segmentation function is obtained based on the boundary value between each variety;

[0021] The filtering parameter corresponding to each original hyperspectral image is obtained based on the filtering parameter-spectral noise variance segmentation function and the spectral noise variance corresponding to each original hyperspectral image.

[0022] As a preferred scheme, the boundary value between each variety is obtained based on the spectral noise variance threshold interval corresponding to each sample bayberry of each variety, including:

[0023] Based on the spectral noise variance corresponding to each of the original hyperspectral images of the samples of each variety of bayberry, obtain the overall spectral noise variance corresponding to each of the samples of each variety of bayberry;

[0024] Based on the overall spectral noise variance corresponding to each of the samples of each variety of bayberry and the spectral noise variance threshold interval, obtain the boundary value between each variety.

[0025] As a preferred scheme, the filtering parameter-based filtering processing of the original hyperspectral image to obtain the processed hyperspectral image corresponding to each of the to-be-detected bayberry and the sample bayberry includes:

[0026] Filtering parameter-based filtering processing of the original hyperspectral image to obtain a filtered hyperspectral image;

[0027] Based on the image enhancement strategy, the filtered hyperspectral image is enhanced to obtain the processed hyperspectral image corresponding to each of the to-be-detected bayberry and the sample bayberry;

[0028] The determination of the image enhancement strategy includes:

[0029] Based on a plurality of different candidate strategies, the processed hyperspectral image is enhanced, and a to-be-trained model is trained to obtain a corresponding prediction model;

[0030] Based on the prediction accuracy of each prediction model, the image enhancement strategy is determined.

[0031] Each of the candidate strategies is at least one of differential transformation, logarithmic transformation, and reciprocal transformation.

[0032] As a preferred scheme, the to-be-trained model is a UNet convolutional neural network model including a three-dimensional convolutional kernel.

[0033] As a preferred scheme, the UNet convolutional neural network model further includes a deep network structure and a residual structure arranged between layers of the deep network structure.

[0034] In a second aspect, the embodiments of the present specification provide a hyperspectral-based bayberry maturity detection system, including an image acquisition unit, an image processing unit, a calibration data acquisition unit, a model training unit, and a model prediction unit:

[0035] The image acquisition unit acquires a plurality of sample bayberries including multiple varieties and a to-be-detected bayberry belonging to any of the varieties, and performs hyperspectral image acquisition to obtain original hyperspectral images corresponding to each of the to-be-detected bayberry and the sample bayberry;

[0036] The image processing unit obtains a respective filtering parameter based on a noise characteristic parameter of each original hyperspectral image, and performs filtering processing on the original hyperspectral image based on the filtering parameter to obtain a respective processed hyperspectral image corresponding to each sample bayberry and the bayberry to be detected, wherein the filtering parameter includes a filtering window size and a polynomial order.

[0037] The calibration data acquisition unit obtains respective chemical detection data of each sample bayberry.

[0038] The model training unit trains the to-be-trained model based on the respective chemical detection data and the processed hyperspectral image of each sample bayberry to obtain a prediction model.

[0039] The model prediction unit takes the processed hyperspectral image of the bayberry to be detected as an input of the prediction model to obtain prediction data for measuring the maturity of the bayberry to be detected.

[0040] In a third aspect, an electronic device is provided, including a processor and a memory; the processor is connected with the memory; the memory is used for storing executable program codes; the processor runs a program corresponding to the executable program codes by reading the executable program codes stored in the memory, so as to execute the steps of the first aspect of the above-mentioned embodiments.

[0041] In a fourth aspect, a computer storage medium is provided, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the steps of the first aspect of the above-mentioned embodiments.

[0042] The technical solutions provided by some embodiments of the present specification have at least the following beneficial effects:

[0043] The present application solves the problems of difficulty in implementation and large loss in nondestructive detection of bayberry fruit maturity, proposes a filtering parameter self-adaptive adjustment optimization method while using hyperspectral imaging technology, and constructs a convolutional neural network model based on deep learning, which overcomes the problem of poor variety adaptability in nondestructive detection of bayberry maturity, realizes rapid, accurate and convenient detection of bayberry maturity, and has important significance for guaranteeing the quality of bayberry picking, improving the efficiency of later sorting and reducing labor costs, and improving the market competitiveness of bayberry in China.

[0044] 1. The hyperspectral imaging technology is used instead of the traditional imaging technology to shoot bayberry fruit images, fuse spatial and spectral dimension information, and obtain chemical detection data of bayberry fruits to form a data set.

[0045] 2. The filter parameter adaptive adjustment optimization method is used for pre-processing of hyperspectral images, so as to ensure that the model obtains effective information of data to the maximum extent.

[0046] 3. The image enhancement strategy including differential transformation, reciprocal transformation and logarithmic transformation is combined to deeply mine the spectral feature information of the waxberry fruits from multiple dimensions.

[0047] 4. The UNet model is improved, three-dimensional convolution and residual structure are introduced, and a model for detecting the maturity of the waxberry fruits is constructed, which is lossless, fast and accurate. BRIEF DESCRIPTION OF DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0049] Figure 1 is a flowchart of a waxberry maturity detection method based on hyperspectrum provided by an embodiment of the present application.

[0050] Figure 2 is a structure diagram of an improved UNet convolutional neural network model in the waxberry maturity detection method based on hyperspectrum provided by an embodiment of the present application.

[0051] Figure 3 is a structure diagram of a single layer module in the UNet convolutional neural network model.

[0052] Figure 4 is a structure diagram of a waxberry maturity detection system based on hyperspectrum provided by an embodiment of the present application.

[0053] Figure 5 is a structure diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0054] The technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application.

[0055] The terms "first", "second", "third", and the like in the description and the claims of the present specification and the above-described drawings are used to distinguish different objects, rather than to describe a particular order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product, or device.

[0056] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes can be made in the function and arrangement of elements described without departing from the scope of the present specification. Various examples can omit, substitute, or add various procedures or components as appropriate. For example, the described methods can be performed in an order different from the described order, and various steps can be added, omitted, or combined. In addition, features described with respect to some examples can be combined in other examples.

[0057] Yangmei fruit is different from other fruit and vegetable products, which does not have a skin wrapping, and the fruit surface is covered with dense fluff structure, which can cause strong spectral scattering and noise effect. In hyperspectral imaging, the fluff causes multiple reflections and scattering of incident light, making the spectral curve appear random fluctuations, which masks the inherent characteristics related to maturity. And the fluff also presents different density and distribution pattern due to variety difference, and this variety specificity makes it difficult to apply uniform detection standard. Therefore, Yangmei faces unique challenges in maturity detection. Therefore, the present application is proposed.

[0058] Referring to Figure 1 As shown in the figure, Figure 1 A flowchart of a hyperspectral-based Yangmei maturity detection method provided by an embodiment of the present specification can at least include the following steps:

[0059] Step 102, obtaining a plurality of sample Yangmeis including multiple varieties and a to-be-detected Yangmei belonging to any of the varieties, and performing hyperspectral image acquisition to obtain original hyperspectral images corresponding to the to-be-detected Yangmei and each sample Yangmei respectively;

[0060] Step 104, obtaining a respective filtering parameter based on a noise feature parameter of each original hyperspectral image, and performing filtering processing on the original hyperspectral image based on the filtering parameter to obtain a processed hyperspectral image corresponding to the to-be-detected Yangmei and each sample Yangmei respectively, the filtering parameter including a filtering window size and a polynomial order;

[0061] Step 106, obtaining chemical detection data corresponding to each sample Yangmei respectively;

[0062] Step 108, based on the respective chemical detection data and the processed hyperspectral image of each sample Yangmei, the trained model is trained to obtain a prediction model;

[0063] Step 110, the processed hyperspectral image of the Yangmei to be detected is input into the prediction model to obtain prediction data for measuring the maturity of the Yangmei to be detected.

[0064] Illustratively, the present embodiment selects two Yangmei varieties, Liqi and Dongkui, for illustration. Yangmei fruits in different regions are picked throughout the growth period, with an average of once a week as sample Yangmei. The picked sample Yangmei fruits are numbered, weighed, and measured for shape and size. Then, in a dark environment, hyperspectral image acquisition is performed. First, place the Yangmei fruits and a standard white plate horizontally on a black background cloth on the stage, with the hyperspectral imager vertically downward, 30 cm above the Yangmei fruits; then place two cold light halogen lamps on the left and right sides at the same height as the hyperspectral imager lens, at an angle of 45° to the horizontal plane. In the dark environment, the Yangmei fruits are photographed one by one. The original hyperspectral image is obtained. Further, the original hyperspectral image of the collected sample Yangmei is preprocessed and the data set is divided. In the process of preprocessing the original hyperspectral image of the collected sample Yangmei, there are two problems: one is the strong spectral scattering effect caused by the dense hair on the surface of the Yangmei fruit, which causes random noise interference in the spectral curve, masking the inherent quality-related features of the fruit; two is the inherent difference in the density of the epidermal hair and the structure of the fruit skin of different Yangmei varieties, which makes the spectral noise distribution show significant variety specificity. The traditional Savitzky-Golay (SG) spectral smoothing and denoising method uses fixed window size and polynomial order, which is difficult to adapt to the above differences. For high-noise varieties, fixed parameters can easily lead to incomplete denoising, with residual noise interfering with subsequent feature extraction; for low-noise varieties, excessive smoothing can cause loss of spectral details. Therefore, a parameter self-adaptive adjustment optimization method is proposed.

[0065] Specifically: before smoothing filtering, the noise characteristic parameters of the original hyperspectral image are first obtained to distinguish the Yangmei varieties, and appropriate filter window size and polynomial order are matched for filtering processing to obtain the processed hyperspectral image, thereby realizing accurate matching of variety and spectral smoothing requirements and maximizing the retention of feature details in the spectral curve, providing more reliable input for the subsequent maturity prediction model.

[0066] In some embodiments, before smoothing filtering, the collected original hyperspectral image can be subjected to reflectance correction. The purpose is to eliminate interference factors other than the properties of the target itself. The formula is as follows:

[0067]

[0068] DNmin / DNmax, wherein DN is the original gray value of the pixel of the original hyperspectral image, and DNmin / DNmax is the minimum and maximum value of the waveband in the original hyperspectral image.

[0069] Further, the indicators of the collected sample of waxberry fruits are measured by a chemical detection method, and are one-to-one corresponding to the original hyperspectral image, as the calibration data for measuring the maturity.

[0070] In an embodiment of the present application, the chemical detection data includes total sugar content, total acid content and soluble solids.

[0071] Explanatorily, the indicators representing the maturity of the waxberry fruits are selected for research, providing comprehensive maturity evaluation, which is superior to the single indicator method. The objectivity and quantifiability of the prediction results are ensured, and high reliability labels are provided for model training. Specifically:

[0072] 1. The total sugar content of the waxberry fruits is measured using a kit. Specifically, after the waxberry fruits are pitted, the pulp is cooled using liquid nitrogen and ground into powder. After weighing and counting, 1.5 ml of distilled water and 1 ml of reagent one (hydrochloric acid solution) are added. After 30 min of water bath at 95℃, 1 ml of reagent two (NaOH solution) is added, and distilled water is added to 10 ml in the solution. Then, it is placed in a centrifuge for 8000g centrifugation at 25℃ for 10 min. After centrifugation, 12μl of supernatant solution is taken, 12μl of distilled water and 18μl of reagent three (mixture of methyl solution: phenol, NaOH and sodium bisulfite solution; ethyl solution: potassium sodium tartrate, NaOH and 3,5-dinitrosalicylic acid solution. The mixture of methyl and ethyl solutions is reagent three) are added, and then 10 min of water bath at 95℃ is performed. 258μl of distilled water is added to the solution, and after mixing, 200μl of the solution is taken to an enzyme-labeled plate. A blank tube is set as a control, and 24μl of distilled water (12μl of distilled water instead of 12μl of sample supernatant solution) and 18μl of reagent three are added to the blank tube. Finally, it is sent to an enzyme-labeled instrument for determination of the absorbance value at 540nm. Each waxberry fruit sample is subjected to three repeated experiments. The absorbance value is used for calculation, and the formula is as follows:

[0073]

[0074] wherein S is the total sugar content (mg / g); is the absorbance value of the test tube minus the absorbance value of the blank tube; W is the sample mass; and p is the dilution multiple.

[0075] 2. The total acid content of bayberry fruit was measured using an acid-base indicator titration method. First, the bayberry fruit was pitted, then the pulp was cooled with liquid nitrogen and ground into powder. The powder was weighed, and distilled water was added to 20 ml. The mixture was then placed in a water bath at 80°C for 30 minutes and cooled. Next, distilled water was added to 50 ml for dilution. The solution was filtered using an Erlenmeyer flask, funnel, and filter paper. 10 ml of the solution was taken, and 10 ml of distilled water was added, followed by titration with 5 drops of phenolphthalein reagent. Finally, NaOH reagent was added for acid-base neutralization until the solution turned light red. The acid content was then counted. Each bayberry fruit sample was tested three times. The calculation formula is as follows:

[0076]

[0077] Where A is the total acid content (g / kg); C is the molar concentration of NaOH standard solution (0.1); V1 is the volume of NaOH standard solution consumed during titration; V0 is the volume of sample solution used for titration; and m(v) is the sample mass or volume.

[0078] 3. The soluble solids content of bayberry fruit was measured using the refractometer method.

[0079] After measuring the total sugar, total acid content, and soluble solids, outliers were removed, the experiment was repeated three times and the average value was taken. The processed hyperspectral images were matched one-to-one with the measured data, and a database of bayberry fruit maturity parameters was constructed by combining the hyperspectral images.

[0080] Explanatory, based on the physiological and biochemical laws governing the ripening process of bayberry fruit: total sugar content increases with maturity, total acid content decreases due to the degradation of organic acids, and soluble solids comprehensively reflect changes in the fruit's intrinsic quality. Single indicators are easily affected by environmental or varietal factors, while total sugar, total acid, and soluble solids characterize maturity from three dimensions: sweetness, acidity, and solid matter concentration, respectively. The complementary nature of multiple indicators can offset random errors. This multi-indicator synergistic calibration method provides a more comprehensive and objective scientific basis for maturity assessment and enhances the robustness of maturity inversion.

[0081] Furthermore, the chemical analysis data also includes the ratio of total sugar to total acid, which can more sensitively reflect subtle changes in maturity. For example, high sugar content may stem from varietal characteristics rather than maturity, but by combining it with low acid and high soluble solids data, true maturity can be accurately distinguished from varietal differences. This comprehensive strategy enables the model to learn more complex feature maps, avoiding misjudgments caused by fluctuations in a single feature.

[0082] According to the obtained chemical detection data and the processed hyperspectral image, a plurality of groups of data corresponding to each sample mayberry are obtained to form a data set, and the data set is divided. For example, the entire data set is divided according to a ratio of 7:1.5:1.5, in which the training set accounts for 70%, the validation set accounts for 15%, and the test set accounts for 15%. According to the model training result, the learning rate, the number of iterations and other model parameters are adjusted to obtain a prediction model.

[0083] Preferably, the number of sample mayberries corresponding to each variety is the same. In the data set division, the variety sample balance is forced to be maintained to reduce the interference of variety differences on the model. Furthermore, the number of samples of each variety in the divided test set, validation set and training set is also kept consistent. Based on the inherent differences between mayberry varieties, for example, the significant differences in fruit size, density of down and spectral characteristics between the Eleocharis species and the Dongkui species. If a conventional random division method is used, some varieties may be over-represented in the training set, while other varieties may not be adequately represented in the test set, thereby causing model training bias. Through the forced balancing strategy, the distribution ratio of each variety in different data sets is kept uniform, effectively preventing overfitting or underfitting of the model to a particular variety. In the model training stage, the balanced variety distribution enables the model to fully learn the characteristics of different varieties, rather than being dominated by varieties with larger sample sizes. Secondly, in the model validation process, the balanced validation set can more accurately evaluate the generalization performance of the model across varieties and timely identify the recognition defects of the model for some varieties. Most importantly, in the model testing stage, the balanced test set can objectively reflect the real performance of the model in actual application.

[0084] Finally, the processed hyperspectral image of the mayberry to be detected is input into the prediction model to predict the total sugar, total acid content and soluble solids of the mayberry fruit, so as to measure the maturity result of the mayberry to be detected.

[0085] The embodiment overcomes the problem of poor variety adaptability in nondestructive detection of mayberry maturity, and realizes a detection method with high precision, low loss, rapidness and applicability to multiple varieties.

[0086] In an embodiment of the present specification, the filter parameter corresponding to each original hyperspectral image is obtained based on the noise characteristic parameter of each original hyperspectral image, including:

[0087] Each original hyperspectral image is averaged and smoothed based on a preset window size to obtain a smoothed image;

[0088] The spectral noise variance corresponding to each original hyperspectral image is obtained as a noise characteristic parameter based on each original hyperspectral image and its corresponding smoothed image;

[0089] The filter parameter corresponding to each original hyperspectral image is obtained based on the spectral noise variance corresponding to each original hyperspectral image.

[0090] Illustratively, the noise variance σ of the original hyperspectral image is calculated according to the original hyperspectral image and the smoothed image after average smoothing 2 as the corresponding noise characteristic parameter. The calculation formula is as follows:

[0091]

[0092] wherein, is the original reflectance of the original hyperspectral image at wavelength λ; is the reflectance at wavelength λ of the original hyperspectral image after average smoothing; K is the moving window half-width (i.e. half of the preset window size); L is the total number of spectral bands; (L-K) is the effective calculation band number after removing the edge band.

[0093] A linear function relationship between the noise variance and the filtering parameter is established to realize adaptive noise reduction. It is easy to understand that relatively higher noise varieties use larger windows and lower order polynomials to preferentially strengthen noise reduction; medium noise varieties use medium windows and polynomials to consider noise reduction and details; and relatively lower noise varieties use smaller windows and polynomials to preferentially retain feature details. The dynamic correlation of the spectral noise quantitative index of the variety and the filtering parameter avoids the limitations of traditional fixed parameters, makes the pretreatment effect more in line with the actual spectral characteristics of different varieties of Yangmei, maximizes the retention of feature details in the spectral curve, and provides more reliable input for the subsequent maturity detection model.

[0094] However, it should be noted that, on the one hand, since the optimal filtering parameter needs to be calculated independently for each new sample collected, the calculation amount of the filtering processing link is greatly increased, which seriously restricts the real-time performance of the detection. Especially in high-throughput detection scenarios (such as processing thousands of fruits per hour), this calculation burden will cause the detection throughput to drop sharply. On the other hand, the determination of the linear function coefficient between the noise variance and the filtering parameter relies on a large amount of experimental data, which makes it difficult to achieve a unified filtering effect in the absence of objective determination standards. Inaccurate function relationship will also cause the loss of variety characteristics and affect the prediction accuracy of the subsequent prediction model.

[0095] Therefore, in an embodiment of the present specification, the filtering parameter corresponding to each original hyperspectral image is obtained based on the spectral noise variance corresponding to each original hyperspectral image, which comprises:

[0096] Based on the spectral noise variance corresponding to each original hyperspectral image of all samples of the same variety of Yangmei, the spectral noise variance threshold interval corresponding to each variety of sample Yangmei is obtained;

[0097] Based on the spectral noise variance threshold interval corresponding to each variety of sample Yangmei, the boundary value between each variety is obtained;

[0098] obtaining a filtering parameter-spectral noise variance segmentation function based on the boundary value between each variety;

[0099] obtaining a filtering parameter corresponding to each original hyperspectral image based on the filtering parameter-spectral noise variance segmentation function and the spectral noise variance corresponding to each original hyperspectral image.

[0100] Explanatorily, the spectral noise variance threshold intervals of different varieties are obtained by respectively counting the spectral noise variance of all sample Yangmeis of different varieties, the boundary value is calculated according to the size relationship of each spectral noise variance threshold interval for segmentation, and a corresponding filtering parameter is set for each segment to obtain the filtering parameter-spectral noise variance segmentation function. The filtering parameter is set by using the local optimal value of the filtering effect corresponding to different varieties obtained by experiment, so as to take into account the characteristics of the varieties and avoid insufficient noise reduction or loss of feature details.

[0101] Illustratively, if the sample Yangmei includes three varieties, and the noise variance boundary values between the varieties are a and b respectively. Then the filtering parameter-spectral noise variance segmentation function is:

[0102]

[0103] wherein, M is the filtering window size; n is the polynomial order of fitting.

[0104] After the filtering parameter-spectral noise variance segmentation function is determined, the spectral noise variance σ 2 of the sample Yangmei to be detected is compared with the pre-set noise variance boundary value between the varieties, without calculation, and directly matched to the corresponding filtering parameter including the filtering window size and the polynomial order. For example, after the sample Yangmei to be detected is input, the spectral noise variance σ 2 of the corresponding original hyperspectral image is calculated, the filtering parameter is automatically matched, the corresponding noise variance level is matched by calling the mapping library. The high-noise variance variety adopts a 15-point window + 2-order polynomial, the medium-noise variance variety adopts an 11-point window + 3-order polynomial, and the low-noise variance variety adopts a 9-point window + 3-order polynomial.

[0105] In some embodiments, the boundary value between each variety is obtained based on the spectral noise variance threshold interval corresponding to each sample Yangmei of the variety, comprising:

[0106] obtaining the overall spectral noise variance corresponding to each sample Yangmei of each variety based on the spectral noise variance corresponding to each original hyperspectral image of all sample Yangmeis of the same variety;

[0107] obtaining the boundary value between each variety based on the overall spectral noise variance corresponding to each sample Yangmei of each variety and the spectral noise variance threshold interval.

[0108] It is easy to understand that according to the Yangmei variety c, the spectral noise variance threshold interval corresponding to each variety c is calculated according to the original hyperspectral image and the smoothed image after average smoothing processing. The spectral noise variance of all samples of any variety constitutes the threshold interval of the variety. The spectral noise variance σ 2 The numerical value is very small. Due to the large difference in the characteristics of the dense hair on the surface of the fruit of different varieties of Yangmei, the spectral noise variance threshold interval corresponding to each variety usually does not have an intersection, and the interval between each interval can be arbitrarily taken as the boundary value for dividing the spectral noise variance of the variety. However, for the case where the difference between varieties is not very large or the occasional error of a single sample, the spectral noise variance threshold interval corresponding to different varieties may have an intersection, thereby causing the problem that the boundary value of the spectral noise variance of different varieties is difficult to divide.

[0109] Therefore, the overall spectral noise variance corresponding to each variety c is calculated, and the overall spectral noise variance of any variety is The calculation formula is as follows:

[0110]

[0111] Wherein, N is the number of samples of the variety; is the original reflectance of the original hyperspectral image of the i th sample at wavelength λ; is the reflectance at wavelength λ after the original hyperspectral image of the i th sample is averaged and smoothed.

[0112] The spectral noise variance threshold interval corresponding to each of the two varieties that produce the intersection and the overall spectral noise variance can be used as the basis for dividing the inter-variety noise variance boundary value of the two varieties. For example, the spectral noise variance threshold interval of variety A is [0.005, 0.008], and the overall spectral noise variance is 0.007; the spectral noise variance threshold interval of variety B is [0.003, 0.007], and the overall spectral noise variance is 0.004, then the inter-variety noise variance boundary value of varieties A and B can be set as the average of the two overall spectral noise variances, that is, (0.007+0.004) / 2=0.0055. Other specific calculation methods of this concept of setting the inter-variety noise variance boundary value using the overall spectral noise variance corresponding to each of the different varieties c are within the protection scope of the embodiment.

[0113] The spectral noise variance threshold interval corresponding to each sample of the same variety is averaged to determine the noise variance central value of the variety, so as to distinguish the occasional error of a single sample. Through the above-mentioned inter-variety boundary value calculation method, the probability that the two varieties associated by the boundary value are incorrectly matched to the wrong filtering parameters is greatly reduced, thereby avoiding insufficient noise reduction or loss of feature details.

[0114] In an embodiment of the present specification, the original hyperspectral image is filtered based on the filtering parameter to obtain a processed hyperspectral image corresponding to each sample of the red bayberry to be detected;

[0115] The original hyperspectral image is filtered based on the filtering parameter to obtain a filtered hyperspectral image;

[0116] The filtered hyperspectral image is enhanced based on the image enhancement strategy to obtain a processed hyperspectral image corresponding to each sample of the red bayberry to be detected;

[0117] The determination of the image enhancement strategy comprises:

[0118] The processed hyperspectral image is enhanced based on a plurality of different candidate strategies, and the training model is trained to obtain a corresponding prediction model;

[0119] The image enhancement strategy is determined based on the prediction accuracy of each prediction model;

[0120] Each candidate strategy is at least one of differential transformation, logarithmic transformation and reciprocal transformation.

[0121] Illustratively, a pre-processing combination strategy is introduced, which is synergized by one or more of differential transformation, reciprocal transformation and logarithmic transformation, fully enhances feature expression, and is superior to single transformation method. On the basis of matching adaptive filtering parameter denoising to guarantee data quality, further image enhancement strategy is adopted, which avoids the transformation conflict (such as noise amplification) in traditional method, and improves the feature separability. The multi-dimensional synergistic strategy not only breaks through the limitation of traditional single transformation, but also significantly improves the inversion ability of the internal quality (such as sugar and acid content) of red bayberry.

[0122] Explanatorily, the image enhancement strategy is determined for the purpose of finding the optimal pre-processing method of the prediction model suitable for the maturity of red bayberry fruit. The differential transformation is combined with the reciprocal and logarithmic transformation, and the differential transformation further includes first-order differential and second-order differential, thus five groups of pre-processing combinations (i.e. candidate strategies) such as first-order differential + reciprocal, first-order differential + logarithm, second-order differential + reciprocal, second-order differential + logarithm and logarithm + reciprocal can be obtained. Then the sample data set is pre-processed by each group, and then the detection accuracy of the sample data set pre-processed by different pre-processing combinations in different prediction models is compared to determine the final pre-processing combination (i.e. image enhancement strategy) to be used.

[0123] Among them, the differential transform is mainly used to highlight and enhance the characteristic information in the spectral curve, and the principle is to perform derivative operation on the original spectral reflectivity curve. The spectral differential transform can highlight the steeply changing waveband in the spectral curve, making the effective features more prominent. The first-order differential transform and the second-order differential transform are selected in the present application, and the formulas are respectively:

[0124] First-order differential:

[0125]

[0126] Second-order differential:

[0127]

[0128] Among them, ρ' is the spectral value obtained by the first-order differential transform, ρ'' is the spectral value obtained by the second-order differential transform, i represents the spectral waveband number i = 1, 2…m, and 2Δλ represents the waveband interval.

[0129] The principle of logarithmic transform is to compress the dynamic range of data by taking the logarithm of the data, while keeping the relative relationship between the data unchanged. The reciprocal transform is to take the reciprocal of the original spectral reflectivity. Both methods can make the spectral data change more obvious, providing a basis for detecting the maturity of red bayberries.

[0130] The first-order and second-order differential highlight the steep features of the spectral curve, the reciprocal transform compresses the dynamic range, the logarithmic transform enhances the details and contrast, and the combination of the three from the gradient, scale and distribution dimensions excavates the spectral features and enhances the complementarity.

[0131] In an embodiment of the present specification, the model to be trained is a UNet convolutional neural network model including a three-dimensional convolutional kernel.

[0132] Illustratively, the UNet model is a convolutional neural network model applied to image segmentation. Because the traditional image data is a two-dimensional spatial structure (height x width), a two-dimensional convolutional kernel is usually used, and the most notable feature is the U-shaped symmetric structure. First, higher-level and more abstract features are captured through convolutional layers and down-sampling, and then the spatial size of the feature map is gradually restored through up-sampling and convolutional layers to improve the accuracy of the model. The present embodiment is an improvement based on the UNet convolutional neural network model, and a model suitable for red bayberry maturity detection is constructed.

[0133] Explanatorily, in the processing of the red bayberry hyperspectral image based on the UNet model, the hyperspectral image is essentially a three-dimensional data cube of space-spectrum, and the two-dimensional convolution can only slide the convolution kernel along the spatial dimension, which breaks the continuity of the spectral dimension and has a significant technical adaptation defect, and cannot capture the synergistic features of multi-band spectrum at a certain spatial position, which makes it difficult for the model to utilize the three-dimensional intrinsic correlation of the hyperspectral data. Therefore, the two-dimensional convolution in the UNet is replaced by the three-dimensional convolution. The UNet model can fully adapt to the three-dimensional data of the hyperspectral image. This structure gives the model two advantages:

[0134] 1. Synergistic capture of spatial-spectral features: The three-dimensional convolution kernel can slide along the spatial dimension and the spectral dimension at the same time, which can capture the spectral response law between different bands while extracting the spatial features such as fruit contour and hair distribution, and realize the correlation modeling of “spatial position-spectral signal”;

[0135] 2. Preservation of three-dimensional information integrity: Compared with the “flattening” processing of the spectral dimension by the two-dimensional convolution, the three-dimensional convolution can completely preserve the structural characteristics of the hyperspectral data cube, avoid the information loss of the spectral features in the preprocessing, and is especially suitable for the extraction of key information such as the spectral distribution difference of the hair scattering noise in the red bayberry hyperspectral image and the characteristic waveband specificity of different varieties.

[0136] Adaptive preprocessing provides clean input for the model, and the three-dimensional UNet model deeply excavates the features, and finally realizes the lossless, fast and high-precision detection.

[0137] In an embodiment of the present application, the UNet convolutional neural network model further comprises a deep network structure and a residual structure arranged between layers of the deep network structure.

[0138] Illustratively, in order to fully excavate the deep “spatial-spectral” correlation features in the red bayberry hyperspectral image, it is necessary to further deepen the network layers. However, the deep network is prone to the problem of gradient vanishing or gradient explosion, that is, the gradient is continuously attenuated or amplified after passing through multiple layers of nonlinear transformation and parameter update in the backward propagation process, which makes it difficult to effectively optimize the parameters of the shallow network, and finally affects the learning ability of the model to subtle features. In view of this problem, the residual structure is introduced into the three-dimensional convolution UNet model. The input features of the convolution layer are directly fused with the output features after nonlinear transformation (convolution, activation), and the core logic can be represented as: F(x)+x (where x is the input feature, and F(x) is the feature after nonlinear transformation).

[0139] Illustratively, the present application improves the UNet network model. The specific operation is as follows:

[0140] Referring to Figure 2 , Figure 3 ,Figure 2 is a schematic diagram of an improved UNet convolutional neural network model structure in a red bayberry maturity detection method based on hyperspectral provided by an embodiment of the present specification, Figure 3 is a structural schematic diagram of a single layer module in the UNet convolutional neural network model. The improved backbone network is divided into 9 stages. Three-dimensional convolution and maximum pooling downsampling are used in the first to fourth stages to complete the operation, and three-dimensional convolution and upsampling are used in the remaining stages to complete the operation. The first to fourth stages all contain 3*3*3 convolution layers and maximum pooling downsampling layers, but the number of convolution kernels in each stage is different, which is 64, 128, 256, and 512 respectively. The fifth to eighth stages all contain 3*3*3 convolution layers, 1*1*1 convolution layers and upsampling layers. The last of each stage adjusts the spatial size of the output feature map to the same as the corresponding stage through the upsampling layer, and splices the feature map of the corresponding stage (here, the sixth stage corresponds to the fourth stage, the seventh stage corresponds to the third stage, the eighth stage corresponds to the second stage, and the ninth stage corresponds to the first stage). The ninth stage contains 3*3*3 convolution layers and 1*1*1 convolution layers, and the number of convolution kernels in the fifth to ninth stages is 512, 512, 256, 128, and 64 respectively. In the first eight stages, each stage is connected through residual connection to connect the input feature map and the output feature map, and then performs downsampling or upsampling operation. After the ninth stage, the result is output through three fully connected layers. Through residual structure and parameter optimization, the model calculation amount is reduced to support embedded device deployment.

[0141] The dual transformation of three-dimensional convolution + residual structure not only solves the limitation of traditional UNet that cannot utilize three-dimensional information, but also breaks through the bottleneck of deep network gradient transmission, so that the model can more efficiently learn the complex features in the red bayberry hyperspectral data, and provide more reliable model support for subsequent variety identification, quality inversion and other tasks.

[0142] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in an order different than the embodiments and still achieve the desired result. In addition, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can also be advantageous or possible.

[0143] Next, please refer to Figure 4 , Figure 4 shows a structural schematic diagram of a red bayberry maturity detection system based on hyperspectral provided by an embodiment of the present specification.

[0144] The maturity detection system 400 comprises an image acquisition unit 401, an image processing unit 402, a calibration data acquisition unit 403, a model training unit 404 and a model prediction unit 405:

[0145] The image acquisition unit 401 acquires a plurality of sample red bayberries of multiple varieties and a red bayberry to be detected belonging to any one of the varieties, and performs hyperspectral image acquisition to obtain original hyperspectral images corresponding to the red bayberry to be detected and each sample red bayberry respectively.

[0146] The image processing unit 402 acquires a respective filtering parameter based on a noise feature parameter of each original hyperspectral image, and performs filtering processing on the original hyperspectral image based on the filtering parameter to obtain a processed hyperspectral image corresponding to the red bayberry to be detected and each sample red bayberry respectively, the filtering parameter comprising a filtering window size and a polynomial order.

[0147] The calibration data acquisition unit 403 acquires chemical detection data corresponding to each sample red bayberry respectively.

[0148] The model training unit 404 trains a to-be-trained model based on the chemical detection data corresponding to each sample red bayberry respectively and the processed hyperspectral image to obtain a prediction model.

[0149] The model prediction unit 405 takes the processed hyperspectral image of the red bayberry to be detected as an input of the prediction model to obtain prediction data measuring the maturity of the red bayberry to be detected.

[0150] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the red bayberry maturity detection system embodiment, since it is basically similar to the red bayberry maturity detection method embodiment, the description is relatively simple, and the relevant parts can be referred to the part of the red bayberry maturity detection method embodiment.

[0151] Please refer to Figure 5 The embodiment of the specification shown provides a structural schematic diagram of an electronic device.

[0152] As Figure 5 shown, the electronic device 500 can include at least one processor 501, at least one network interface 504, a user interface 503, a memory 505, and at least one communication bus 502.

[0153] The communication bus 502 can be used to realize the connection and communication of the above-mentioned components.

[0154] The user interface 503 can include a key, and the optional user interface can further include a standard wired interface and a wireless interface.

[0155] The network interface 504 can include, but is not limited to, a Bluetooth module, an NFC module, a Wi-Fi module, and the like.

[0156] The processor 501 can include one or more processing cores. The processor 501 connects various parts in the electronic device 500 through various interfaces and lines, executes various functions of the electronic device 500 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Alternatively, the processor 501 can be implemented in at least one of a hardware form of a DSP, an FPGA, and a PLC. The processor 501 can integrate one or a combination of a CPU, a GPU, and a modem. The CPU is mainly used to process an operating system, a user interface, and an application program. The GPU is used to render and draw the content to be displayed on the display screen. The modem is used to process wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 501, but can be implemented by a separate chip.

[0157] The memory 505 can include a RAM and a ROM. Alternatively, the memory 505 includes a non-transitory computer readable medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 can include a program storage area and a data storage area. The program storage area can store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area can store data involved in the above-mentioned various method embodiments, etc. The memory 505 can also be at least one storage device located away from the processor 501. The memory 505, as a computer storage medium, can include an operating system, a network communication module, a user interface module, and a Yangmei maturity detection application program. The processor 501 can be used to call the Yangmei maturity detection application program stored in the memory 505, and execute the steps of the Yangmei maturity detection method mentioned in the above-mentioned embodiments.

[0158] The embodiments of the present specification also provide a computer readable storage medium, which stores instructions. When the instructions are run on a computer or a processor, the computer or the processor executes the steps of one or more of the above-mentioned Yangmei maturity detection method embodiments. The components of the above-mentioned electronic device, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium.

[0159] In the above embodiments, all or part of the methods can be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the methods can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present specification are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in or transmitted by a computer readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center through a wired (such as a coaxial cable, an optical fiber, a digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. containing one or more available media sets. The available media can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital versatile disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)), etc.

[0160] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by a computer program instructing related hardware, which can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments. The storage medium includes ROM, RAM, magnetic or optical disc, and other program code storage media. In the case of no conflict, the technical features in the embodiments and the implementation solutions can be combined arbitrarily.

[0161] The above embodiments are only described as the preferred embodiment of the present specification, and do not limit the scope of the present specification. Without departing from the design spirit of the present specification, various modifications and improvements of the technical solutions of the present specification made by a person of ordinary skill in the art should fall within the protection scope determined by the claims of the present specification.

Claims

1. A method for detecting the maturity of bayberry based on hyperspectral imaging, characterized in that, Includes the following steps: Acquire multiple samples of bayberry of various varieties, as well as bayberry to be tested belonging to any of these varieties, and perform hyperspectral image acquisition to obtain the original hyperspectral image of the bayberry to be tested and each sample of bayberry. Based on the noise feature parameters of each original hyperspectral image, corresponding filtering parameters are obtained, and the original hyperspectral images are filtered based on the filtering parameters to obtain the bayberry to be detected and the processed hyperspectral images corresponding to each sample bayberry. The filtering parameters include the filtering window size and the polynomial order; the noise feature parameter is the spectral noise variance. Obtain the chemical test data corresponding to each sample of bayberry; Based on the chemical detection data and processed hyperspectral image corresponding to each sample of bayberry, the training model is trained to obtain the prediction model. The processed hyperspectral image of the bayberry to be tested is used as the input of the prediction model to obtain predictive data that measures the maturity of the bayberry to be tested. It also includes: obtaining the spectral noise variance threshold range for each variety of bayberry sample based on the original hyperspectral images of all samples of the same variety of bayberry. The boundary values ​​between varieties are obtained based on the spectral noise variance threshold range corresponding to each variety of bayberry sample. The filter parameters and spectral noise variance piecewise function are obtained based on the boundary values ​​between different varieties. Based on the filter parameter-spectral noise variance piecewise function and the spectral noise variance corresponding to each original hyperspectral image, the filter parameters corresponding to each original hyperspectral image are obtained.

2. The method for detecting the maturity of bayberry based on hyperspectral imaging according to claim 1, characterized in that, The process of obtaining the corresponding filtering parameters based on the noise feature parameters of each original hyperspectral image includes: Each original hyperspectral image is averaged and smoothed based on a preset window size to obtain a smoothed image; The spectral noise variance of each original hyperspectral image and its corresponding smoothed image are obtained as noise feature parameters. The corresponding filtering parameters are obtained based on the spectral noise variance of each original hyperspectral image.

3. The method for detecting the maturity of bayberry based on hyperspectral imaging according to claim 1, characterized in that, The step of obtaining the boundary values ​​between varieties based on the spectral noise variance threshold range corresponding to each variety of bayberry sample includes: Based on the spectral noise variance corresponding to the original hyperspectral images of all samples of the same variety of bayberry, the overall spectral noise variance corresponding to each sample of bayberry variety is obtained. The boundary values ​​between varieties are obtained based on the overall spectral noise variance and the spectral noise variance threshold range corresponding to each variety of bayberry sample.

4. The method for detecting the maturity of bayberry based on hyperspectral imaging according to claim 1, characterized in that, The process of filtering the original hyperspectral image based on filtering parameters to obtain the bayberry to be detected and the processed hyperspectral image corresponding to each sample bayberry includes: The original hyperspectral image is filtered based on the filtering parameters to obtain the filtered hyperspectral image; Based on the image enhancement strategy, the filtered hyperspectral image is enhanced to obtain the bayberry to be detected and the corresponding processed hyperspectral image of each sample bayberry. The determination of the image enhancement strategy includes: The hyperspectral images were enhanced using a variety of different candidate strategies, and the training models were trained to obtain their respective prediction models. Image enhancement strategies are determined based on the prediction accuracy of each prediction model; Each of the candidate strategies is at least one of differential transformation, logarithmic transformation, and reciprocal transformation.

5. The method for detecting the maturity of bayberry based on hyperspectral imaging according to claim 1, characterized in that, The model to be trained is a UNet convolutional neural network model that includes three-dimensional convolutional kernels.

6. The method for detecting the maturity of bayberry based on hyperspectral imaging according to claim 5, characterized in that, The UNet convolutional neural network model also includes a deep network structure and residual structures set between the layers of the deep network structure.

7. A system for detecting the maturity of waxberry based on hyperspectral imaging, characterized in that, It includes an image acquisition unit, an image processing unit, a calibration data acquisition unit, a model training unit, and a model prediction unit: The image acquisition unit acquires multiple sample bayberries of various varieties and bayberries to be tested belonging to any of these varieties, and performs hyperspectral image acquisition to obtain the original hyperspectral images corresponding to the bayberries to be tested and each sample bayberry. The image processing unit obtains corresponding filtering parameters based on the noise feature parameters of each original hyperspectral image, and performs filtering processing on the original hyperspectral image based on the filtering parameters to obtain the bayberry to be detected and the processed hyperspectral image corresponding to each sample bayberry. The filtering parameters include the filtering window size and the polynomial order. The The noise feature parameter is the spectral noise variance; it also includes: obtaining the spectral noise variance threshold range for each variety of bayberry sample based on the spectral noise variance corresponding to the original hyperspectral images of all samples of the same variety; obtaining the boundary values ​​between varieties based on the spectral noise variance threshold range corresponding to each variety of bayberry sample; obtaining the filtering parameter-spectral noise variance piecewise function based on the boundary values ​​between varieties; and obtaining the filtering parameter corresponding to each original hyperspectral image based on the filtering parameter-spectral noise variance piecewise function and the spectral noise variance corresponding to each original hyperspectral image. The calibration data acquisition unit acquires the chemical detection data corresponding to each sample of bayberry. The model training unit trains the model to be trained based on the chemical detection data and processed hyperspectral image corresponding to each sample of bayberry to obtain a prediction model. The model prediction unit takes the processed hyperspectral image of the bayberry to be detected as input to the prediction model to obtain prediction data that measures the maturity of the bayberry to be detected.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, the computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform the steps of the method as claimed in any one of claims 1-6.

Citation Information

Patent Citations

  • Fruit maturity judgment method, fruit maturity visualization method and device

    CN118840652A

  • Gaseous pollutant Fourier transform infrared spectroscopic analysis method based on deep learning

    CN120490000A