CN111443043B - Hyperspectral image-based walnut kernel quality detection method - Google Patents

Hyperspectral image-based walnut kernel quality detection method Download PDF

Info

Publication number
CN111443043B
CN111443043B CN202010002467.5A CN202010002467A CN111443043B CN 111443043 B CN111443043 B CN 111443043B CN 202010002467 A CN202010002467 A CN 202010002467A CN 111443043 B CN111443043 B CN 111443043B
Authority
CN
China
Prior art keywords
sample
walnut kernel
characteristic
image
walnut
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010002467.5A
Other languages
Chinese (zh)
Other versions
CN111443043A (en
Inventor
马文强
杨莉玲
李源
罗文杰
徐斌
刘奎
朱占江
沈晓贺
刘佳
买合木江·巴吐尔
崔宽波
田翔
祝兆帅
毛吾兰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Mechanization Research Institute Xinjiang Academy of Agricultural Sciences
Original Assignee
Agricultural Mechanization Research Institute Xinjiang Academy of Agricultural Sciences
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Mechanization Research Institute Xinjiang Academy of Agricultural Sciences filed Critical Agricultural Mechanization Research Institute Xinjiang Academy of Agricultural Sciences
Priority to CN202010002467.5A priority Critical patent/CN111443043B/en
Publication of CN111443043A publication Critical patent/CN111443043A/en
Application granted granted Critical
Publication of CN111443043B publication Critical patent/CN111443043B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands

Landscapes

  • Physics & Mathematics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)
  • Spectrometry And Color Measurement (AREA)

Abstract

A hyperspectral image-based walnut kernel quality detection method comprises the steps of collecting a hyperspectral image of a walnut kernel, screening characteristic spectra aiming at the fat content and the protein content of the walnut kernel, and establishing a prediction model of the fat content and the protein content of the walnut kernel; the method combining the characteristic spectrum and the image information is adopted, and the walnut kernel appearance quality classification based on the integrity and the skin color is realized. The invention solves the technical problems that the manual selection production cost is high, the grading randomness is large, the internal quality is difficult to distinguish, the chemical detection is destructive to the sample, and the detection time is long in the current walnut kernel grading production, and provides a feasible method for the rapid nondestructive identification of the walnut kernel quality.

Description

