Method for rapidly detecting freshness of chilled duck meat by combining NIRS and CV

文档序号:1962848 发布日期:2021-12-14 浏览:32次 中文

阅读说明:本技术 一种融合nirs和cv对冷鲜鸭肉新鲜度进行快速检测的方法 (Method for rapidly detecting freshness of chilled duck meat by combining NIRS and CV ) 是由 徐晓云 邢政 吴婷 潘思轶 于 2021-08-30 设计创作,主要内容包括:本发明公开了一种融合NIRS和CV对冷鲜鸭肉新鲜度进行快速检测的方法,属于食品检测技术领域。通过提取不同检测方法的特征变量,将光谱数据降维后与图像变换数据共同构建成冷鲜鸭肉的多维度特征变量,丰富变量的信息,应用KNN(K-Nearest Neighbor)法即K最邻近法建立冷鲜鸭肉的新鲜度预测模型,多维度特征变量极大提高了建模的准确性,在对样品新鲜度验证时,准确率高达95.24%,效果良好。(The invention discloses a method for rapidly detecting freshness of cold fresh duck meat by fusing NIRS and CV, and belongs to the technical field of food detection. By extracting characteristic variables of different detection methods, reducing the dimensions of the spectral data and constructing the spectral data and the image transformation data together into a multi-dimensional characteristic variable of the chilled duck meat, enriching the information of the variable, and establishing a freshness prediction model of the chilled duck meat by applying a KNN (K-Nearest Neighbor) method, namely a K Nearest Neighbor method, the multi-dimensional characteristic variable greatly improves the accuracy of modeling, and when the freshness of a sample is verified, the accuracy is as high as 95.24%, and the effect is good.)

1. The method for rapidly detecting the freshness of the chilled duck meat by fusing the NIRS and the CV is characterized by comprising the steps of establishing a KNN model and detecting the freshness of the chilled duck meat by using the KNN model, wherein the step of establishing the KNN model comprises the following steps:

1) cutting the chilled fresh duck meat for modeling, refrigerating at 4 ℃, and periodically acquiring near infrared spectrum data and image data of a sample, wherein the near infrared spectrum data is acquired by using a fiber probe diffuse reflection mode with a wave band of 4,000--1The response value of the spectrum is expressed in log (1/R), wherein R is the reflectivity; the acquisition of image data uses a high-resolution digital camera with the resolution not lower than 500 ten thousand pixels; the frequency of data acquisition is once every 1-3 h, and the data acquisition lasts for 14 days;

2) the method comprises the steps of collecting near infrared spectrum data and image data, simultaneously carrying out physical and chemical index measurement on a sample, and grading and marking the freshness grade of the sample according to the physical and chemical index measurement result;

3) carrying out principal component analysis on the near infrared spectrum data acquired in the step 1) by using computer software, and reducing the original multiple principal components into data with only one principal component, wherein the data is represented by P;

4) obtaining color values in the image data acquired in the step 1) by using computer software, and calculating a color distance between the color values and an initial color value, wherein the data is represented by S;

5) and (3) carrying out normalization processing on the P value and the S value by using computer software, and constructing a characteristic variable matrix X of the n samples as follows:

6) and judging the category of the freshness of the sample by using a k-nearest neighbor algorithm, and establishing a KNN model of the characteristic variable and the freshness grade of the sample.

2. The method of claim 1, wherein: the physicochemical index measurement in the step 2) is pH measurement and TVB-N value measurement.

3. The method of claim 1, wherein: when the freshness grade of the sample is graded according to the measurement result of the physicochemical indexes, fresh meat is graded when the pH value is 5.8-6.2 and the TVB-N is less than 15mg/100 g; and (3) rating the meat with pH value of 6.3-6.6 and TVB-N value of 15-25 mg/100g as a secondary fresh meat: the samples with pH >6.7 and TVB-N >25mg/100g were rated as spoiled meat and classified as low freshness grade according to the principle of low if the TVB-N value and pH value were not in the same freshness grade.

4. The method of claim 1, wherein: the near infrared spectrum data in the step 3) are 5500-6500 and 7500-10000cm-1Data in two band ranges.

5. The method of claim 1, wherein: the color values described in step 4) include a red value, a green value and a blue value, which are respectively represented by R, G, B.

6. The method of claim 5, wherein the color distanceSnThe calculation formula of (2) is as follows:

wherein R is0、G0、B0Representing the color value at the beginning, Rn、Gn、BnRepresenting the color values actually detected by the sample.

