Method and device for rapidly detecting authenticity of cod fillets based on hyperspectral imaging technology

The rapid detection of cod samples through hyperspectral imaging technology solves the destructive, time-consuming and professional problems of DNA-based fish authenticity detection in the prior art, and achieves a fast and non-destructive judgment of fish authenticity.

CN119492697APending Publication Date: 2025-02-21JIMEI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411326107.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

The existing DNA-based fish authenticity detection technology has destructive, time-consuming and professional problems, and is not suitable for quickly and without loss-making distinction between different fish.

Method used

Using the rapid detection method of authenticity of cod fillets based on hyperspectral imaging technology, linear discriminant analysis and random forest are constructed by collecting, pre-processing and analyzing the hyperspectral data of cod samples in frozen and thawed states. , qualitative model of partial least squares regression and K-neighboring algorithms to achieve rapid detection.

Benefits of technology

It realizes that the cod sample is quickly judged without destroying its authenticity, and the detection time is only a few seconds, and the authenticity of the cod can be qualitative.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119492697A_ABST
    Figure CN119492697A_ABST
Patent Text Reader

Abstract

The invention provides a rapid cod fillet authenticity detection method and device based on a hyperspectral imaging technology. The rapid cod fillet authenticity detection method comprises the following steps: preprocessing an obtained to-be-detected fish sample, and then performing cryopreservation; respectively collecting hyperspectral data of the fish sample in a frozen state and after unfreezing; extracting the spectrum of the region of interest of each fish, verifying the clustering effect of each fish by using a PCA clustering method, and calculating the contribution rate of three principal components under each wave band; preprocessing the representative spectral information of each fish, and jointly constructing a qualitative model of linear discriminant analysis, random forest, partial least squares regression and K-proximity algorithm by using the preprocessed spectral data and the category information of the fish, so as to predict the authenticity of the fish sample to be detected. And determining an optimal model in a freezing state and an unfreezing state for rapid detection. According to the method, the detection of the sample can be completed in several seconds, and meanwhile, the authenticity of the cod can be determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of food quality detection, and in particular relates to a method and device for rapid detection of the authenticity of cod fillets based on hyperspectral imaging technology. Background Art

[0002] Over the past few decades, China's demand for aquatic products has increased significantly, making it the world's largest consumer of fish. Cod is a nutritious, high-quality marine fish that is highly recommended for its tender and fresh taste.

[0003] In recent years, technologies such as loop-mediated isothermal amplification, DNA barcoding, liquid chromatography-mass spectrometry, enzyme-linked immunosorbent assay, CRISPR-Cas system, spectroscopy and electronic nose have been developed to accurately determine the authenticity of meat based on its species and composition. The most widely used DNA-based fish species identification technologies, such as real-time PCR, multiplex PCR, nuclear DNA barcoding and novel loop-mediated isothermal amplification, are currently in practice. However, these DNA-based technologies are destructive, time-consuming and specialized, and are not suitable for rapid and non-destructive differentiation of different fish species. Summary of the invention

[0004] In order to solve the problem that the DNA-based technology in the above-mentioned prior art is destructive, time-consuming and professional, and is not suitable for quickly and non-destructively distinguishing different fish, the present invention provides a method and device for rapid authenticity detection of cod fillets based on hyperspectral imaging technology. This method can achieve the goal of judging the authenticity of the cod without destroying it in practical applications. The sample detection can be completed in just a few seconds. At the same time, the authenticity of the cod can also be qualitatively determined to solve the above-mentioned technical defects.

[0005] In a first aspect, the present invention proposes a method for rapid authenticity detection of cod fillets based on hyperspectral imaging technology, the method comprising the following steps:

[0006] S1, pre-treating the obtained fish samples to be tested and freezing them;

[0007] S2, respectively collecting hyperspectral data of the fish samples in a frozen state and after thawing, and using image processing software to collect spectral information of the region of interest of each fish in the fish samples;

[0008] S3, further extracting the spectrum of the region of interest of each fish, taking the average spectrum to represent the representative spectrum information of each fish, using the PCA clustering method to verify the clustering effect of each fish, and calculating the contribution rate of the three principal components in each band; and