Hyperspectral image-based walnut kernel quality detection method
Technical Field
The invention relates to a method for carrying out nondestructive testing on the quality of walnut kernels based on a hyperspectral imaging technology, and belongs to the technical field of nondestructive testing and monitoring of agricultural products.
Technical Field
The walnut kernel is a natural food with rich nutrition, is rich in protein, unsaturated fatty acid and various trace elements, has the health care effects of blackening hair, strengthening brain, tonifying deficiency and strengthening body, and has the reputation of Wansui, changshouguo and Yangshengbao. China is the first big producing country of walnuts in the world, and the walnut planting area and the walnut yield are the first place in the world. The quality detection and classification of walnut kernels are important links in walnut production and processing. According to the regulations of relevant national standards, the appearance quality indexes of walnut kernels comprise integrity and skin color, and the internal quality chemical indexes comprise fat content and protein content. In actual production, the walnut kernel is manually selected mainly according to the shape and color, the production cost is high, the grading randomness is large, and the internal quality is difficult to distinguish. The traditional chemical detection is destructive to samples, has long detection time and is difficult to adapt to the requirements of modern production. At present, in the processing process of walnut kernels, classification treatment is mainly carried out on the walnut kernels according to indexes such as size, color and luster, integrity degree and the like in a manual or mechanical mode, and the varieties of the walnut kernels are difficult to distinguish. Therefore, the development of a rapid and nondestructive detection method for the protein content of walnut kernels is an urgent need of the walnut processing industry. The hyperspectral imaging simultaneously comprises two technical methods of image and spectrum, and the research on the aspect of agricultural product quality detection is increasingly extensive. However, the detection of the quality of the inside and the outside of the walnut kernel based on hyperspectral imaging has not been studied deeply.
Disclosure of Invention
The invention aims to solve the technical problems that manual selection and production cost is high, grading randomness is high, distinguishing of internal quality is difficult, chemical detection is destructive to a sample, and detection time is long in the conventional walnut kernel grading production. According to the method, a hyperspectral image of the walnut kernel is acquired, characteristic spectrum screening aiming at the fat content and the protein content of the walnut kernel is developed, and a prediction model of the fat content and the protein content of the walnut kernel is established; by adopting the method of combining the characteristic spectrum with the image information, the appearance quality classification of the walnut kernels based on the integrity and the skin color is realized, and a feasible method is provided for the quick and nondestructive identification of the walnut kernels.
The purpose of the invention is realized as follows:
a walnut kernel quality detection method based on hyperspectral images is characterized by comprising the following steps: the detection steps are as follows:
(1) Preparing a walnut kernel sample: selecting walnut kernels with the water content of below 7%, and placing the walnut kernels in a drying environment at room temperature for later use;
(2) Collecting hyperspectral images of the walnut kernel sample in spectral ranges of 862.9-1704.02nm and 382.19-1026.66nm respectively by hyperspectral image collection equipment;
(3) Numbering walnut kernel samples, collecting the color difference value of each walnut kernel sample by using a color difference meter, calculating the total color difference, recording the integrity level of each walnut kernel sample, and then measuring the protein and fat contents of each sample according to the requirements of national food safety standards GB5009.5-2016 and GB 5009.6-2016;
(4) Respectively extracting the average value of the spectrum of each walnut kernel sample in the hyperspectral images in two wave band ranges as sample spectrum information, and preprocessing the original spectrum information by adopting a combination method of multi-element scattering correction (MSE) and standard normalization (SVN);
(5) Respectively carrying out characteristic wave band screening on parameters of protein content and fat content of the walnut kernel sample in a spectral range of 862.9-1704.02nm, and carrying out characteristic wave band screening on total color difference of the walnut kernel sample in a spectral range of 382.19-1026.66 nm;
(6) Extracting a gray level image of a characteristic wave band related to the total color difference of the sample, calculating the average gray level of the gray level image to obtain an average gray level image, and counting the gray level distribution statistics of the average gray level image, including a mean value, a standard deviation, smoothness, consistency, entropy and a third moment, and the gray level co-occurrence matrix statistics, including contrast, correlation, energy and entropy, for further identifying the color of the walnut kernels;
(7) Extracting image appearance characteristic parameters of the walnut kernels in the characteristic waveband average gray level image, wherein the image appearance characteristic parameters comprise height, width, aspect ratio, area, circumscribed rectangle area, rectangle degree, circumscribed circle radius, circumscribed circle area and roundness degree, carrying out correlation analysis on the image appearance characteristic parameters, and reserving appearance characteristic parameters with small correlation for classifying the completeness of the walnut kernels;
(8) Extracting characteristic wave bands respectively related to the protein content and the fat content, and respectively establishing a walnut kernel protein and fat content prediction model by adopting a Partial Least Squares Regression (PLSR) algorithm;
(9) And establishing a walnut kernel appearance quality classification model by taking the extracted characteristic wave band spectrum information related to the total color difference of the sample, the average gray level image statistical characteristic parameter and the appearance characteristic parameter as input and the sample appearance grade label as output.
The object of the invention is also achieved in that: the method comprises the steps of screening characteristic wave bands of spectrum information of walnut kernel samples, adopting a mode of combining a competitive adaptive re-weighting algorithm (CARS) and a correlation coefficient method, firstly carrying out primary screening on the characteristic wave bands of the walnut kernel quality parameters through the CARS algorithm, then further carrying out optimization on the screened characteristic wave bands by adopting the correlation coefficient method, eliminating wave bands with correlation coefficients larger than 0.9, and using reserved wave bands as the characteristic wave bands of the walnut kernel quality parameters.
Establishing a walnut kernel protein and fat content prediction model: a training set and a verification set are established by adopting a random sampling method, characteristic wave bands respectively related to protein and fat content are extracted, partial Least Squares Regression (PLSR) models are respectively established, and the models are evaluated by adopting a decision coefficient R2 and mean square error MSE.
Establishing a walnut kernel appearance quality classification model: the method comprises the steps of taking extracted characteristic wave band spectral information related to total color difference of a sample, image statistical characteristic parameters and image appearance characteristic parameters as input, taking sample integrity level and color level as output, adopting a decision tree algorithm to respectively establish classification models of walnut kernel integrity level and color level, then establishing a corresponding relation between walnut kernel appearance quality and integrity and color according to the regulations in the LYT1922-2010 walnut kernel of the national forestry standard, and dividing the walnut kernel appearance quality into 7 levels.
Has the advantages that: the invention collects hyperspectral images of walnut kernels, establishes a prediction model of walnut kernel protein and fat content, realizes classification of walnut kernel appearance quality based on integrity and color by adopting a method of combining spectrum and image information, and provides a feasible method for rapid and nondestructive identification of walnut kernel quality. Compared with manual selection, the method has higher classification accuracy, and can realize detection of the internal quality of the walnut kernels; compared with the chemical method, the method has the characteristics of high detection speed, no damage to a detection sample and no chemical reagent residue. The invention can be used for developing rapid and nondestructive walnut kernel online detection and classification equipment or portable detection and classification instruments, and can also provide beneficial reference for rapid and nondestructive classification of other similar agricultural products.
Drawings
FIG. 1: sample appearance rating chart
FIG. 2: hyperspectral image acquisition equipment
FIG. 3: sample spectrum curve (862.9-1704.02 nm)
FIG. 4: mahalanobis distance distribution map of sample measurement
FIG. 5: PLSR model prediction results
FIG. 6: sample spectral curves (382.19-1026.66 nm).
Detailed Description
A method for detecting the quality of walnut kernels based on hyperspectral images comprises the following specific detection steps:
1. the method comprises the following steps of (1) acquiring a hyperspectral image of a walnut kernel sample, and acquiring spectral information:
1) Preparing a walnut kernel sample, wherein the water content of the walnut kernel is below 7%, and placing the walnut kernel sample in a drying environment at room temperature for later use.
2) Starting the hyperspectral image acquisition equipment, carrying out lens focusing after preheating, and debugging the moving speed of the platform so as to avoid image distortion.
3) Collecting hyperspectral images of walnut kernel samples in spectral ranges of 862.9-1704.02nm and 382.19-1026.66nm respectively. Before collecting hyperspectral information of a sample, white background information (I) is collected by using a standard white board and a lens cover w ) And black background information (I) b ) Then, according to the formula (1), the original hyperspectral image (I) of the collected sample is processed 0 ) And performing black-and-white correction to obtain corrected image information (I).
Figure BDA0002354028560000041
2. Numbering walnut kernel samples, collecting the color difference value of each walnut kernel sample by using a color difference meter, calculating the total color difference, recording the integrity grade of each walnut kernel sample, and then measuring the protein and fat contents of each sample according to the requirements of national food safety standards GB5009.5-2016 and GB 5009.6-2016.
3. Processing hyperspectral image data, wherein the data processing steps are as follows:
1) The average value of the spectrum of each walnut kernel sample in the hyperspectral images in the two wave band ranges is respectively extracted as sample spectrum information, and the original spectrum information is preprocessed by adopting a combination method of multi-element scattering correction (MSE) and standard normalization (SVN).
2) Adopting a competitive adaptive re-weighting algorithm (CARS) and a correlation coefficient incense to respectively screen characteristic wave bands for protein content and fat content parameters of a walnut kernel sample in a spectral range of 862.9-1704.02 nm; and (3) performing characteristic band screening on the total color difference of the walnut kernel sample in a spectral range of 382.19-1026.66 nm. Firstly, carrying out primary screening of characteristic wave bands on interested walnut kernel quality parameters through a CARS algorithm, then further carrying out optimization on the screened characteristic wave bands by adopting a correlation coefficient method, removing wave bands with correlation coefficients larger than 0.9, and using the reserved wave bands as the characteristic wave bands of the interested walnut kernel quality parameters.
3) And extracting a gray level image of a characteristic wave band related to the total chromatic aberration of the sample, and calculating the average gray level of the gray level image to obtain an average gray level image. And (3) counting 10 statistics of the gray distribution statistics (mean value, standard deviation, smoothness, consistency, entropy and third moment) and gray co-occurrence matrix statistics (contrast, correlation, energy and entropy) of the average gray image as image statistical characteristic parameters for further identifying the color of the walnut kernels. Then, carrying out binarization, otsu threshold segmentation and first expansion and then corrosion treatment on the extracted characteristic waveband average gray level image; and further extracting image appearance characteristic parameters of the walnut kernels, including height, width, aspect ratio, area, circumscribed rectangle area, rectangle degree, circumscribed circle radius, circumscribed circle area and circularity. Finally, the 9 image appearance characteristic parameters are subjected to correlation analysis, and appearance characteristic parameters with small correlation are reserved and used for walnut kernel integrity classification.
4. Establishment of walnut kernel internal quality index detection model
After abnormal samples with large measurement errors are removed by adopting a Mahalanobis distance method, a training set and a verification set are established by adopting a random sampling method, and a Partial Least Squares Regression (PLSR) model is respectively established by extracting characteristic wave bands respectively related to protein and fat contents aiming at the protein content and the fat content. Using a determining coefficient R 2 And the mean square error MSE evaluates the model.
5. Establishment of walnut kernel appearance grade classification model
The extracted characteristic wave band spectral information, image statistical characteristic parameters and image appearance characteristic parameters related to the total color difference of the sample are used as input, the integrity level and the color level of the sample are used as output, classification models of the integrity level and the color level of the walnut kernel are respectively established by adopting a decision tree algorithm, then the corresponding relation (shown in table 6) of the appearance quality of the walnut kernel, the integrity level and the color is established according to the regulations in the LYT1922-2010 walnut kernel of the national forestry standard, and the appearance quality of the walnut kernel is divided into 7 levels.
The sample material and processing method used in the present invention, hyperspectral image acquisition, and the method for establishing the classification model of the protein and fat content in the walnut kernel and the appearance quality of the walnut kernel are described in detail below.
1 materials and methods
1.1 Experimental samples and treatments
The experimental sample is Xinjiang 'Wen 185' walnut with the water content of 7%, and is stored in a cold storage environment at 4 ℃ for about 5 months before the experiment. 60 walnut kernel samples are selected after manual shell breaking and kernel taking, the selected walnut kernel samples comprise three integrity grades of half kernels, 1/4 kernels and broken kernels and three color grades of light yellow, light amber and amber, and the corresponding relationship between the appearance grade distribution and the color grade of the samples and the total color difference is shown in tables 1 and 2. After the hyperspectral image is identified and collected through hyperspectral imaging, a color difference meter is used for collecting total color difference delta E of 5 different positions of each walnut kernel sample, and the average value is calculated for identifying the color of the walnut kernel sample. And then measuring the protein content of each sample by adopting a Foss full-automatic Kjeldahl azotometer and measuring the fat content by adopting a Soxhlet extractor according to the requirements of national food safety standards GB5009.5-2016 and GB 5009.6-2016.
TABLE 1 sample appearance rating distribution
Figure BDA0002354028560000061
TABLE 2 sample color grade and color difference range mapping
Figure BDA0002354028560000062
1.2 Hyperspectral image acquisition
The hyperspectral image acquisition equipment is a Gaia hyperspectral imager, and mainly comprises an imaging spectrometer (V10E) 1, a lens (OL 23) 2, a CCD (LT 365) 3, a uniform light source (2 sets of bromine tungsten lamps) 4, an electric control mobile platform 5, a computer and a software system 7 as shown in figure 2. Preheating is carried out after starting up, so that the influence caused by baseline drift is eliminated; and after preheating, carrying out lens focusing and debugging the moving speed of the platform to avoid image distortion. And adopting image acquisition software Spectra View to acquire imaging information of the walnut kernels 6. Collecting hyperspectral images of walnut kernel samples in spectral ranges of 863-1704nm and 382-1027nm respectively, wherein the spectral resolution is 3.2nm in the range of 863-1704 nm; the spectral resolution was 0.84nm in the 382-1027nm range.
In order to eliminate noise influence caused by uneven illumination, surrounding environment and instrument dark current, the method needs to collect white background information (I) by using a standard white board and a lens cover before collecting the hyperspectral information of a sample w ) And black background information (I) b ) Then, according to the formula (1), the original hyperspectral image (I) of the collected sample is processed 0 ) And performing black-and-white correction to obtain corrected image information (I).
Figure BDA0002354028560000063
1.3 spectral data extraction and processing
Extracting a region of interest (ROI) of a hyperspectral image of a walnut kernel sample by adopting ENVI5.1 software, calculating a spectral average value of the ROI as sample spectral information, and performing subsequent processing by adopting matlab R2015a software. In order to further eliminate noise in the spectral information, the original spectral information is preprocessed by adopting a combination method of multivariate scattering correction and standard normalization.
The characteristic wave band screening is carried out on the full-wave band spectrum data, so that redundant data in a full-wave band range can be effectively eliminated, the signal-to-noise ratio of the spectrum data is improved, and the calculated data amount is reduced. The research adopts a competitive adaptive re-weighting algorithm (CARS) and a correlation coefficient method to be combined with the method and the spice to respectively screen characteristic wave bands aiming at three parameters of protein content, fat content and total color difference of a walnut kernel sample so as to improve the efficiency and the precision of establishing a model.
2 detecting the internal quality index of walnut kernel based on spectral information
The obtained ROI average spectral information and the pretreated spectral information of the walnut kernels of the sample group a are shown in fig. 3. As can be seen from the figure, the overall characteristics of the original spectral information of the sample are basically consistent, but the absorption peak is not obvious. By adopting the pretreatment method combining the MSC and the SVN, the influence of partial background noise is removed, and the spectral information of the sample is smoother; meanwhile, the consistency of spectral information is further enhanced, and spectral peaks and valleys are highlighted, so that spectral characteristics are enhanced.
In order to reduce the influence of measurement errors in spectrum acquisition and quality parameter chemical detection, abnormal sample information is removed by adopting a Mahalanobis distance method. Respectively calculating the Mahalanobis distance from the spectrum information and the chemical measurement value of each sample to the center of the sample set, then counting the mean value mu and the mean square error sigma of the Mahalanobis distance of the sample set, taking mu +3 sigma as a threshold value, and removing the samples with the Mahalanobis distance larger than the threshold value as abnormal samples. Fig. 4a, 4b, and 4c are mahalanobis distance distribution diagrams of sample spectral information, protein content measurement values, and fat content measurement values, respectively, where the lower red line is a normal sample and the upper red line is an abnormal sample.
In order to eliminate the noise influence of the front section and the rear section of the spectrum and remove 10 wave band points of the front section and the rear section, a CARS algorithm is adopted to respectively carry out characteristic wave band screening on a protein content measured value and a fat content measured value of a sample; and further optimizing the screened characteristic wave bands by adopting a correlation coefficient method, and rejecting the wave bands with the correlation coefficient larger than 0.9. In fig. 3, the red dotted line is marked as a characteristic band related to the protein content of the sample, the blue dotted line is marked as a characteristic band related to the fat content of the sample, and finally, 6 characteristic bands related to the protein content of the sample are screened, 7 characteristic bands related to the fat content of the sample are screened, wherein 1269nm is a characteristic band related to the protein and fat content together, the total number of screened characteristic bands is 12, and specific corresponding wavelengths are shown in table 3.
TABLE 3 characteristic bands selected
Figure BDA0002354028560000071
Respectively establishing a PLSR prediction model of a sample protein content and fat content full spectrum band and a characteristic spectrum band, wherein the PLS principal component number is 5, and the modeling cross validation times is 10. The modeling effect is shown in table 4, and fig. 5 shows the results of the protein and fat content prediction model established using the characteristic band. Compared with full spectrum information, the characteristic waveband modeling is adopted, the decision coefficient R2 and the mean square error MSE of the model are obviously improved, the verification set R2 of the protein content prediction model is increased from 0.66 to 0.91, and the MES is reduced from 1.37 to 0.78; the verification set R2 of the fat content prediction model is increased from 0.83 to 0.93, and MES is reduced from 0.98 to 0.47, which shows that the complexity of full spectrum information is effectively reduced by the 12 screened characteristic wave bands by combining the CARS algorithm and the correlation coefficient method, and the modeling quality is improved.
TABLE 4 PLSR predictive model modeling results
Figure BDA0002354028560000081
3 walnut kernel color identification based on spectral information and image characteristics
FIG. 6 is an average spectrum curve of walnut kernel samples with three colors, wherein 20 wavelength bands of the front and rear segments are removed due to the large noise influence of the front and rear segments of the spectrum, and 688 wavelength bands of the range of 399.1-1008.1nm are taken for analysis. As can be seen from fig. 6, in the original spectrum, the spectral reflectances of the spectral curves of the walnut kernel samples with three colors in the visible light range show a significantly decreasing trend along with the colors from light to dark, and the spectra in the near infrared spectrum are relatively disordered. The spectrum reflectivity of the spectrum information after the pretreatment presents certain regularity and consistency, which is beneficial to the subsequent spectrum treatment. After multi-element scattering correction and standard normalization pretreatment are carried out on the full spectrum information of the sample, a CARS algorithm is adopted to carry out characteristic wave band screening aiming at the total chromatic aberration measured value of the sample, the numbers of the screened characteristic wave bands are 5 and 336, and the corresponding characteristic wave bands are 402.5nm and 689.2nm.
In order to compare the difference between the extracted characteristic wave band and RGB (475 nm, 550nm and 650 nm) wave bands in the color identification of walnut kernels, an RGB image and a characteristic wave band image are respectively adopted. As the sample images with different color grades have differences in gray feature and texture information, 10 statistics of gray distribution statistics (mean value, standard deviation, smoothness, consistency, entropy and third moment) and gray co-occurrence matrix statistics (contrast, correlation, energy and entropy) of RGB wave band and feature wave band average gray image are counted as image statistical feature parameters for further color identification of walnut kernels. Three color classification models of a decision tree algorithm, a K-nearest neighbor algorithm and a support vector machine are established by taking full-waveband spectrum information, characteristic waveband spectrum information and a combination of the characteristic waveband spectrum information and image statistical characteristic parameters as input variables and taking a sample color grade label as an output variable, wherein the K value in the K-nearest neighbor algorithm is 4, and the support vector machine adopts a linear kernel function. Before the model is established, a model training set and a test set are established by random sampling according to the proportion of 2. And finally, counting the average accuracy of the classification of the test set sampled for 10 times as a judgment index of the classification accuracy of the model. The average accuracy of the model classification is shown in table 5.
TABLE 5 mean accuracy of classification
Figure BDA0002354028560000091
As can be seen from table 5, when the combination of the image statistical characteristic parameters and the characteristic band spectrum information is used as the input variable, the color classification model established by the decision number algorithm has the highest classification accuracy, which reaches 99.6%. In the aspect of input variables, because the full-band spectrum contains a large amount of irrelevant redundant information, the accuracy rate of the model is reduced when the model is participated in modeling; the characteristic wave band modeling is adopted, the interference of redundant information is greatly reduced, the modeling efficiency is improved, and meanwhile, the classification accuracy of the characteristic wave band modeling is obviously higher than that of RGB wave bands. The image statistical characteristic parameters reflect the color and luster and texture changes of the sample image and belong to effective classification information, so the accuracy of the classification model can be further improved by adding the image statistical characteristic parameters on the basis of the characteristic wave band spectrum information and the RGB wave band spectrum information. In the aspect of input variables, when full-waveband spectrum information is adopted as input, the number of the input variables is large, and the accuracy of a classification model adopting an SVM algorithm is higher than that of a decision tree and a KNN algorithm; when the number of input variables is the combination of the characteristic wave band and the image information, the number of the input variables is greatly reduced, and the decision tree algorithm has obvious advantages in the aspects of model classification accuracy and classification calculation speed.
4 walnut kernel appearance quality classification based on image characteristics
Carrying out binaryzation, otsu threshold segmentation and expansion-then-corrosion treatment on the extracted characteristic waveband average gray level image; and further extracting the image appearance characteristic parameters of 54 walnut kernels with different integrity degrees (whole kernels, 1/2 kernels and 1/4 kernels), including height, width, aspect ratio, area, circumscribed rectangle area, rectangle degree, circumscribed circle radius, circumscribed circle area and roundness degree. Finally, 9 image appearance characteristic parameters are subjected to correlation analysis, appearance parameters with correlation coefficients larger than 0.9 are removed, and finally 6 appearance parameters of height, width, height-width ratio, area, rectangle degree and circularity are reserved. And (3) taking the image appearance characteristic parameters as input, taking the sample integrity level as output, and establishing a walnut kernel integrity level classification model by adopting a decision number algorithm. The appearance of the sample is further graded according to the integrity and the color according to the regulations in the national forestry standard LYT1922-2010 walnut kernel. The image appearance characteristic parameters, the characteristic wave band spectrum information and the image statistical characteristic parameters are used as input variables, the sample grade marks are used as output variables, the established color and integrity classification models are adopted to classify the walnut kernel appearance grade, and the classification results are shown in the table 6. As can be seen from the table 6, the established classification model has a good effect of classifying the appearance grade of the walnut kernels, and the average classification accuracy rate reaches 98.4%.
TABLE 6 walnut kernel appearance classification results
Figure BDA0002354028560000101
/>