7. The method of claim 1, wherein: when the K nearest neighbor algorithm is used for judging the category of the freshness of the sample, the accuracy is highest when the K value is 1, 2 or 3, and any one of the K values is selected.

Technical Field

The invention relates to the technical field of food detection, relates to a method for detecting freshness of chilled duck meat, and particularly relates to a method for rapidly detecting the freshness of the chilled duck meat by fusing a spectrum technology and an image technology.

Background

Freshness is an important index of meat quality safety, nitrogen-containing substances such as ammonia, amines and the like can be generated in the meat deterioration process, the deterioration degree of the meat is usually expressed by measuring the content of volatile basic nitrogen (TVB-N) traditionally, and the method needs a certain detection period and special instruments and equipment and is not suitable for field detection.

At present, the nondestructive detection technology is gradually replacing the conventional detection method, wherein the near infrared spectroscopy (NIRS) technology is widely applied, because meat contains a large amount of organic compounds such as protein, carbohydrate and the like, the substances containing hydrogen groups can cause frequency combination and frequency doubling absorption of near infrared to generate an absorption spectrum, and then a relation model between the spectrum and a detection target is established through chemometrics to realize rapid detection, and the NIRS is applied to the aspects of meat adulteration and component prediction at present. In addition, computer vision technology (CV) has been widely used for acquiring image information of a sample by an image sensor, converting the image information into a digital signal, and analyzing the digital signal by a computer, and also for characteristic information of meat such as color, texture, and darkness. Although these non-destructive testing methods have the advantages of rapidness, safety, low cost, etc., the nature of these non-destructive testing methods is an indirect testing method, and the accuracy is always an important factor that restricts the further popularization thereof.

The near infrared spectrum technology and the computer vision technology can evaluate the quality of meat from different angles, and although the detection of the freshness of the chilled meat by applying the two technologies is reported individually, the accuracy is still not high, mainly because a single detection technology can only be used for measuring from one aspect, and the characterization of sample characteristic information is not comprehensive.

The method for constructing the characteristic variables of the samples by fusing a plurality of detection technologies is an effective means for enriching sample information and improving the accuracy of a nondestructive detection method, but the method for detecting the freshness of the chilled duck meat by fusing a spectrum technology and an image technology is not reported at present.

Disclosure of Invention

Aiming at the problem that the detection accuracy of the existing single detection technology on the cold fresh duck meat is not high, the invention integrates multidimensional data by using two detection technologies of NIRS and CV and fusing the detection technologies through special treatment to construct a more accurate prediction model, thereby realizing the rapid detection on the freshness of the cold fresh duck meat.

In order to achieve the purpose, the invention adopts the following technical means:

a method for rapidly detecting freshness of chilled duck meat by fusing NIRS and CV comprises the steps of establishing a KNN model and detecting the freshness of the chilled duck meat by using the KNN model, wherein the establishment of the KNN model comprises the following steps:

1) cutting the chilled fresh duck meat for modeling, refrigerating at 4 ℃, and periodically acquiring near infrared spectrum data and image data of a sample, wherein the near infrared spectrum data is acquired by using a fiber probe diffuse reflection mode with a wave band of 4,000--1The response value of the spectrum is expressed in log (1/R), wherein R is the reflectivity; the acquisition of image data uses a high-resolution digital camera with the resolution not lower than 500 ten thousand pixels; the frequency of data acquisition is once every 1-3 h, and the data acquisition lasts for 14 days;

2) the method comprises the steps of collecting near infrared spectrum data and image data, simultaneously carrying out physical and chemical index measurement on a sample, and grading and marking the freshness grade of the sample according to the physical and chemical index measurement result;

3) carrying out principal component analysis on the near infrared spectrum data acquired in the step 1) by using computer software, and reducing the original multiple principal components into data with only one principal component, wherein the data is represented by P;

4) obtaining color values in the image data acquired in the step 1) by using computer software, and calculating a color distance between the color values and an initial color value, wherein the data is represented by S;

5) and (3) carrying out normalization processing on the P value and the S value by using computer software, and constructing a characteristic variable matrix X of the n samples as follows:

6) and judging the category of the freshness of the sample by using a k-nearest neighbor algorithm, and establishing a KNN model of the characteristic variable and the freshness grade of the sample.

Wherein, the physicochemical index measurement in the step 2) is pH measurement and TVB-N value measurement.