[0009] S4. Preprocess the representative spectral information of each fish, and use the preprocessed spectral data and the fish category information to jointly construct a qualitative model of linear discriminant analysis, random forest, partial least squares regression, and K-nearest neighbor algorithm to predict the authenticity of the fish samples to be tested, and determine the best model in the frozen state and the thawed state for rapid detection.

[0010] Preferably, the collecting of hyperspectral data of the fish sample in a frozen state and after thawing respectively comprises collecting the hyperspectral data of the fish sample by a hyperspectral imaging device, and the parameter setting of the hyperspectral imaging device comprises:

[0011] The spectral resolution of the visible-near infrared (VIS-NIR) system is 2.8 nm, the resolution is 1600 × 1100 CCD camera, the exposure time is set to 90 ms, the movement speed of the sample stage is 8.3 mm / s, and the image resolution is 1604 × 605 pixels;

[0012] The spectral resolution of the short-wave infrared SW-IR system is 4nm, the resolution of the camera and camera lens is 640×512, and the image resolution is 640×459pixel.

[0013] Further preferably, the hyperspectral data of the fish sample collected by the hyperspectral imaging instrument includes:

[0014] The fish fillet sample to be tested is placed on a mobile platform and aligned with the camera; when the platform moves, the spectral information of a line of the spatial position of the fish sample in the entire spectral region is obtained by the hyperspectral imager; then the fish sample is driven to move by the platform to obtain the spectral information of the fish sample at other positions until the complete spectral information of the sample is obtained.

[0015] Further preferably, the method further includes: using a black-and-white correction method to eliminate the interference of noise on the spectral information, and the black-and-white correction formula is:

[0016]

[0017] Among them, the corrected reflectance hyperspectral image I is expressed in units of relative reflectance (%); Rb represents the original hyperspectral image; I0 is a dark image with 0% reflectance, and Rw is a white reference image with 100% reflectance.

[0018] Preferably, the preprocessing of the representative spectral information of each fish comprises:

[0019] The hyperspectral imager collects data in a dark box, and uses five methods, namely, standard normal variable transformation SNV, first-order derivative, second-order derivative, multivariate scatter correction MSC and normalization Norm, to preprocess the original spectral data.

[0020] Preferably, the pre-processed spectral data and the fish category information are used together to construct a qualitative model of linear discriminant analysis, random forest, partial least squares regression, and K-nearest neighbor algorithm to predict the authenticity of the fish sample to be tested, specifically including:

[0021] The linear discriminant analysis algorithm is used to maximize the mean between classes and minimize the variance within classes. The original data is processed by PCA clustering method for dimensionality reduction. The principal component scores of the training data are stored in PC1, and the principal component scores of the test set are stored in PC2. Different vertical principal components are selected from 1 to 15 as data for model training, and the classify function is used for classification calculation.

[0022] Use the random forest algorithm to find the impact of the optimal number of decision trees on performance. Start with 50, with a step size of 50, and gradually increase the number of trees until 1000. Determine that the optimal number of decision trees is 100;

[0023] The partial least squares regression algorithm uses PLS to perform projection analysis on the data structure, and uses 20 principal components to evaluate the performance and number of components required for the final model; the 5-fold cross-validation is repeated 10 times to evaluate, and the best number of principal components is selected as 15; regression prediction is performed on the data, and then the round function is used to limit the range of the predicted values;

[0024] The K-nearest neighbor algorithm is used to calculate the distance between the prediction set sample and each sample in the training set. The k samples with the closest distance are taken, where K is 1-10, and the results of each K value are calculated cyclically. When the K value is 3, the prediction effect is best.

[0025] Preferably, after step S4, the method further includes:

[0026] S5. Use two variable screening algorithms, the continuous projection algorithm SPA and the variable combination population analysis-iterative elimination interval randomization algorithm VCPA-IRIV, to perform feature selection, and remodel the selected bands to simplify the prediction model and improve the robustness of the model.

[0027] Preferably, the fish sample to be tested includes one or more of Atlantic cod, oily fish, silver cod and Greenland halibut.

[0028] Further preferably, Atlantic cod, oil fish, silver cod and Greenland halibut are selected as fish samples for pretreatment, including:

[0029] Cut the four kinds of fish fillets into the size of 4 cm × 3 cm × 1 cm in length, width and height, put them into sterile bags and freeze them in a -18℃ refrigerator for 24 h;

[0030] After freezing for 24 hours, collect the hyperspectral data of the Vis-NIR system at 400-1000nm and the SW-IR system at 900-1700nm. After completion, thaw in a 4℃ refrigerator for 24 hours.

[0031] Hyperspectral data were collected in the 400-1000nm band of the Vis-NIR system and the 900-1700nm band of the SW-IR system 24 hours after thawing.

[0032] In a second aspect, an embodiment of the present invention provides a rapid detection device for authenticity of cod fillets based on hyperspectral imaging technology, comprising:

[0033] A pre-processing module, configured to pre-process the obtained fish samples to be tested and then freeze them for storage;

[0034] A hyperspectral acquisition module is configured to respectively acquire hyperspectral data of the fish sample in a frozen state and after thawing, and to acquire spectral information of an area of ​​interest of each fish in the fish sample using image processing software;

[0035] The clustering module is configured to further extract the spectrum of the area of ​​interest of each fish, take the average spectrum to represent the representative spectrum information of each fish, use the PCA clustering method to verify the clustering effect of each fish, and calculate the contribution rate of the three principal components in each band;

[0036] The model building module is configured to preprocess the representative spectral information of each fish, and jointly construct a qualitative model of linear discriminant analysis, random forest, partial least squares regression, and K-nearest neighbor algorithm with the preprocessed spectral data and the category information of the fish, so as to predict the authenticity of the fish samples to be tested, and determine the best model in the frozen state and the thawed state for rapid detection.

[0037] Compared with the prior art, the beneficial results of the present invention are:

[0038] The invention pre-processes the cod sample, collects the hyperspectral data of the cod in the Vis-NIR (400-1000nm) and SWIR (900-1700nm) bands in the frozen state, and collects the hyperspectral data of the cod in the Vis-NIR (400-1000nm) and SWIR (900-1700nm) bands after thawing for 24 hours. The obtained hyperspectral data is corrected for black and white, and the spectra of all pixels in the region of interest are collected using ENVI, and the average is taken to represent a sample. The spectral data were preprocessed and PCA cluster analysis was performed. The contribution rate of each band to the three principal components of the PCA clustering effect was calculated. Linear discriminant analysis, random forest, partial least squares regression, and K-nearest neighbor algorithm qualitative models were constructed to obtain the best model effects in the Vis-NIR and SWIR bands in the frozen and thawed states. This ensures that the authenticity of the cod can be judged in practical applications without destroying it. The sample detection can be completed in just a few seconds, and the authenticity of the cod can also be qualitatively determined. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present invention. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.

[0040] Figure 1 It is a schematic diagram of the process of a method for rapid authenticity detection of cod fillets based on hyperspectral imaging technology according to an embodiment of the present invention;

[0041] Figure 2 is a schematic structural diagram of a spectral imaging system according to an embodiment of the present invention;

[0042] Figure 3 Variable distribution diagram of SPA and VCPA-IRIV screening of the embodiment of the present invention;

[0043] Figure 4 It is a PCA cluster diagram of two sample states in the Vis-NIR and SWIR bands of an embodiment of the present invention;

[0044] Figure 5 Schematic diagram of a rapid detection device for authenticity of cod fillets based on hyperspectral imaging technology according to an embodiment of the present invention; DETAILED DESCRIPTION

[0045] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0046] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0047] Figure 1 It is shown that the embodiment of the present invention discloses a method for rapid authenticity detection of cod fillet based on hyperspectral imaging technology, such as Figure 1 As shown, the method comprises the following steps:

[0048] S1, pre-treating the obtained fish samples to be tested and freezing them;

[0049] Specifically, the fish samples to be tested include one or more of Atlantic cod, oil fish, silver cod and Greenland flounder. In this embodiment, Atlantic cod, oil fish, silver cod and Greenland flounder are selected as samples.

[0050] S2, respectively collecting hyperspectral data of the fish samples in a frozen state and after thawing, and using image processing software to collect spectral information of the region of interest of each fish in the fish samples;