Claims (1)

1. A walnut kernel quality detection method based on hyperspectral images is characterized by comprising the following steps: the detection steps are as follows:
(1) Preparing a walnut kernel sample: selecting walnut kernels with the water content of below 7%, and placing the walnut kernels in a drying environment at room temperature for later use;
(2) Collecting hyperspectral images of the walnut kernel sample in spectral ranges of 862.9-1704.02nm and 382.19-1026.66nm respectively by hyperspectral image collection equipment;
(3) Numbering walnut kernel samples, collecting the color difference value of each walnut kernel sample by using a color difference meter, calculating the total color difference, recording the integrity level of each walnut kernel sample, and then measuring the protein and fat contents of each sample according to the requirements of national food safety standards GB5009.5-2016 and GB 5009.6-2016;
(4) Respectively extracting the average value of the spectrum of each walnut kernel sample in the hyperspectral images of the two wave band ranges as sample spectrum information, and preprocessing the original spectrum information by adopting a combination method of multivariate scattering correction and standard normalization;
(5) Respectively screening characteristic wave bands aiming at the protein content and fat content parameters of the walnut kernel sample in the spectral range of 862.9-1704.02nm, and eliminating abnormal sample information by adopting a Mahalanobis distance method; respectively calculating the Mahalanobis distance from each sample spectral information and each chemical measurement value to the center of the sample set, then counting the mean value mu and the mean square error sigma of the Mahalanobis distance of the sample set, taking mu +3 sigma as a threshold, and removing the samples with the Mahalanobis distance larger than the threshold as abnormal samples; removing 10 wave band points of the front section and the rear section respectively, and adopting a competitive self-adaptive re-weighting algorithm to respectively screen characteristic wave bands aiming at a protein content measured value and a fat content measured value of a sample; further optimizing the screened characteristic wave bands by adopting a correlation coefficient method, and rejecting the wave bands with the correlation coefficient larger than 0.9; finally, 6 characteristic wave bands related to the protein content of the sample are screened to be 1269nm, 1272.3nm, 1436nm, 1484nm, 1555.2nm and 1662.1nm, and 7 characteristic wave bands related to the fat content of the sample are screened to be 1149nm, 1152.4nm, 1245.8nm, 1269nm, 1361nm, 1471nm and 1596.7nm; carrying out characteristic band screening on the total chromatic aberration of the walnut kernel sample in a spectral range of 382.19-1026.66 nm; removing 20 wave band points of the front section and the rear section, taking 688 wave bands in the range of 399.1-1008.1nm for analysis, adopting a competitive adaptive re-weighting algorithm to screen characteristic wave bands, wherein the numbers of the screened characteristic wave bands are 5 and 336, and the corresponding characteristic wave bands are 402.5nm and 689.2nm;
(6) Extracting gray level images of characteristic bands related to the total color difference of the sample, calculating the average gray level of the gray level images to obtain an average gray level image, counting the gray level distribution statistics of the average gray level image including a mean value, a standard deviation, smoothness, consistency, entropy and a third moment and the gray level co-occurrence matrix statistics including contrast, correlation, energy and entropy, and taking 10 statistics as image statistical characteristic parameters for further identifying the color of the walnut kernels;
(7) Extracting image appearance characteristic parameters of walnut kernels in the characteristic waveband average gray level image, wherein the image appearance characteristic parameters comprise height, width, aspect ratio, area, circumscribed rectangle area, rectangle degree, circumscribed circle radius, circumscribed circle area and circularity, carrying out correlation analysis on the image appearance characteristic parameters, and reserving 6 appearance parameters of height, width, aspect ratio, area, rectangle degree and circularity for carrying out walnut kernel integrity classification;
(8) Establishing a walnut kernel protein and fat content prediction model: establishing training set and verification set by random sampling method, extracting characteristic wave bands respectively related to protein and fat content, respectively establishing partial least squares regression model, and adopting determination coefficient R 2 Evaluating the model by Mean Square Error (MSE);
(9) The method comprises the steps of adopting a combination of image statistical characteristic parameters and characteristic wave band spectrum information as an input variable, adopting a sample color grade label as an output variable, and adopting a decision tree algorithm to establish a color classification model; establishing a walnut kernel integrity classification model by using a decision tree algorithm by taking image appearance characteristic parameters as input and sample integrity level as output; further establishing a corresponding relation between the appearance quality of the walnut kernels and the integrity and color according to the regulations in the national forestry standard LYT1922-2010 walnut kernels, and dividing the appearance quality of the walnut kernels into 7 grades; and establishing a walnut kernel appearance quality classification model by taking the extracted characteristic wave band spectrum information related to the total color difference of the sample, the image statistical characteristic parameter and the image appearance characteristic parameter as input and the sample appearance grade label as output.
CN202010002467.5A 2020-01-03 2020-01-03 Hyperspectral image-based walnut kernel quality detection method Active CN111443043B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010002467.5A CN111443043B (en) 2020-01-03 2020-01-03 Hyperspectral image-based walnut kernel quality detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010002467.5A CN111443043B (en) 2020-01-03 2020-01-03 Hyperspectral image-based walnut kernel quality detection method