When the freshness grade of the sample is graded according to the measurement result of the physicochemical indexes, fresh meat is graded with the pH value of 5.8-6.2 and the TVB-N value of 15mg/100 g; and (3) rating the meat with pH value of 6.3-6.6 and TVB-N value of 15-25 mg/100g as a secondary fresh meat: the samples with pH >6.7 and TVB-N >25mg/100g were rated as spoiled meat and classified as low freshness grade according to the principle of low if the TVB-N value and pH value were not in the same freshness grade.

Wherein the near infrared spectrum data in the step 3) are 5500--1Data in two band ranges.

Wherein the color values in step 4) include a red color value, a green color value and a blue color value, which are respectively represented by R, G, B.

Wherein the color space SnThe calculation formula of (2) is as follows:

R0、G0、B0representing the color value at the beginning, Rn、Gn、BnRepresenting the color values actually detected by the sample.

When the class to which the freshness of the sample belongs is judged by using a K-nearest neighbor algorithm, the accuracy is highest when the K value is 1, 2 or 3, and any one of the K values is selected.

The invention has the beneficial effects that:

the invention integrates the spectrum and the image to construct a detection model of the characteristic variable of the sample, can meet the requirement of on-line continuous detection, has higher detection accuracy than a single near infrared method or computer vision, and has great application potential in the aspects of production and processing intellectualization and digitization.

Drawings

FIG. 1 near infrared spectra of duck meat at various refrigeration times.

FIG. 2 images of duck meat at different refrigeration times.

FIG. 3 shows the physical and chemical indexes of duck meat under different refrigeration time.

FIG. 4 is a graph of the accuracy distribution of models for different K values.

FIG. 5 is a prediction of test set freshness by an optimal KNN model.

Detailed Description

The present invention will be further illustrated with reference to the following specific examples, but the present invention is not limited to the following examples.

Example 1

(1) Duck sample preparation

Fresh and slaughtered cold fresh duck meat is purchased from a supermarket, the duck breast meat is selected, sliced and trimmed into square blocks with the shape of about 10cm multiplied by 10cm and the thickness of 2cm, and the square blocks are stored under the refrigeration condition of 4 ℃.

(2) Sample spectral and image data acquisition

And (3) refrigerating the sample for 0-14 days, and collecting the near infrared spectrum and the image data of the sample at intervals of 1-3 h (random time points and random sample blocks).

The instrument used for near infrared spectrum acquisition is an Antaris II Fourier transform near infrared analyzer, and log (1/R) represents the response value of the spectrum, wherein R is the reflectivity. The acquisition parameters are shown in table 1.

TABLE 1 acquisition parameters of near infrared spectra

The near infrared spectrum data is response values of a sample under different wave numbers, the wave number interval is related to the resolution of a near infrared instrument, and the shorter the interval is, the more the wave numbers are, the higher the resolution is, the more the variable numbers are, and the more comprehensive spectrum information can be reflected. Of course, the huge number of variables brings inconvenience to modeling, and there are some interferences not related to interval information while consuming time, which affects the accuracy of the model.

The image data adopts a Sony IMX219 camera, can continuously shoot high-definition pictures with 800 ten thousand pixels, and is connected with a computer through a USB.

Fig. 1 and 2 are raw spectra and images collected at 1 day, 6 days, and 12 days, respectively, for a random sample.

The spectral data in FIG. 1 show that the wavenumber ranges 5500--1The duck meat shows obvious difference for different refrigeration time, which shows that the near infrared spectrum can obtain distinctive spectrum data for the duck meat with different refrigeration time, and provides a basis for establishing a correlation model between the near infrared spectrum and the freshness of the duck meat; meanwhile, when the spectral data is processed at the later stage, 5500-6500 and 7500-10000cm can be considered in an important way for reducing the data volume-1Data in two band ranges.

The image data of fig. 2 shows that the duck meat was bright-colored, glossy, dark-colored and matt on day 1 of refrigeration, and dark-colored and matt on day 6, and that the duck meat was dark-colored and dry in meat quality and was contaminated with germs visible to the naked eye on day 12. The result shows that the image data at different time points also have difference, and the difference has certain correlation with the quality of the chilled duck meat.

(3) Measurement and analysis of physical and chemical indexes

The pH value of the sample is determined by referring to a meat product pH determination method in GB 5009.237-2016, and the TVB-N value is determined by referring to a semi-microscale nitrogen determination method in GB 5009.228-2016. After each spectrum and image data acquisition, a part of samples are cut for measuring physicochemical indexes, and the rest of samples are continuously preserved in cold and fresh.

