Nondestructive detection method and system for meat freshness based on improved deep forest algorithm
By improving the deep forest algorithm, a deep forest model of multi-level cascaded freshness evaluation was constructed, which solved the problem of strong subjectivity, complex detection and sample damage in the freshness detection of mutton, and achieved a fast and non-destructive detection effect.
Patent Information
- Application Number
- CN202211153105.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-21
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-09-21
AI Technical Summary
The prior art has the problem of strong subjectivity, complex detection process and requiring sample damage in the detection of mutton freshness, making it difficult to achieve fast and non-destructive detection.
The improved deep forest algorithm is used to construct a multi-level cascaded deep forest model for freshness evaluation, and non-destructive detection of meat freshness is achieved through spectral image preprocessing and feature screening.
It realizes rapid and non-destructive testing of meat freshness, reduces the complexity of the testing process, and improves the accuracy and reliability of the testing results.
Smart Images

Figure CN115482528B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of meat freshness detection, and in particular to a meat freshness non-destructive detection method and system based on an improved deep forest algorithm. Background Art
[0002] Mutton has become an important part of people's diet because of its rich nutrients. The management and monitoring of mutton quality has also received great attention. The quality of mutton will be affected by the interaction of its own ingredients, storage environment and microorganisms, which will cause corruption and deterioration, which will have a great impact on the quality and safety of mutton food, making mutton freshness detection one of the important contents of meat food monitoring and management. The traditional detection methods of mutton quality are mainly sensory evaluation and laboratory testing. Sensory testing analyzes the color, smell and tenderness of the sample through vision, smell and shear force to judge the freshness, but it is greatly affected by subjective influences and lacks accurate judgment of the changes in the internal components of the sample; laboratory testing can analyze the internal components of the sample, but the operation is complicated, the experimental cycle is long, and the sample needs to be destroyed, which makes it difficult to achieve rapid detection. Summary of the invention
[0003] The present invention provides a method and system for nondestructive detection of meat freshness based on an improved deep forest algorithm, and realizes nondestructive detection of meat freshness by constructing a multi-layer cascade freshness evaluation deep forest model for chilled fresh mutton.
[0004] The present invention provides a non-destructive detection method for meat freshness based on an improved deep forest algorithm, comprising:
[0005] Obtain spectral images of meat;
[0006] Preprocessing the meat spectral image;
[0007] The preprocessed spectral image is input into a pre-built multi-layer cascade freshness evaluation deep forest model to obtain the meat freshness detection result; wherein, a previous layer of candidate feature screening and layer growth control mechanism is added between each layer of the deep forest model.
[0008] Specifically, the preprocessing of the meat spectral image includes:
[0009] The meat spectral image is subjected to SG smoothing filtering and multivariate scattering correction processing.
[0010] Specifically, the feature screening calculates the confidence of each layer of random forest output according to different metrics; by comparing the confidence, the features are reassembled and input into the next layer.
[0011] Specifically, the layer growth control mechanism includes:
[0012] When the output H of the tth layer of the deep forest model is obtained through the feature screening t After that, the metric value q[t] of the layer is calculated according to the metric index M; if q[t] is greater than the metric value q with the best performance best , then update q best value; if q[t] is less than q three times in a row best If t is within the maximum depth T of the model, the layer growth is stopped, while retaining the layers including q best The layer and all the layers before it, and delete all the layers after it.
[0013] The present invention also provides a non-destructive detection system for meat freshness based on an improved deep forest algorithm, comprising:
[0014] A spectral image acquisition module, used for acquiring spectral images of meat;
[0015] A spectral image preprocessing module, used for preprocessing the meat spectral image;
[0016] The freshness evaluation module is used to input the preprocessed spectral image into a pre-built multi-layer cascade freshness evaluation deep forest model to obtain the meat freshness detection result; wherein, the previous layer of candidate feature screening and layer growth control mechanism is added between each layer of the deep forest model.
[0017] Specifically, the spectral image preprocessing module is used to perform SG smoothing filtering and multivariate scattering correction processing on the meat spectral image.
[0018] Specifically, the feature screening calculates the confidence of each layer of random forest output according to different metrics; by comparing the confidence, the features are reassembled and input into the next layer.
[0019] Specifically, the layer growth control mechanism includes:
[0020] When the output H of the tth layer of the deep forest model is obtained through the feature screening t After that, the metric value q[t] of the layer is calculated according to the metric index M; if q[t] is greater than the metric value q with the best performance best , then update q best value; if q[t] is less than q three times in a row best If t is within the maximum depth T of the model, the layer growth is stopped, while retaining the layers including q best The layer and all the layers before it, and delete all the layers after it.
[0021] One or more technical solutions provided in the present invention have at least the following technical effects or advantages:
[0022] The present invention constructs a layer-by-layer multi-layer cascade deep forest model. The input of the first layer of random forest in the model is consistent with the input of the model, which is the pre-processed hyperspectral imaging data of chilled fresh mutton samples. Different candidate feature spaces are formed through calculation. To ensure the original features, they are spliced with the pre-processed sample hyperspectral data as the input of the next layer. The output of the model is the freshness level probability. In order to fully explore the correlation of multiple freshness evaluation indicators, the previous layer of candidate feature screening and layer growth control mechanism is added between each layer of the deep forest. While fully exploring the correlation of multiple freshness indicators of the sample, the number of layers of the model is determined to reduce the risk of model overfitting, thereby achieving the purpose of controlling the complexity of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A flowchart of a non-destructive detection method for meat freshness based on an improved deep forest algorithm provided in an embodiment of the present invention;
[0024] Figure 2 It is a feature screening diagram in an embodiment of the present invention;
[0025] Figure 3 A module diagram of a nondestructive meat freshness detection system based on an improved deep forest algorithm provided in an embodiment of the present invention;
[0026] Figure 4 These are photos of chilled mutton samples at various freshness levels in the embodiments of the present invention;
[0027] Figure 5 It is a curve diagram of the DN value of the original spectrum of the experimental sample in the embodiment of the present invention;
[0028] Figure 6 is a spectral reflectance curve diagram after preprocessing in an embodiment of the present invention;
[0029] Figure 7 Extract characteristic band curve graph in the embodiment of the present invention;
[0030] Figure 8 This is a labeled diagram of a chilled fresh mutton sample in an embodiment of the present invention;
[0031] Fig. 9 This is a classification result diagram of the deep forest model in an embodiment of the present invention on the training set;
[0032] Fig.10 This is a diagram of the classification results of the deep forest model in an embodiment of the present invention on the test set. DETAILED DESCRIPTION
[0033] The embodiment of the present invention provides a method and system for nondestructive detection of meat freshness based on an improved deep forest algorithm, and realizes nondestructive detection of meat freshness by constructing a multi-layer cascade freshness evaluation deep forest model for chilled fresh mutton.
[0034] The technical solution in the embodiment of the present invention is to achieve the technical effect, and the overall idea is as follows:
[0035] 1) First, the chilled mutton samples were divided into three groups of samples, corresponding to the determination of physical and chemical test indicators, the determination of microbial test indicators and the collection of hyperspectral imaging data as test samples.
[0036] 2) A group of fresh mutton samples were selected to determine the physical and chemical test indicators TVB-N and pH. The TVB-N content of the samples was determined by the semi-micro Kjeldahl method, and the pH of the samples was detected using the non-averaged sample determination method.
[0037] 3) Select one group from the other two groups of mutton samples to determine the microbial test indicators TAC and ANC, and use the standard value of the total colony count per unit mass to determine the TAC content of the sample, and use the approximate number of Escherichia coli per unit mass to determine the ANC content of the sample.
[0038] 4) Select the last group of mutton samples, use hyperspectral imaging technology to collect the hyperspectral reflectance image of each sample at a wavelength of 400-1000 nm and generate a BIL file.
[0039] 5) Use ENVI software to open the BIL file to view the image, select the region of interest, extract the spectral reflectance curves of the N samples respectively, and calculate and save the pixel grayscale values of the sample hyperspectral image within the region of interest.
[0040] 6) The saved raw spectral data of mutton were preprocessed, and the noise in the raw spectral data was eliminated by SG smoothing filtering method, and the baseline offset was eliminated by multivariate scattering correction method.
[0041] 7) The characteristic bands are extracted from the preprocessed spectral data using the continuous projection method, and a multi-layer cascade freshness evaluation deep forest model is established based on the freshness evaluation index corresponding to each sample.
[0042] 8) The performance of the multi-layer cascade freshness evaluation deep forest model is evaluated based on the multi-label evaluation indicators hamming loss, one-error, ranking loss and macro-AUC.
[0043] 9) The extracted spectral data is input into the multi-layer cascade freshness evaluation deep forest model for freshness evaluation.
[0044] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0045] See also Figure 1 The nondestructive detection method for meat freshness based on the improved deep forest algorithm provided by the embodiment of the present invention includes:
[0046] Step S110: Acquire a meat spectral image;
[0047] Step S120: preprocessing the meat spectral image;
[0048] This step is specifically described to pre-process the meat spectral image, including:
[0049] The meat spectral image is processed with SG smoothing filter and multivariate scattering correction.
[0050] Step S130: input the preprocessed spectral image into a pre-built multi-layer cascade freshness evaluation deep forest model to obtain the meat freshness detection result; wherein, between each layer of the deep forest model, a previous layer of candidate feature screening and layer growth control mechanism is added.
[0051] Specifically, feature screening calculates the confidence of each layer of random forest output according to different metrics; by comparing the confidence, the features are reassembled and input into the next layer.
[0052] To be more specific, assume that the output of each layer in the deep forest model is H t , which is obtained by concatenating the outputs of several forests, and the number of forests is used to calculate H t The average value is used to obtain the prediction probability matrix P of this layer. The number of rows of P is the number of samples, and the number of columns of P is the number of tags. When the metric is based on instances, sort the elements of each row of the matrix P from large to small; when the metric is based on tags, sort the elements of each column of the matrix P from large to small.
[0053] Hamming loss is used to determine whether the classification on P is correct. Assuming the threshold θ = 0.5, if p ij >0.5, the prediction result is 1. The larger the value, the greater the probability that the prediction is 1, so the confidence level is greater. ij ≤0.5, the prediction result is 0. The smaller the value, the greater the probability of the prediction being 0, so the greater the confidence. Therefore, the Hamming loss confidence α j It can be defined as:
[0054]
[0055] Where N is the number of samples, pij The model predicts the probability of the i-th sample on the j-th label,
[0056] One-error is used to determine the maximum probability of prediction in the relevant mark, so the one-error confidence can be defined as the maximum probability value of prediction:
[0057] α i =max p ij
[0058] Ranking loss is used to determine the order of all labels of a sample. When Ranking loss is 0, the model performs best. Therefore, when defining confidence, it is necessary to list various combinations when Ranking loss is 0. If there are 4 labels, there are five possible combinations: {0000, 1000, 1100, 1110, 1111}. The Ranking loss confidence is obtained by calculating the sum of the probabilities of these combinations.
[0059]
[0060] Where Q is the total number of markers, p ik The model predicts the probability of the i-th sample at the k-th label.
[0061] Macro-AUC is used to determine the order of all samples on the label. Similar to Ranking loss, when Macro-AUC is 1, the model performance is optimal. Therefore, when defining the confidence, it is necessary to list various combinations when Macro-AUC is 1, calculate the sum of the probabilities of these combinations, and obtain the Macro-AUC confidence:
[0062]
[0063] Where N is the number of samples, p kj The model predicts the probability of the kth sample at the jth label.
[0064] The features are screened by confidence level. Table 1 shows the feature screening process.
[0065] surface 1 Feature Screening Process
[0066]
[0067]
[0068] Assume that the training set is X, the labeled set is Y, a metric M is specified, and the random forest output of the tth layer is H t , the measurement value is The threshold of the tth layer is θ t . t The value of G is assigned t , G t Used to represent a new set of features. If the metric is based on labeling, then for all instances of a certain label, its confidence is calculated If the metric is instance-based, then for all labels of an instance, its confidence is calculated If the confidence is less than the threshold θ t , then G t The corresponding elements in are replaced by the feature representation G of the previous layer t-1 The corresponding elements in Figure 2 shown.
[0069] According to the output of the forest H t The metric value of the current layer is calculated based on the label set Y. When calculating the metric value, the instance-based metric and the label-based metric need to be calculated separately. The threshold of each layer will be determined by the metric value and confidence of the layer. If the metric value on the feature of the current layer is less than the metric value on the feature of the previous layer, the confidence on the feature of the current layer is stored in the set S. Finally, the average confidence in S is taken as the threshold of the current layer.
[0070] Layer growth control mechanisms, including:
[0071] For each group of data, the data of all other groups are used for training, and the current group of data is predicted. Table 2 shows the layer growth control process, assuming that the maximum depth of the deep forest model is T, the training set is X, the label set is Y, the metric is M, and the array q containing the metric value of each layer, where the metric value with the best performance is defined as q best When the output H of the tth layer of the deep forest model is obtained through feature screening t After that, the metric value q[t] of the layer is calculated according to the metric index M; if q[t] is greater than the metric value q with the best performance best , then update q best value; if q[t] is less than q three times in a row best If t is within the maximum depth T of the model, the layer growth is stopped, while retaining the layers including q best The layer and all the layers before it, and delete all the layers after it.
[0072] Table 2 Layer growth control process
[0073]
[0074]
[0075] See also Figure 3, the meat freshness nondestructive detection system based on the improved deep forest algorithm provided by the embodiment of the present invention includes:
[0076] The spectral image acquisition module 100 is used to acquire the spectral image of meat;
[0077] A spectral image preprocessing module 200, used for preprocessing the meat spectral image;
[0078] Specifically, the spectral image preprocessing module 200 is specifically used to perform SG smoothing filtering and multivariate scattering correction processing on the meat spectral image.
[0079] The freshness evaluation module 300 is used to input the pre-processed spectral image into a pre-built multi-layer cascade freshness evaluation deep forest model to obtain the meat freshness detection result; wherein, between each layer of the deep forest model, a layer of candidate feature screening and layer growth control mechanism is added. wherein, the feature screening calculates the confidence of each layer of random forest output according to different metrics; by comparing the confidence, the features are reassembled and input to the next layer. the layer growth control mechanism includes: when the output H of the tth layer of the deep forest model is obtained by feature screening t After that, the metric value q[t] of the layer is calculated according to the metric index M; if q[t] is greater than the best performance value q best , then update q best value; if q[t] is less than q three times in a row best If t is within the maximum depth T of the model, the layer growth is stopped, while retaining the layers including q best The layer and all the layers before it, and delete all the layers after it.
[0080] The present method and system are described in detail below through specific embodiments:
[0081] 1) Test materials
[0082] The chilled mutton samples used in the experiment were taken from the farmers' market of Sunite Right Banner, Xilin Gol League, Inner Mongolia. The tenderloins of 5 sheep were selected after slaughter and acid removal. The fat and connective tissue were removed and evenly divided into 6cm×6cm×1cm slices. The slices were sealed and packaged in 3 groups with fresh-keeping bags and numbered. They were placed in a refrigerator at 4°C without squeezing for 14 days. Samples were taken every 24 hours and placed indoors for 25 minutes to evaporate the moisture on the surface of the samples. They were used for the determination of volatile basic nitrogen (TVB-N), pH value, total aerobic count (TAC), approximate number of coliforms (ANC) and spectral reflectance collection. The test samples covered three chilled mutton freshness levels: fresh, sub-fresh and not fresh. Figure 4 As shown, fresh mutton has a shiny surface, and the meat is fine and compact; stale mutton has a dull surface, dark in color, and loose and inelastic texture; the second-fresh mutton is in a transitional stage, and both its surface condition and touch feel are between fresh and stale.
[0083] 2) Laboratory determination of freshness index
[0084] In this test, the TVB-N content of the sample is determined according to the semi-micro Kjeldahl method in GB / 5009.228-2016 "National Food Safety Standard for Determination of Volatile Basic Nitrogen in Foods", the pH value is determined according to the non-averaged sample determination method in GB / 5009.237-2016 "National Food Safety Standard for Determination of pH Value of Foods", and the TAC content is tested according to the standard value of total colony count per unit mass in GB / 4789.2-2016 "National Food Safety Standard for Determination of Total Colony Count in Microbiological Examination of Foods". The ANC content is tested according to the standard value of coliform count per unit mass in GB / 4789.3-2016 "National Food Safety Standard for Coliform Count in Microbiological Examination of Foods". According to the national food hygiene monitoring standards and previous research results, when TVB-N ≤ 15mg / 100g, it is fresh meat; when 15mg / 100g <TVB-N≤
[0085] When TVB-N is 25mg / 100g, it is sub-fresh meat; when TVB-N>25mg / 100g, it is not fresh meat. At present, the total colony count, pH and approximate coliform count indicators for cold fresh mutton have not been formulated in my country's food hygiene testing standards. This embodiment uses TVB-N as the main indicator and jointly determines the freshness level of the sample by comparing the TAC, pH and ANC indicator measurement values.
[0086] 3) Sample spectral data collection and preprocessing
[0087] The hyperspectral acquisition system includes lighting equipment, a mechanical scanning platform, a hyperspectral imager (Hyperspec VNIRN-series), a reflective reference plate and image acquisition software. The spectrometer can collect wavelengths in the range of 400 to 1000 nm, with a total of 750 spectral channels and a resolution of 2.8 nm.
[0088] In each test, the spectrometer was turned on 30 minutes in advance for preheating, the sample was placed about 40 cm from the spectrometer lens, the pixel mixing times were set to 6 times, the spectrometer exposure time was 3 ms, and the spectral pixel brightness (DN) value was adjusted to less than 8500. During the test, the spectrometer was adjusted using the focus plate, the spectrometer scanning direction, number of times and moving speed were set, and the black and white correction spectrum images were collected to obtain the sample correction spectrum data. Using ENVI software, 20 points of interest were selected from each spectral image of the sample as feature extraction and correction model to establish experimental data. Figure 5 This is the DN value curve of the original spectrum of the experimental sample.
[0089] The spectral data after black and white correction still has some noise and the spectral intensity is different, so it needs to be preprocessed. Therefore, the convolution smoothing method (SavitZky-Golay) is used for smoothing filtering during the experiment, and then the multivariate scattering correction is used to process the spectral data after smoothing filtering to eliminate the baseline shift or offset phenomenon in the spectrum and improve the spectral signal-to-noise ratio for later feature extraction and classification recognition. The spectral reflectance curve after smoothing filtering and scattering correction is shown in Figure 2. Figure 6 shown.
[0090] 4) Sample spectral data feature extraction
[0091] The experiment uses a continuous projection algorithm to extract features from sample spectral data. Assuming that the number of samples in the data set X is M, the number of original features is J, and the first band selected is i(0), the algorithm merges new bands in each iteration until there are N bands in the set. The algorithm flow is shown in Table 3.
[0092] Table 3 Continuous projection algorithm
[0093]
[0094]
[0095] If N and i(0) are unknown, define a range N for N min ≦N≦N maxFor each N, it is necessary to consider each case of the initial band i(0) from 1 to J, perform the above steps, and establish a multivariate linear regression analysis model based on the output result i(n). The spectral data corresponding to i(n) is used as the test set, and the TVB-N, pH, TAC and ANC contents are used as markers to calculate the root mean square error RMSE. The i(0) and N corresponding to the minimum value are the optimal initial band and the number of selected bands.
[0096] The experiment set the number of characteristic wavelengths to range from 5 to 30, and extracted a total of 18 characteristic bands, such as Figure 7 shown.
[0097] 5) Establish an evaluation model
[0098] The experiment used the deep forest proposed in this embodiment to establish a multi-layer cascade freshness evaluation deep forest model for chilled mutton. The 280 spectral samples were divided into training set and test set in a ratio of 3:1. The number of samples in the training set and test set were 196 and 84 respectively. Table 4 shows the statistical results of the number of fresh, sub-fresh and not fresh samples in the training set and test set.
[0099] Table 4 Statistics of number of samples of cold fresh mutton with different freshness
[0100]
[0101] The four freshness evaluation indicators of TVB-N, pH, TAC and AVC measured by physical, chemical and microbiological experimental methods were divided into fresh, sub-fresh and unfresh intervals according to the national food hygiene monitoring standards, and the marks were formed. Figure 8 Labeling of chilled mutton samples used to establish a multi-layer cascade freshness evaluation deep forest model.
[0102] The three different colors correspond to three freshness levels, medium gray represents the fresh interval, light gray represents the sub-fresh interval, and dark gray represents the not-fresh interval. All the marks in the freshness evaluation deep forest model are generated according to this rule. If it is regarded as an array Z of length 12. When the sample freshness is fresh, the mark where the medium gray cell is located belongs to the sample, and its array is [1,0,0,1,0,0,1,0,0,1,0,0]; when the sample freshness is sub-fresh, the mark where the light gray cell is located belongs to the sample, and its array is [0,1,0,0,1,0,0,1,0,0,1,0]; when the sample freshness is not fresh, the mark where the dark gray cell is located belongs to the sample, and its array is [0,0,1,0,0,1,0,0,1,0,0,1].
[0103] During the freshness evaluation process, if the contents of the four freshness evaluation indicators are all in the fresh range, it indicates that the sample is fresh; if one or more of them are in the sub-fresh range, it indicates that the sample is sub-fresh; if one or more of them are in the not-fresh range, it indicates that the sample is not fresh.
[0104] The parameters of the deep forest established in the experiment are set as follows: the maximum number of layers is set to 10, the number of forests in each layer is 2, one random forest composed of PCT and one extreme random forest, each of which has 5 trees, and each subsequent layer has 5 more trees than the previous layer. This method can ensure that the model can learn different representations at each layer. Similarly, the maximum depth of the forest is 3, and each subsequent layer has 3 units more than the maximum depth of the previous forest. Finally, a 5-fold cross validation is set to prevent overfitting.
[0105] 6) Freshness evaluation
[0106] This experiment uses four metrics, namely hamming loss, one-error, ranking loss and macro-AUC, to evaluate the deep forest model for multi-layer cascade freshness evaluation of chilled mutton. The deep forest evaluation model proposed in this embodiment is compared with ML-kNN and RF-PCT, and its various metrics on the test set are shown in Table 5.
[0107] Table 5 Performance of freshness evaluation model of chilled mutton established under different multi-label classification algorithms
[0108]
[0109] The experiment sets the parameter k of the ML-kNN model to 10. In the RF-PCT model, the maximum depth of the forest is set to 3 and the total number of trees is set to 100. The experiment records the metric values and deviations of 10 test sets in the above algorithms, and takes the average metric value for model performance comparison. As can be seen from the table, the deep forest evaluation model proposed in this embodiment outperforms ML-kNN and RF-PCT in each metric index, verifying the effectiveness of the multi-index freshness evaluation model on the hyperspectral dataset of chilled fresh mutton.
[0110] Fig. 9 , 10 The following are the classification result diagrams of the deep forest model on the training set and the test set, respectively. The horizontal axis represents the number of samples, the vertical axis represents the classification value, and the "1", "2", and "3" on the vertical axis represent the three freshness levels of fresh, sub-fresh, and not fresh, respectively. "o" represents the actual freshness level of the sample, and "+" represents the model prediction result. It can be seen from the figure that the model has achieved good classification results. The confusion matrix of the freshness classification results of chilled mutton obtained by the deep forest model proposed in the present invention is shown in Table 6.
[0111] Table 6 Confusion matrix of freshness classification results of cold fresh mutton
[0112]
[0113] This experiment takes fresh mutton as the research object, hyperspectral imaging technology as the detection method, TVB-N, pH, TAC and ANC as the evaluation indicators of fresh mutton freshness, extracts the points of interest of the hyperspectral image of fresh mutton samples, and preprocesses the original spectral image by smoothing filtering and multivariate scattering correction. The characteristic bands of the spectrum are extracted by continuous projection method, and the multi-layer cascade freshness evaluation deep forest model of fresh mutton is constructed by random tree based on PCT, which realizes the non-destructive detection of the freshness of multi-index fresh mutton, and the model recognition accuracy reaches 98.57%. The characteristic information calculated in each layer is screened by metric indicators such as hamming loss, one-error, ranking loss and macro-AUC, and the complexity of the model is controlled. It is compared with other multi-label classification algorithms ML-kNN and RF-PCT through experiments. The results show that the deep forest model proposed in the embodiment of the present invention has better classification effect on the hyperspectral data set of fresh mutton, which proves the effectiveness and applicability of deep forest in the classification of multi-index freshness of fresh mutton.
[0114] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0115] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0116] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0117] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0118] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0119] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A nondestructive detection method for meat freshness based on an improved deep forest algorithm, characterized in that: include: Obtain spectral images of meat; Preprocessing the meat spectral image; The preprocessed spectral image is input into a pre-built multi-layer cascade freshness evaluation deep forest model to obtain a meat freshness detection result; wherein the multi-layer cascade freshness evaluation deep forest model adds a previous layer of candidate feature screening and layer growth control mechanism between each layer of the deep forest model; The feature screening calculates the confidence of each layer of random forest output according to different metrics; by comparing the confidence, the features are reassembled and input into the next layer; The layer growth control mechanism includes: When the output H of the tth layer of the deep forest model is obtained through the feature screening t After that, the metric value q[t] of the layer is calculated according to the metric index M; if q[t] is greater than the metric value q with the best performance best , then update q best value; if q[t] is less than q three times in a row best If t is within the maximum depth T of the model, the layer growth is stopped, while retaining the layers including q best The layer and all the layers before it, and delete all the layers after it.
2. The nondestructive detection method for meat freshness based on the improved deep forest algorithm according to claim 1, characterized in that: The preprocessing of the meat spectral image comprises: The meat spectral image is subjected to SG smoothing filtering and multivariate scattering correction processing.
3. A nondestructive meat freshness detection system based on an improved deep forest algorithm, characterized in that: include: A spectral image acquisition module, used for acquiring spectral images of meat; A spectral image preprocessing module, used for preprocessing the meat spectral image; A freshness evaluation module is used to input the preprocessed spectral image into a pre-built multi-layer cascade freshness evaluation deep forest model to obtain a meat freshness detection result; wherein the multi-layer cascade freshness evaluation deep forest model adds a previous layer of candidate feature screening and layer growth control mechanism between each layer of the deep forest model; The feature screening calculates the confidence of each layer of random forest output according to different metrics; by comparing the confidence, the features are reassembled and input into the next layer; The layer growth control mechanism includes: When the output H of the tth layer of the deep forest model is obtained through the feature screening t After that, the metric value q[t] of the layer is calculated according to the metric index M; if q[t] is greater than the metric value q with the best performance best , then update q best value; if q[t] is less than q three times in a row best If t is within the maximum depth T of the model, the layer growth is stopped, while retaining the layers including q best The layer and all the layers before it, and delete all the layers after it.
4. The meat freshness nondestructive detection system based on the improved deep forest algorithm as claimed in claim 3, characterized in that: The spectral image preprocessing module is specifically used to perform SG smoothing filtering and multivariate scattering correction processing on the meat spectral image.