Publications (2)

Publication Number Publication Date
CN111443043A CN111443043A (en) 2020-07-24
CN111443043B true CN111443043B (en) 2023-04-18

Family

ID=71626972

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010002467.5A Active CN111443043B (en) 2020-01-03 2020-01-03 Hyperspectral image-based walnut kernel quality detection method

Country Status (1)

Country Link
CN (1) CN111443043B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112213455A (en) * 2020-09-29 2021-01-12 新疆农业科学院园艺作物研究所 Method for measuring water content of dried fruits
CN113109240B (en) * 2021-04-08 2022-09-09 国家粮食和物资储备局标准质量中心 Method and system for determining imperfect grains of grains implemented by computer
CN113933248A (en) * 2021-10-12 2022-01-14 广东省科学院智能制造研究所 Hyperspectral online detection system and method
CN113706527B (en) * 2021-10-27 2021-12-21 南通宝田包装科技有限公司 Quality detection method and system for cosmetic package
CN115187870B (en) * 2022-09-13 2023-01-03 浙江蓝景科技有限公司杭州分公司 Marine plastic waste material identification method and system, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1995987B (en) * 2007-02-08 2010-05-12 江苏大学 Non-destructive detection method for agricultural and animal products based on hyperspectral image technology
CN105115910B (en) * 2015-08-28 2018-08-17 中国农业科学院农产品加工研究所 The method that protein content is distributed in peanut is detected based on high light spectrum image-forming technology
CN105115909B (en) * 2015-08-28 2018-02-16 中国农业科学院农产品加工研究所 The method that fat content profiles in peanut are detected based on high light spectrum image-forming technology
CN106525875A (en) * 2016-12-07 2017-03-22 江苏大学 Hyperspectral detection method of color and texture changes in preserved meat salting process
CN107228809B (en) * 2017-05-09 2018-11-06 中国农业科学院农产品加工研究所 A kind of peanut quality evaluation method and device suitable for peanut processing of lying fallow