Fig. 3 shows the change of physicochemical indexes of one random sample, and the result shows that the TVB-N value and the pH value of the chilled duck meat both have an increasing trend with the extension of the storage time. According to the national evaluation of the freshness grade of meat products, fresh meat: pH 5.8-6.2, TVB-N <15mg/100g, sub-fresh meat: pH 6.3-6.6, TVB-N15-25 mg/100g, putrid meat: pH >6.7, TVB-N >25mg/100 g. On this basis, the present study stipulates that if the sample TVB-N value and the pH range are not at the same freshness level, then it should be classified as a low freshness level (from the low principle). The physical and chemical values are analyzed to find that: fresh meat is taken for 0-4 days, sub-fresh meat is taken for 4-8 days, rotten meat is taken for 8-14 days, and the freshness of 168 samples is marked according to the cluster analysis result.

(4) Spectral and image data processing and characteristic variable construction

In order to construct the feature variables, the spectral and image data need to be processed separately. The spectral data is subjected to principal component analysis (realized by a princomp function in Matlab software), so that when the principal component (variable) is 1, the contribution rate reaches 97.2%, and therefore, the spectral data is subjected to principal component analysis to reduce the original 1557 principal components (determined by the resolution of the instrument) into data with only one principal component, wherein the variable is represented by P. And the multivariate data is subjected to dimensionality reduction through principal component analysis, and the data variable is greatly reduced under the condition of keeping most of original spectral data characteristics.

Processing of image data by color distance SnIt is shown that the image color obtained first is composed of three values of R (red), G (green), and B (blue), and the color distance can be obtained by the following formula:

wherein the color at initial (0h) is (R)0、G0、B0) The color value of the target sample is (R)n、Gn、Bn)。

The data are normalized by normalizing the image data (realized by a mapminmax function in Matlab software) to the spectral data, and then matrix merging is carried out on the spectral data after dimensionality reduction and color distance data to form a matrix with multiple rows and 2 columns, wherein the first column represents the spectral data, the second list represents the image data, and each row represents a sample. The finally constructed 168 sample characteristic variable matrixes X are represented as follows:

(5) establishment of duck freshness KNN model

The KNN (K-Nearest Neighbor) method, namely a K Nearest Neighbor method, finds out K samples ranked closest by calculating the distance between an unknown sample and a training sample and sorting according to the distance, and finally judges the category to which the freshness of the duck meat sample to be classified belongs according to the categories of the K samples, wherein the method is from Neighbor classification methods in python third party package scibit-lean. The accuracy of the model is affected by different K values, the fused feature matrix and the measured value are trained to obtain the KNN optimal model, and the accuracy of the K values and the model is shown in figure 4.

As can be seen from fig. 4, the accuracy is highest when the K value is 1, 2, or 3, and any one of them may be selected.

(6) Evaluation of optimal KNN model for duck freshness

When the model is built, the proportion of the training set to the prediction set of 168 samples is randomly distributed according to the ratio of 3:1, 126 is used for training the model in the step (5), and 42 are used as external verification sets for evaluating the model.

Fig. 5 shows the prediction result of the KNN optimal model on the freshness of duck meat, and shows that only 2 originally sub-fresh duck meat in 42 samples of the prediction set are identified as one fresh and one rotten duck meat, the identification accuracy rate reaches 95.24%, and the prediction effect is good.

Example 2

The results of predicting freshness of the set of samples based on the freshness of duck meat detected in example 1, compared to the detection method without fusion, are shown in table 2.

TABLE 2 comparison of detection methods for freshness of different duck meat

As can be seen from Table 2, the traditional freshness detection methods such as a semi-micro azotometry and a microbial counting method have the accuracy of 100%, but the whole detection process consumes a long time and is complex to operate, only can be used as a standard method in modeling, the requirement for quickly detecting freshness in the actual production process cannot be met, the near infrared and computer vision technologies can meet the requirement for quickly detecting, and the electronic tongue and the electronic nose can carry out quick detection, but sample change operation is required after a batch of samples are detected, certain time consumption exists, the requirement for continuous online detection cannot be met, the indicator card can carry out real-time freshness detection, but the indicator card is always disposable and needs to be in contact detection, and the accuracy is further improved, the invention integrates spectra and images to construct sample characteristic variables, and can meet online continuous detection, and the detection accuracy is higher than that of a single near infrared method or computer vision, and the method has great application potential in the aspects of production and processing intellectualization and digitization.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于光谱分析的材质分析方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!