[0051] S3, further extracting the spectrum of the region of interest of each fish, taking the average spectrum to represent the representative spectrum information of each fish, using the PCA clustering method to verify the clustering effect of each fish, and calculating the contribution rate of the three principal components in each band; and

[0052] Specifically, in this embodiment, the ENVI software is used to select a 100*100 pixel square area in the center of the fish fillet as the region of interest. ENVI is a powerful remote sensing image processing software that has a wide range of applications in the field of remote sensing image processing and analysis, providing users with powerful tools and functions to help users extract valuable information from remote sensing data.

[0053] S4. Preprocess the representative spectral information of each fish, and use the preprocessed spectral data and the fish category information to jointly construct a qualitative model of linear discriminant analysis, random forest, partial least squares regression, and K-nearest neighbor algorithm to predict the authenticity of the fish samples to be tested, and determine the best model in the frozen state and the thawed state for rapid detection.

[0054] It also includes: S5, using two variable screening algorithms, the continuous projection algorithm SPA and the variable combination population analysis-iterative elimination interval randomization algorithm VCPA-IRIV, to perform feature selection, and remodel the selected bands to simplify the prediction model and improve the robustness of the model.

[0055] SPA (Successive Projections Algorithm) and VCPA-IRIV (Variable Combination Population Analysis-Interval Randomization of Iterative Elimination) are two algorithms for variable screening, which can simplify the model and improve the robustness of the model.

[0056] The SPA algorithm continuously selects projection vectors to minimize the collinearity between the selected variables, thereby screening out representative variables. The algorithm is simple to calculate and can effectively reduce the number of variables and the complexity of the model.

[0057] The VCPA-IRIV algorithm is a screening method based on variable combination and interval randomization. It randomly combines variable intervals and iteratively eliminates them according to certain criteria, ultimately screening out variables that contribute more to the model. This algorithm can take into account the interaction between variables and improve the accuracy and robustness of the model.

[0058] By using these variable screening algorithms, redundant or irrelevant variables can be removed, reducing the amount of model calculations and the risk of overfitting, while improving the stability and generalization ability of the model under different data sets and conditions. This can make the model more concise and efficient, and better able to cope with various situations in practical applications.

[0059] The present invention proposes a method for rapidly detecting the authenticity of cod, which constructs a suitable qualitative model based on the spectral data and species information of four common "cods", and determines the performance of the model in the frozen state and the thawed state. In practical applications, there is no need to pre-treat and destroy the cod to be detected, and no pollution is generated, so as to achieve the effect of rapid detection.

[0060] Specifically, in this embodiment, Atlantic cod, oil fish, silver cod, and Greenland flounder are selected as samples for pretreatment, and the steps include:

[0061] 1. Cut the four kinds of fish fillets into 4cm×3cm×1cm (length×width×height) size, put them into sterile bags and freeze them in a -18℃ refrigerator for 24h;

[0062] 2. Collect hyperspectral data in the Vis-NIR (400-1000nm) and SW-IR (900-1700nm) bands after freezing for 24 hours, and then thaw in a 4°C refrigerator for 24 hours;

[0063] 3. Collect hyperspectral data in the Vis-NIR (400-1000nm) and SW-IR (900-1700nm) bands 24 hours after thawing;

[0064] 4. Use the software ENVI 5.3 to extract the spectral values ​​of all pixels in the region of interest of the fish fillet hyperspectral data, and take the average to represent a sample.

[0065] 5. Use different preprocessing methods to preprocess the spectral values ​​of the original spectrum in the extracted hyperspectral image, remove redundant information and noise, and obtain preprocessed spectral data;

[0066] 6. Use the preprocessed spectra to perform PCA cluster analysis and calculate the band contribution rates of the three principal component scores;

[0067] 7. Divide the spectral data of the 455 samples collected into a training set and a prediction set;

[0068] 8. Use the divided training set to construct a qualitative model for distinguishing true and false cod fillets;

[0069] 9. Use SPA and VCPA-IRIV algorithms to simplify the model and improve model efficiency.

[0070] In another specific embodiment, Figure 2 In a specific embodiment of the present invention, a hyperspectral imaging instrument is used to collect clear hyperspectral images. The parameters of the instrument are set. The steps include:

[0071] 1. The spectral resolution of the VIS-NIR system is 2.8nm, the resolution is 1600×1100 CCD camera, the exposure time is set to 90ms, the moving speed of the translation stage is 8.3mm / s, and the image resolution is 1604×605pixel;

[0072] 2. The spectral resolution of the SW-IR system is 4nm, the resolution of the camera and camera lens is 640×512, and the image resolution is 640×459pixel;

[0073] 3. The hyperspectral imaging system is susceptible to uneven illumination and dark current during the spectral image acquisition process, resulting in large noise in the acquired spectral image information. The black and white correction method can effectively eliminate the interference of noise on the spectral information. The black and white correction formula is:

[0074]

[0075] Among them, the corrected reflectance hyperspectral image I is expressed in units of relative reflectance (%); Rb represents the original hyperspectral image; I0 is a dark image (0% reflectance), and Rw is a white reference image (100% reflectance).

[0076] Specifically, the specific method for collecting hyperspectral images is as follows: place the cod fillet to be tested on a mobile platform and align it with the camera. When the platform moves, the hyperspectral imager obtains the spectral information of a line of the cod's spatial position in the entire spectral region, and then drives the cod fillet to move through the platform to obtain the spectral information of the cod fillet at other positions until the complete spectral information of the sample is obtained.

[0077] The moving speed of the sample stage in the VIS-NIR spectral imaging system is 8.3 mm / s, the exposure time is set to 90 ms, and the image resolution is 1604×605 pixels; because the spectral scanning range is 678 effective wavelengths in the 400-1000 nm band, the size of the two-dimensional data block finally obtained is 1604×605×678. The spectral resolution of the SW-IR spectral imager is 4 nm, and the camera and camera lens with a resolution of 640×512 have an image resolution of 640×459 pixels. Because the spectral scanning range is 678 effective wavelengths in the 400-1000 nm band, the size of the two-dimensional data block finally obtained is 640×459×512.

[0078] In another preferred embodiment, in order to eliminate the environmental noise of the hyperspectral data, such as the scattering effect caused by diffuse reflection, baseline shift, overlapping peaks, and the signal-to-noise ratio in the spectral data; the hyperspectral imager used in this experiment collects data in a dark box, and the original spectral data is preprocessed using five methods: standard normal variable transformation (SNV), first-order derivative, second-order derivative, multivariate scatter correction (MSC) and normalization (Norm). Reduce the error caused by human operation, improve the accuracy of spectral numerical acquisition, and ensure the rigor of data; use algorithms to eliminate background noise, optimize data, avoid errors caused by environmental noise, and improve the accuracy of the model.

[0079] The preprocessed spectral data were subjected to PCA cluster analysis, and four models were constructed, including linear discriminant analysis, random forest, partial least squares regression, and K-nearest neighbor algorithm. Table 1 shows the results of the five preprocessings at different bands under two states, and Table 2 shows the results of the best preprocessing of the four models in the full band; Table 3 shows the prediction results of the four models after SPA screening variables; Table 4 shows the prediction results of the four models after VCPA-IRIV screening variables.

[0080] Specifically, Linear Discriminant Analysis is a classic pattern recognition method used to project data into a low-dimensional space so that data of different categories can be separated as much as possible. The goal of LDA is to find an optimal projection direction so that in the projected space, the inter-class divergence is maximized and the intra-class divergence is minimized.

[0081] The core idea of ​​linear discriminant is to seek a method to maximize the mean between classes and minimize the variance within classes. The original data is processed by PCA dimensionality reduction, the principal component scores of the training data are stored in PC1, the principal component scores of the test set are stored in PC2, and different vertical principal components are selected from 1-15 as data for model training. Use the classify function for classification calculation.

[0082] RF (Random Forest) is an ensemble learning algorithm based on decision trees. It improves the accuracy and stability of the model by building multiple decision trees and synthesizing the prediction results of these decision trees. In a random forest, each decision tree is built by random sampling and feature selection of the training data. This can increase the diversity of the model and reduce the risk of overfitting. Random forest, first find the effect of the optimal number of decision trees on performance, starting from 50, with a step size of 50, and gradually increasing the number of trees until 1000. The optimal number of decision trees is determined to be 100.

[0083] Partial Least Squares Discriminant Analysis is a method that combines partial least squares regression and discriminant analysis. It is mainly used to solve the classification problem of multivariate data. It establishes a prediction model by finding a set of latent variables, and can handle the multicollinearity problem between variables. Partial least squares regression uses PLS to project the data structure and uses 20 principal components to evaluate the performance and number of components required for the final model. The evaluation is repeated 10 times with 5-fold cross validation, and the best number of principal components selected is 15. Regression prediction is performed on the data, and then the round function is used to limit the range of the predicted values.

[0084] The K-Nearest Neighbors algorithm is an instance-based learning method that calculates the distance between the test sample and the training sample, finds the K training samples closest to the test sample, and predicts the category of the test sample based on the category of these K samples. The KNN algorithm is simple and intuitive, but the amount of calculation is large and it is sensitive to the distribution and noise of the data. The K-Nearest Neighbors algorithm calculates the distance between the prediction set sample and each sample in the training set, and takes the k samples with the closest distance. K is 1-10, and the results of each K value are calculated cyclically. It is found that when the final K value is 3, the prediction effect is the best.

[0085] Table 1 Results of five pre-processing at different bands under two conditions

[0086]

[0087]

[0088] Table 2 Results of the best preprocessing of four models in the full band

[0089]

[0090] Table 3 Prediction results of four models after SPA screening variables

[0091]

[0092] Table 4 Prediction results of the four models after VCPA-IRIV screening variables

[0093]

[0094]

[0095] According to the above sample preprocessing, sample spectral information is obtained, data preprocessing is performed, and hyperspectral feature values, i.e., fish species information, are obtained and substituted into the established LDA, PF, KNN, and PLS-DA prediction models to obtain the prediction results of the authenticity of cod.

[0096] In another specific embodiment, Figure 3 This is a band screening area diagram in a specific embodiment of the present invention, based on the distribution of characteristic variables of the SPA and VCPA-IRIV algorithms in two sample states and two bands. In order to simplify the model and improve the efficiency of the model, SPA and VCPA-IRIV are used for feature selection, and the selected bands are remodeled.

[0097] in, Figure 3 (A) and (B) are frozen samples under Vis-NIR and SWIR bands; Figure 3(C) and (D) are the thawed samples under Vis-NIR band and SWIR band.

[0098] PCA (Principal Component Analysis) is a commonly used data analysis method used for data dimension reduction, feature extraction and cluster analysis. The three principal component contribution rates refer to the contribution of the principal component to the total variance, and are usually used to evaluate the importance of the principal component. The larger the principal component contribution rate, the greater the variance explained by the principal component and the greater the impact on the data.

[0099] Figure 4 The PCA clustering diagrams of two sample states in the Vis-NIR and SWIR bands. (A) and (D) are the PCA clustering results of the samples in the Vis-NIR and SWIR bands when they are frozen; (G) and (J) are the PCA clustering results of the samples in the Vis-NIR and SWIR bands when they are thawed; (B), (E), (H) and (K) are the best pretreatment results of (A), (D), (G) and (J) respectively; (C), (F), (I) and (L) are the PCA loading diagrams corresponding to the PCA results of (A), (D), (G) and (J) respectively.

[0100] The invention pre-processes the cod sample, collects the hyperspectral data of the cod in the Vis-NIR (400-1000nm) and SWIR (900-1700nm) bands in the frozen state, and collects the hyperspectral data of the cod in the Vis-NIR (400-1000nm) and SWIR (900-1700nm) bands after thawing for 24 hours. The obtained hyperspectral data is corrected for black and white, and the spectra of all pixels in the region of interest are collected using ENVI, and the average is taken to represent a sample. The spectral data were preprocessed and PCA cluster analysis was performed. The contribution rate of each band to the three principal components of the PCA clustering effect was calculated. Linear discriminant analysis, random forest, partial least squares regression, and K-nearest neighbor algorithm qualitative models were constructed to obtain the best model effects in the Vis-NIR and SWIR bands in the frozen and thawed states. This ensures that the authenticity of the cod can be judged in practical applications without destroying it. The sample detection can be completed in just a few seconds, and the authenticity of the cod can also be qualitatively determined.

[0101] In a second aspect, the present invention also discloses a rapid detection device for authenticity of cod fillets based on hyperspectral imaging technology. Figure 5 As shown, it includes: a preprocessing module 51, a hyperspectral acquisition module 52, a clustering module 53 and a model building module 54.

[0102] In a specific embodiment, the preprocessing module 51 is configured to freeze and store the obtained fish samples for detection after preprocessing; the hyperspectral acquisition module 52 is configured to respectively collect the hyperspectral data of the fish samples in the frozen state and after thawing, and use the image processing software to collect the spectral information of the region of interest of each fish in the fish samples; the clustering module 53 is configured to further extract the spectrum of the region of interest of each fish, respectively take the average spectrum to represent the representative spectral information of each fish, use the PCA clustering method to verify the clustering effect of each fish, and calculate the contribution rate of the three principal components under each band;

[0103] The model building module 54 is configured to preprocess the representative spectral information of each fish, and jointly construct a qualitative model of linear discriminant analysis, random forest, partial least squares regression, and K-nearest neighbor algorithm with the preprocessed spectral data and the category information of the fish, so as to predict the authenticity of the fish samples to be tested, and determine the best model in the frozen state and the thawed state for rapid detection.

[0104] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) to form a technical solution.

Claims

1. A method for rapid authenticity detection of cod fillets based on hyperspectral imaging technology, characterized in that: The method comprises the following steps: S1, pre-treating the obtained fish samples to be tested and freezing them; S2, respectively collecting hyperspectral data of the fish samples in a frozen state and after thawing, and using image processing software to collect spectral information of the region of interest of each fish in the fish samples; S3, further extracting the spectrum of the region of interest of each fish, taking the average spectrum to represent the representative spectrum information of each fish, using the PCA clustering method to verify the clustering effect of each fish, and calculating the contribution rate of the three principal components in each band; and S4. Preprocess the representative spectral information of each fish, and use the preprocessed spectral data and the fish category information to jointly construct a qualitative model of linear discriminant analysis, random forest, partial least squares regression, and K-nearest neighbor algorithm to predict the authenticity of the fish samples to be tested, and determine the best model in the frozen state and the thawed state for rapid detection.

2. The method for rapid authenticity detection of cod fillets based on hyperspectral imaging technology according to claim 1 is characterized in that: The collecting of hyperspectral data of the fish samples in a frozen state and after thawing respectively comprises collecting the hyperspectral data of the fish samples by a hyperspectral imaging device, and the parameter setting of the hyperspectral imaging device comprises: The spectral resolution of the visible-near infrared (VIS-NIR) system is 2.8 nm, the resolution is 1600 × 1100 CCD camera, the exposure time is set to 90 ms, the movement speed of the sample stage is 8.3 mm / s, and the image resolution is 1604 × 605 pixels; The spectral resolution of the short-wave infrared SW-IR system is 4nm, the resolution of the camera and camera lens is 640×512, and the image resolution is 640×459pixel.

3. The method for rapid authenticity detection of cod fillets based on hyperspectral imaging technology according to claim 2 is characterized in that: The hyperspectral data collected by the hyperspectral imaging instrument for fish samples include: The fish fillet sample to be tested is placed on a mobile platform and aligned with the camera; when the platform moves, the spectral information of a line of the spatial position of the fish sample in the entire spectral region is obtained by the hyperspectral imager; then the fish sample is driven to move by the platform to obtain the spectral information of the fish sample at other positions until the complete spectral information of the sample is obtained.

4. The method for rapid authenticity detection of cod fillets based on hyperspectral imaging technology according to claim 3 is characterized in that: It also includes: using the black and white correction method to eliminate the interference of noise on spectral information. The black and white correction formula is: Among them, the corrected reflectance hyperspectral image I is expressed in units of relative reflectance (%); Rb represents the original hyperspectral image; I0 is a dark image with 0% reflectance, and Rw is a white reference image with 100% reflectance.

5. The method for rapid authenticity detection of cod fillets based on hyperspectral imaging technology according to claim 1, characterized in that: The preprocessing of the representative spectral information of each fish comprises: The hyperspectral imager collects data in a dark box, and uses five methods, namely, standard normal variable transformation SNV, first-order derivative, second-order derivative, multivariate scatter correction MSC and normalization Norm, to preprocess the original spectral data.

6. The method for rapid authenticity detection of cod fillets based on hyperspectral imaging technology according to claim 1, characterized in that: The pre-processed spectral data and the fish category information are used together to construct a qualitative model of linear discriminant analysis, random forest, partial least squares regression, and K-nearest neighbor algorithm to predict the authenticity of the fish sample to be tested, specifically including: The linear discriminant analysis algorithm is used to maximize the mean between classes and minimize the variance within classes. The original data is processed by PCA clustering method for dimensionality reduction. The principal component scores of the training data are stored in PC1, and the principal component scores of the test set are stored in PC2. Different vertical principal components are selected from 1 to 15 as data for model training, and the classify function is used for classification calculation. Use the random forest algorithm to find the impact of the optimal number of decision trees on performance. Start with 50, with a step size of 50, and gradually increase the number of trees until 1000. Determine that the optimal number of decision trees is 100; The partial least squares regression algorithm uses PLS to perform projection analysis on the data structure, and uses 20 principal components to evaluate the performance and number of components required for the final model; the 5-fold cross-validation is repeated 10 times to evaluate, and the best number of principal components is selected as 15; regression prediction is performed on the data, and then the round function is used to limit the range of the predicted values; The K-nearest neighbor algorithm is used to calculate the distance between the prediction set sample and each sample in the training set. The k samples with the closest distance are taken, where K is 1-10, and the results of each K value are calculated cyclically. When the K value is 3, the prediction effect is best.

7. The method for rapid authenticity detection of cod fillets based on hyperspectral imaging technology according to claim 1, characterized in that: After step S4, the method further includes: S5. Use two variable screening algorithms, the continuous projection algorithm SPA and the variable combination population analysis-iterative elimination interval randomization algorithm VCPA-IRIV, to perform feature selection, and remodel the selected bands to simplify the prediction model and improve the robustness of the model.

8. The method for rapid authenticity detection of cod fillets based on hyperspectral imaging technology according to claim 1, characterized in that: The fish sample to be tested includes one or more of Atlantic cod, oil fish, silver cod and Greenland halibut.

9. The method for rapid authenticity detection of cod fillets based on hyperspectral imaging technology according to claim 8, characterized in that: Atlantic cod, oil fish, silver cod and Greenland halibut were selected as fish samples for pretreatment, including: Cut the four kinds of fish fillets into the size of 4 cm × 3 cm × 1 cm in length, width and height, put them into sterile bags and freeze them in a -18℃ refrigerator for 24 h; After freezing for 24 hours, collect the hyperspectral data of the Vis-NIR system at 400-1000nm and the SW-IR system at 900-1700nm. After completion, thaw in a 4℃ refrigerator for 24 hours. Hyperspectral data were collected in the 400-1000nm band of the Vis-NIR system and the 900-1700nm band of the SW-IR system 24 hours after thawing.

10. A rapid detection device for authenticity of cod fillet based on hyperspectral imaging technology, characterized in that: include: A pre-processing module, configured to pre-process the obtained fish samples to be tested and then freeze them for storage; A hyperspectral acquisition module is configured to respectively acquire hyperspectral data of the fish sample in a frozen state and after thawing, and to acquire spectral information of an area of ​​interest of each fish in the fish sample using image processing software; The clustering module is configured to further extract the spectrum of the area of ​​interest of each fish, take the average spectrum to represent the representative spectrum information of each fish, use the PCA clustering method to verify the clustering effect of each fish, and calculate the contribution rate of the three principal components in each band; The model building module is configured to preprocess the representative spectral information of each fish, and jointly construct a qualitative model of linear discriminant analysis, random forest, partial least squares regression, and K-nearest neighbor algorithm with the preprocessed spectral data and the category information of the fish, so as to predict the authenticity of the fish samples to be tested, and determine the best model in the frozen state and the thawed state for rapid detection.