Also Published As

Publication number Publication date
CN111443043A (en) 2020-07-24

Similar Documents

Publication Publication Date Title
CN111443043B (en) Hyperspectral image-based walnut kernel quality detection method
CN110763698B (en) Hyperspectral citrus leaf disease identification method based on characteristic wavelength
Xing et al. Combination of chemometric tools and image processing for bruise detection on apples
Gao et al. Application of hyperspectral imaging technology to discriminate different geographical origins of Jatropha curcas L. seeds
US11682203B2 (en) Feature extraction method, model training method, detection method of fruit spectrum
CN104965973B (en) A kind of Apple Mould Core multiple-factor Non-Destructive Testing discrimination model and method for building up thereof
Chao et al. High throughput spectral imaging system for wholesomeness inspection of chicken
CN112699756B (en) Hyperspectral image-based tea origin identification method and system
CN109870421A (en) It is a kind of based on visible light/near-infrared spectrum analysis incrementally timber varieties of trees classifying identification method
CN101692052A (en) Hyperspectrum image technique-based method and hyperspectrum image technique-based device for identifying true and false famous tea
CN103528967A (en) Hyperspectral image based overripe Lonicera edulis fruit identification method
CN110108649A (en) The fast non-destructive detection method of oil crops quality based on terahertz light spectral technology
CN115905881B (en) Yellow pearl classification method and device, electronic equipment and storage medium
Zhang et al. SMOTE-based method for balanced spectral nondestructive detection of moldy apple core
Sun et al. Non-destructive detection of blackheart and soluble solids content of intact pear by online NIR spectroscopy
CN113570538A (en) Blade RGB image skewed distribution parameter information acquisition and analysis method
CN106940292A (en) Bar denier wood raw material quick nondestructive discrimination method of damaging by worms based on multi-optical spectrum imaging technology
CN112485216B (en) Multi-source information fusion Thailand jasmine rice adulteration identification method
CN113484278A (en) Tomato comprehensive quality nondestructive testing method based on spectrum and principal component analysis
Shi et al. Application of spectral features for separating homochromatic foreign matter from mixed congee
CN107403181B (en) Lean meat and fat meat self-adaptive separation method based on Guangdong style sausage hyperspectral image
Xu et al. Detection of Cucumber Powdery Mildew Based on Spectral and Image Information
CN113655020B (en) Method for detecting empty walnut
CN116842436B (en) Multispectral combined skin basal cell carcinoma identification method
Ji et al. Nondestructive Classification of Potatoes Based on HSI and Clustering

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant