Mutton moisture content detection method and device, medium and product

Through hyperspectral imaging technology and pretreatment methods, combined with the mutton moisture content prediction model, the problem of low moisture detection accuracy of mutton is solved, and accurate detection of mutton moisture content is achieved.

CN119757244APending Publication Date: 2025-04-04INNER MONGOLIA AGRICULTURAL UNIVERSITY

Patent Information

Application Number
CN202510239434.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The existing spectral technology has low accuracy in mutton moisture detection and is greatly affected by the surface shape and tissue structure.

Method used

Hyperspectral imaging technology is used to obtain hyperspectral images of mutton samples, and the spectral curve is pre-processed through feature extraction and optimal pretreatment methods. The feature wavelength is screened using a continuous projection algorithm, and the reflectivity is input to the mutton moisture content prediction model for prediction.

Benefits of technology

The accuracy of mutton moisture content detection is improved, and the accurate detection of the moisture content of fresh mutton is achieved, which is suitable for real-time monitoring and rapid detection of large-scale production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119757244A_ABST
    Figure CN119757244A_ABST
Patent Text Reader

Abstract

The invention discloses a mutton moisture content detection method and device, a medium and a product, and relates to the technical field of image nondestructive testing, and the method comprises the following steps: obtaining a target image; performing feature extraction on each pixel point in the target image, and determining a spectral curve of the mutton sample to be detected; preprocessing the spectrum curve of the mutton sample to be detected by using an optimal preprocessing method to obtain a preprocessed spectrum curve of the mutton sample to be detected; screening the preprocessed spectrum curve of the mutton sample to be detected by using a continuous projection algorithm to obtain the reflectivity of the mutton sample to be detected under a plurality of characteristic wavelengths; and inputting the reflectivity of the mutton sample to be detected under each characteristic wavelength into the mutton moisture content prediction model to obtain a predicted value of the moisture content of the mutton sample to be detected. The detection precision of the moisture content of mutton is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of nondestructive image testing, and in particular to a method, device, medium and product for detecting moisture content in mutton. Background Art

[0002] As an important meat product, the moisture content of mutton is one of the important indicators of its quality, which is directly related to the flavor, texture, preservation and nutritional value of mutton. Therefore, accurate determination of the moisture content of mutton is of great significance to ensure the taste, nutritional value, safety and market competitiveness of meat products.

[0003] Traditional methods for detecting the moisture content of mutton mainly include drying method, conductivity method, etc. These methods usually involve physical or chemical treatment of samples, which are cumbersome and time-consuming. They are also destructive to mutton samples and are not suitable for real-time monitoring and rapid detection in large-scale production. Hyperspectral imaging technology combines the advantages of spectral technology and imaging technology, and can simultaneously obtain spatial information and spectral information of the sample to be tested. Compared with traditional chemical methods, it has the advantages of non-destructive, simple operation, time-saving and labor-saving, unified graph and spectrum, accurate results, and easy to achieve large-scale detection. In recent years, it has been rapidly developed and widely used in livestock product quality detection. The qualitative and quantitative detection of mutton quality indicators using hyperspectral imaging technology first requires the establishment of its prediction model, and the establishment of the prediction model mainly depends on the collection of spectral data and data preprocessing. However, the existing spectral technology still faces some challenges in the detection of mutton moisture. For example, the spectral characteristics of mutton are greatly affected by its surface shape and tissue structure, which makes the detection accuracy of mutton moisture content low. Summary of the invention

[0004] The purpose of this application is to provide a method, device, medium and product for detecting the moisture content of mutton, so as to solve the problem of low accuracy in detecting the moisture content of mutton.

[0005] To achieve the above objectives, this application provides the following solutions.

[0006] In a first aspect, the present application provides a method for detecting moisture content of mutton, comprising: Acquire a target image; the target image is a hyperspectral image of the mutton sample to be tested, and the hyperspectral image is a three-dimensional image composed of two-dimensional images at all wavelengths in a preset band; Extracting features from each pixel in the target image and determining a spectrum curve of the mutton sample to be tested; the horizontal axis of the spectrum curve is wavelength, and the vertical axis is reflectivity; Using an optimal pretreatment method, pretreatment is performed on the spectral curve of the mutton sample to be tested to obtain a spectral curve of the mutton sample after pretreatment; the optimal pretreatment method is selected from a plurality of pretreatment methods to be screened; Using a continuous projection algorithm to screen the pre-processed spectral curve of the mutton sample to be tested, to obtain the reflectivity of the mutton sample to be tested at multiple characteristic wavelengths; The reflectivity of the mutton sample to be tested at each characteristic wavelength is input into the mutton moisture content prediction model to obtain the predicted value of the moisture content of the mutton sample to be tested; the mutton moisture content prediction model is screened out from a plurality of trained initial models.

[0007] Optionally, extracting features from each pixel in the target image and determining a spectral curve of the mutton sample to be tested comprises: Extracting features of each pixel in the target image to obtain the reflectivity of each pixel at each wavelength in a preset band; Determine any wavelength in the preset band as the current wavelength; Calculate the mean value of the reflectivity of all pixels in the target image at the current wavelength to obtain the reflectivity of the mutton sample to be tested at the current wavelength; Based on the reflectivity of the mutton sample to be tested at each wavelength in a preset wavelength band, the spectral curve of the mutton sample to be tested is determined.

[0008] Optionally, the multiple preprocessing methods to be screened include: SG smoothing filtering, multivariate scattering correction, standard normal variable transformation, first-order derivative, multivariate scattering correction-SG smoothing filtering, standard normal variable transformation-SG smoothing filtering and first-order derivative-SG smoothing filtering.

[0009] Optionally, the multiple initial models include: partial least squares regression, random forest, support vector regression, and extreme gradient boosting regression.

[0010] Optionally, the screening process of the optimal pretreatment method and the mutton moisture content prediction model includes: Obtaining hyperspectral images and actual values ​​of moisture content of sampled mutton samples; The hyperspectral image of the sampled mutton is divided into a plurality of regions of interest; Feature extraction is performed on each pixel point in each region of interest to obtain the spectral curve of each region of interest; According to the set ratio, the spectral curves of all regions of interest are divided into a calibration set and a test set; Determine any pretreatment method to be screened as the current pretreatment method; Using the current preprocessing method, preprocess the spectral curves of each region of interest in the calibration set and the test set respectively, and obtain the spectral curves of the corresponding region of interest after the current preprocessing; The spectral curves of the currently preprocessed regions of interest in the calibration set and the test set are screened using a continuous projection algorithm to obtain the reflectances of the currently preprocessed regions of interest at multiple characteristic wavelengths; Determine any initial model as the current model; The current model is trained using the actual values ​​of reflectance and moisture content at multiple characteristic wavelengths after the current preprocessing of each area of ​​interest in the correction set to obtain a trained current model; Inputting the reflectances of all the regions of interest in the calibration set and the test set at multiple characteristic wavelengths after the current pretreatment into the trained current model, and obtaining the predicted value of the moisture content of the sample mutton sample output by the trained current model after the sample mutton sample is pretreated by the current pretreatment method; Based on the predicted value of moisture content output by the trained current model after the sample mutton sample is pretreated by the current pretreatment method and the actual value of moisture content, determining the performance parameters corresponding to the current pretreatment method and the trained current model; the performance parameters include: determination coefficient and root mean square error; According to the performance parameters corresponding to each pretreatment method and each trained initial model, the optimal pretreatment method and the mutton moisture content prediction model are determined.

[0011] Optionally, obtaining a hyperspectral image and actual value of moisture content of a sample mutton sample includes: Preparation of sample lamb samples; A hyperspectral imaging system was used to collect hyperspectral images of the sampled mutton; Measuring the weight of the sample mutton sample to obtain the initial weight; After drying the sample mutton sample, the weight of the dried sample mutton sample is measured to obtain a constant weight; Based on the initial weight and the constant weight, the actual value of the moisture content of the sample mutton sample is calculated.

[0012] Optionally, the wavelength range of the preset band is 400nm-1000nm.

[0013] In a second aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-mentioned methods for detecting moisture content in mutton.

[0014] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned methods for detecting moisture content in mutton.

[0015] In a fourth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-mentioned methods for detecting moisture content in mutton.

[0016] According to the specific embodiments provided in this application, this application discloses the following technical effects: The present application discloses a method, device, medium and product for detecting moisture content of mutton. First, a target image is acquired; the target image is a hyperspectral image of a mutton sample to be tested, and the hyperspectral image is a three-dimensional image composed of two-dimensional images at all wavelengths in a preset band; then, features are extracted for each pixel point in the target image, and a spectral curve of the mutton sample to be tested is determined; the horizontal axis of the spectral curve is the wavelength, and the vertical axis is the reflectivity; secondly, the spectral curve of the mutton sample to be tested is preprocessed using an optimal preprocessing method to obtain a preprocessed spectral curve of the mutton sample to be tested; the optimal preprocessing method is screened out from a plurality of preprocessing methods to be screened; then, a continuous projection algorithm is used to screen the preprocessed spectral curve of the mutton sample to be tested to obtain the reflectivity of the mutton sample to be tested at a plurality of characteristic wavelengths; finally, the reflectivity of the mutton sample to be tested at each characteristic wavelength is input into a mutton moisture content prediction model to obtain a predicted value of the moisture content of the mutton sample to be tested; the mutton moisture content prediction model is screened out from a plurality of trained initial models. The present application screens out the optimal pretreatment method from multiple pretreatment methods, screens out a mutton moisture content prediction model from multiple trained initial models, and combines hyperspectral images to predict the mutton moisture content, thereby improving the detection accuracy of mutton moisture content. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 A schematic flow chart of a method for detecting moisture content in mutton provided in one embodiment of the present application.

[0019] Figure 2 Schematic diagram of the hyperspectral image of a sample mutton sample.

[0020] Figure 3 Schematic diagram of the region of interest.

[0021] Figure 4 Schematic diagram of the original spectrum curve.

[0022] Figure 5 Schematic diagram of the spectral curve after multivariate scattering correction.

[0023] Figure 6 This is a schematic diagram of the spectral curve after standard normal variable transformation.

[0024] Figure 7 Schematic diagram of the spectral curve after SG smoothing filtering.

[0025] Figure 8 This is a schematic diagram of the spectral curve after first-order derivative processing.

[0026] Fig. 9 Schematic diagram of the spectral curve after multivariate scattering correction-SG smoothing filtering.

[0027] Fig.10 Schematic diagram of the spectral curve after standard normal variable transformation-SG smoothing filtering.

[0028] Fig.11 This is a schematic diagram of the spectral curve after first-order derivative-SG smoothing filtering.

[0029] Fig.12 This is the characteristic wavelength distribution diagram selected using the continuous projection algorithm.

[0030] Fig.13 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0032] The purpose of this application is to provide a method, device, medium and product for detecting the moisture content of mutton, aiming to improve the detection accuracy of the moisture content of mutton.

[0033] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0034] In an exemplary embodiment, Figure 1As shown, a method for detecting moisture content in mutton is provided, comprising steps 1 to 5.

[0035] Step 1: Acquire a target image; the target image is a hyperspectral image of the mutton sample to be tested, and the hyperspectral image is a three-dimensional image composed of two-dimensional images at all wavelengths in a preset band.

[0036] As an optional implementation, the wavelength range of the preset band is 400nm-1000nm.

[0037] Specifically, before step 1, the method further includes: preparing a mutton sample to be tested. The process of preparing the mutton sample to be tested includes: taking the longissimus dorsi muscle between the 12th and 13th ribs of the slaughtered sheep, wrapping it with tin foil, putting it in a sealed bag, and storing it at 0-4°C to obtain the mutton sample to be tested.

[0038] Step 2: Extract features from each pixel in the target image and determine the spectral curve of the mutton sample to be tested; the horizontal axis of the spectral curve is wavelength, and the vertical axis is reflectivity.

[0039] As an optional implementation, step 2 includes steps 21 to 24.

[0040] Step 21: Extract features of each pixel in the target image to obtain the reflectivity of each pixel at each wavelength in a preset band.

[0041] Step 22: Determine any wavelength in the preset wavelength band as the current wavelength.

[0042] Step 23: Calculate the mean reflectivity of all pixels in the target image at the current wavelength to obtain the reflectivity of the mutton sample to be tested at the current wavelength.

[0043] Step 24: Determine the spectral curve of the mutton sample to be tested based on the reflectivity of the mutton sample to be tested at each wavelength in a preset band.

[0044] Step 3: Preprocess the spectral curve of the mutton sample to be tested by using the optimal preprocessing method to obtain the spectral curve of the mutton sample to be tested after preprocessing; the optimal preprocessing method is screened out from multiple preprocessing methods to be screened.

[0045] As an optional implementation, multiple preprocessing methods to be screened include: SG smoothing filter (SavitzkyGolay Filter, SGF), multiplicative scatter correction (Multiplicative Scatter Correction, MSC), standard normal variable transformation (Standard Normal Variate, SNV), first-order derivative (Finite Difference, FD), multiplicative scatter correction-SG smoothing filter, standard normal variable transformation-SG smoothing filter and first-order derivative-SG smoothing filter.

[0046] Step 4: Use a continuous projection algorithm to screen the pre-processed spectral curve of the mutton sample to be tested, and obtain the reflectivity of the mutton sample to be tested at multiple characteristic wavelengths.

[0047] Step 5: Input the reflectance of the mutton sample to be tested at each characteristic wavelength into the mutton moisture content prediction model to obtain the predicted value of the moisture content of the mutton sample to be tested; the mutton moisture content prediction model is selected from multiple trained initial models.

[0048] As an optional implementation, the multiple initial models include: Partial Least Squares Regression, PLSR, Random Forest (RF), Support Vector Regression (SVR) and eXtreme Gradient Boosting (XGB).

[0049] As an optional implementation, the screening process of the optimal pretreatment method and the mutton moisture content prediction model includes the following steps.

[0050] S01: Obtain the hyperspectral image and actual value of moisture content of sample mutton.

[0051] S02: Divide the hyperspectral image of the sample mutton into multiple regions of interest.

[0052] S03: Extract features of each pixel point in each region of interest to obtain a spectral curve of each region of interest.

[0053] S04: Divide the spectral curves of all regions of interest into a calibration set and a test set according to a set ratio.

[0054] S05: Determine any preprocessing method to be screened as the current preprocessing method.

[0055] S06: using the current preprocessing method, preprocessing the spectral curves of each region of interest in the calibration set and the test set respectively, to obtain the spectral curves of the corresponding region of interest after the current preprocessing.

[0056] S07: Using a continuous projection algorithm, the spectral curves of the currently preprocessed regions of interest in the calibration set and the test set are screened to obtain the reflectances of the currently preprocessed regions of interest at multiple characteristic wavelengths.

[0057] S08: Determine any initial model as the current model.

[0058] S09: The current model is trained using the actual values ​​of the reflectance and moisture content at multiple characteristic wavelengths after the current preprocessing of each region of interest in the calibration set to obtain a trained current model.

[0059] S10: Input the reflectance at multiple characteristic wavelengths of all the regions of interest in the calibration set and the test set after the current preprocessing into the trained current model to obtain the predicted value of the moisture content of the sample mutton sample output by the trained current model after preprocessing using the current preprocessing method.

[0060] S11: Based on the predicted value of moisture content output by the trained current model after the sample mutton sample is preprocessed using the current preprocessing method and the actual value of moisture content, determine the performance parameters corresponding to the current preprocessing method and the trained current model; the performance parameters include: determination coefficient and root mean square error.

[0061] S12: Determine the optimal pretreatment method and mutton moisture content prediction model according to the performance parameters corresponding to each pretreatment method and each trained initial model.

[0062] As an optional implementation, S01 includes the following steps.

[0063] S011: Prepare sample mutton samples.

[0064] S012: Hyperspectral images of sample mutton samples were collected using a hyperspectral imaging system.

[0065] S013: Measure the weight of the sample mutton sample to obtain an initial weight.

[0066] S014: After drying the sample mutton sample, measure the weight of the dried sample mutton sample to obtain a constant weight.

[0067] S015: Calculate the actual value of the moisture content of the sample mutton sample based on the initial weight and the constant weight.

[0068] Furthermore, an experimental study was conducted on the method of the present application, including the following steps.

[0069] 1. Prepare the sample mutton sample.

[0070] The experimental material is the fresh meat of Small Tail Han Sheep. After slaughter, the carcass was placed in a 0℃ environment and subjected to 48 hours of acid removal treatment. The longissimus dorsi muscle between the 12-13 ribs, weighing about 300g, was taken, wrapped in tin foil and placed in a sealed bag and stored fresh at 0-4℃.

[0071] 2. Determine the moisture content.

[0072] Take an appropriate amount of mutton and cut it into small pieces to obtain a sample mutton sample. Mix them evenly to ensure that the sample mutton sample is representative. Weigh about 10g of the sample mutton sample and record the initial weight. Then put the sample mutton sample into a pre-weighed drying dish, place it in a 103℃ oven, and dry it for 5 hours. After drying, put the drying dish into a desiccator and cool it to room temperature. Weigh it again and record it. Repeat the drying and weighing steps until the weight change between two consecutive weighing results does not exceed 2mg, that is, it reaches a constant weight state. Calculate the moisture content based on the final constant weight and the initial weight.

[0073] 3. Hyperspectral image acquisition.

[0074] The hyperspectral images of the sampled mutton samples were collected using a visible / near-infrared hyperspectral imaging system (wavelength range 400-1000nm, spectral resolution 2.5nm, 300 bands), one of which is shown in Figure 2. Figure 2 The visible / near-infrared hyperspectral imaging system includes: a hyperspectral camera, a charge-coupled device camera, a 150W fiber optic halogen lamp white light source and an electrically controlled translation stage.

[0075] During the acquisition process, in order to ensure the consistency of the light source, try to collect in a dark state. Before each spectral image acquisition, the hyperspectral imager needs to be turned on and preheated for about 30 minutes to avoid measurement errors caused by changes in the ambient temperature of the detector when the instrument is just started. When collecting hyperspectral data of fresh mutton samples, the parameters are set as follows: the camera exposure time is 12ms, and the moving speed of the electric translation stage is 0.5mm / s.

[0076] 4. Selection of area of ​​interest.

[0077] ENVI software was used to select 10 pixel areas of 100×100±15 as the regions of interest from the hyperspectral images of the sampled mutton samples. Figure 3As shown. The mean value of the reflectivity of all pixels in each region of interest at each wavelength is calculated as the reflectivity of the region of interest at each wavelength. The spectral curve drawn according to the reflectivity of all regions of interest at each wavelength is shown in Figure 4 shown.

[0078] 5. Spectral curve preprocessing.

[0079] In the process of hyperspectral image acquisition, it is often affected by factors such as instrument noise, dark current, light scattering, baseline offset, etc., and there is some redundant information that affects the modeling results. Therefore, it is necessary to preprocess the spectral curve. Four single methods, SG smoothing filter, multivariate scattering correction, standard normal variable transformation and first-order derivative, and three combined methods, multivariate scattering correction-SG smoothing filter, standard normal variable transformation-SG smoothing filter and first-order derivative-SG smoothing filter, were used for preprocessing to find the best preprocessing method suitable for the prediction of moisture content of fresh mutton spectral data. The spectral curves of the four single preprocessing methods are shown in Figure 5-Figure 8 The spectral curves of the three combined methods are shown in Figure 9-11 .

[0080] 6. Sample set division.

[0081] Before establishing the prediction model for the moisture content of fresh mutton, the pre-processed spectral curves of all mutton samples need to be randomly divided into a calibration set and a test set at a ratio of 3:1. Finally, the calibration set contains 495 samples and the test set contains 165 samples. The results of the sample set division are shown in Table 1.

[0082] Table 1 Division of sample sets and moisture content determination results

[0083] 7. Construction of prediction model under full wavelength.

[0084] In this embodiment, four modeling methods, namely linear regression model PLSR and nonlinear regression model SVR, RF and XGB, are used to construct the prediction model of fresh mutton moisture under full wavelength, and the determination coefficient R 2 (including the determination coefficient R of the sample set C 2 and the coefficient of determination R of the prediction set P 2), root mean square error RMSE (including root mean square error RMSEC of sample set, root mean square error RMSEP of prediction set and root mean square error RMSEP of cross validation) to evaluate the prediction performance of each model. The prediction results of the four models under different preprocessing methods are shown in Tables 2-5. The results show that FD-SGF is the best preprocessing method. Among the four models established using full-band spectra, the PLSR model has the worst accuracy, with R C 2 , R P 2 The RF model is slightly better than the SVR model in terms of accuracy. The XGB model has the best accuracy. C 2 , R P 2 They are 0.9288 and 0.8367 respectively, and RMSEC, RMSEP and RMSECV are 0.0618, 0.0789 and 0.0566 respectively.

[0085] Table 2 PLSR modeling results under different preprocessing methods

[0086] Table 3 SVR modeling results under different preprocessing methods

[0087] Table 4 RF model modeling results under different preprocessing methods

[0088] Table 5 XGB model modeling results under different preprocessing methods

[0089] 8. Selection of characteristic wavelength.

[0090] The continuous projection algorithm is used to reduce the dimension of each preprocessed spectral curve and select characteristic wavelengths, compare the size of the projection vector, and take the band with the largest projection vector as the characteristic band. A total of 9 characteristic wavelengths were selected, located at 381.97nm, 390.56nm, 411.96nm, 416.23nm, 422.62nm, 580.11nm, 660.48nm, 734.01nm, and 865.72nm, respectively. Fig.12 .

[0091] 9. Construction of prediction model under characteristic wavelength.

[0092] Four methods, PLSR, SVR, RF, and XGB, were used to construct the prediction model of the moisture content of fresh mutton under characteristic wavelengths. The prediction results of the four models are shown in Tables 6 to 9. The results show that the XGB model has the best accuracy, with R C 2 , R P 2 They are 0.9288 and 0.8367 respectively, and RMSEC, RMSEP and RMSECV are 0.0618, 0.0789 and 0.0566 respectively.

[0093] Table 6 PLSR modeling results at characteristic wavelengths

[0094] Table 7 SVR modeling results at characteristic wavelengths

[0095] Table 8 RF modeling results at characteristic wavelengths

[0096] Table 9 XGB modeling results at characteristic wavelengths

[0097] 10. Determination of the final prediction model.

[0098] By comparing the prediction results of the four models under full wavelength and characteristic wavelength, it was found that the model under characteristic wavelength was more accurate, and compared with the full wavelength model, it reduced redundant information and reduced the complexity of the model. Finally, the XGB model under characteristic wavelength was determined to be the optimal model, namely the mutton moisture content prediction model.

[0099] This application describes how to make full use of different pretreatment and modeling methods to improve the detection of mutton moisture. From the results of model establishment, it can be seen that for the detection of mutton moisture, the combined pretreatment method can greatly improve the accuracy of the model, and the accuracy of the model has also been improved to a certain extent after feature extraction. The results show that this application makes full use of different pretreatment and modeling methods to construct a mutton moisture content prediction model, thereby achieving accurate detection of the moisture content of fresh cold mutton.

[0100] By utilizing hyperspectral imaging technology, rich spectral information can be obtained. The selection of regions of interest can effectively expand the amount of samples required for modeling, avoiding the problem of limited sample size for modeling due to difficulties in measuring the chemical values ​​of samples.

[0101] A variety of combined preprocessing methods were used to eliminate the influence of noise, dark current, light scattering and other factors, thereby improving the quality of the data and facilitating more accurate extraction of the spectral characteristics of the moisture content of fresh mutton. This process makes subsequent analysis and model building more accurate.

[0102] A variety of modeling methods were used, and the best model was selected by comparing the prediction results of different methods, thereby improving the accuracy and reliability of the model results.

[0103] The prediction results of the characteristic wavelength model and the full wavelength model are combined to intuitively reflect the impact of the characteristic wavelength on the moisture content prediction. This model optimization not only reduces data redundancy, but also improves the detection speed and is suitable for a wider range of scenarios.

[0104] Compared with traditional moisture content detection methods, the method used in this application has a more standardized and non-destructive operating procedure, and can be quickly detected after slaughter, which improves the timeliness of detection and provides theoretical and technical support for improving the level and technology of intelligent detection of mutton and other meat products.

[0105] In an exemplary embodiment, a computer device is provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a method for detecting moisture content in mutton.

[0106] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, a method for detecting moisture content of mutton is implemented.

[0107] In an exemplary embodiment, a computer program product is provided, including a computer program, which implements a method for detecting moisture content of mutton when executed by a processor.

[0108] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Fig.13As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for detecting the moisture content of mutton is implemented.

[0109] Those skilled in the art will understand that Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0110] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0111] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0112] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0113] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0114] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for detecting moisture content in mutton, characterized in that: The mutton moisture content detection method comprises: Acquire a target image; the target image is a hyperspectral image of the mutton sample to be tested, and the hyperspectral image is a three-dimensional image composed of two-dimensional images at all wavelengths in a preset band; Extracting features from each pixel in the target image and determining a spectrum curve of the mutton sample to be tested; the horizontal axis of the spectrum curve is wavelength, and the vertical axis is reflectivity; Using an optimal pretreatment method, pretreatment is performed on the spectral curve of the mutton sample to be tested to obtain a spectral curve of the mutton sample after pretreatment; the optimal pretreatment method is selected from a plurality of pretreatment methods to be screened; Using a continuous projection algorithm to screen the pre-processed spectral curve of the mutton sample to be tested, to obtain the reflectivity of the mutton sample to be tested at multiple characteristic wavelengths; The reflectivity of the mutton sample to be tested at each characteristic wavelength is input into the mutton moisture content prediction model to obtain the predicted value of the moisture content of the mutton sample to be tested; the mutton moisture content prediction model is screened out from a plurality of trained initial models.

2. The method for detecting moisture content of mutton according to claim 1, characterized in that: Extracting features from each pixel in the target image and determining a spectral curve of the mutton sample to be tested comprises: Extracting features of each pixel in the target image to obtain the reflectivity of each pixel at each wavelength in a preset band; Determine any wavelength in the preset band as the current wavelength; Calculate the mean value of the reflectivity of all pixels in the target image at the current wavelength to obtain the reflectivity of the mutton sample to be tested at the current wavelength; Based on the reflectivity of the mutton sample to be tested at each wavelength in a preset wavelength band, the spectral curve of the mutton sample to be tested is determined.

3. The method for detecting moisture content of mutton according to claim 1, characterized in that: The multiple preprocessing methods to be screened include: SG smoothing filter, multivariate scatter correction, standard normal variable transformation, first-order derivative, multivariate scatter correction-SG smoothing filter, standard normal variable transformation-SG smoothing filter and first-order derivative-SG smoothing filter.

4. The method for detecting moisture content of mutton according to claim 3, characterized in that: Multiple initial models include: partial least squares regression, random forest, support vector regression, and extreme gradient boosting regression.

5. The method for detecting moisture content of mutton according to claim 4, characterized in that: The screening process of the optimal pretreatment method and the mutton moisture content prediction model includes: Obtaining hyperspectral images and actual values ​​of moisture content of sampled mutton samples; The hyperspectral image of the sampled mutton is divided into a plurality of regions of interest; Feature extraction is performed on each pixel point in each region of interest to obtain the spectral curve of each region of interest; According to the set ratio, the spectral curves of all regions of interest are divided into a calibration set and a test set; Determine any pretreatment method to be screened as the current pretreatment method; Using the current preprocessing method, preprocess the spectral curves of each region of interest in the calibration set and the test set respectively, and obtain the spectral curves of the corresponding region of interest after the current preprocessing; The spectral curves of the currently preprocessed regions of interest in the calibration set and the test set are screened using a continuous projection algorithm to obtain the reflectances of the currently preprocessed regions of interest at multiple characteristic wavelengths; Determine any initial model as the current model; The current model is trained using the actual values ​​of reflectance and moisture content at multiple characteristic wavelengths after the current preprocessing of each area of ​​interest in the correction set to obtain a trained current model; Inputting the reflectances of all the regions of interest in the calibration set and the test set at multiple characteristic wavelengths after the current pretreatment into the trained current model, and obtaining the predicted value of the moisture content of the sample mutton sample output by the trained current model after the sample mutton sample is pretreated by the current pretreatment method; Based on the predicted value of moisture content output by the trained current model after the sample mutton sample is pretreated by the current pretreatment method and the actual value of moisture content, determining the performance parameters corresponding to the current pretreatment method and the trained current model; the performance parameters include: determination coefficient and root mean square error; According to the performance parameters corresponding to each pretreatment method and each trained initial model, the optimal pretreatment method and the mutton moisture content prediction model are determined.

6. The method for detecting moisture content of mutton according to claim 5, characterized in that: Obtain hyperspectral images and actual values ​​of moisture content of sample mutton samples, including: Preparation of sample lamb samples; A hyperspectral imaging system was used to collect hyperspectral images of the sampled mutton; Measuring the weight of the sample mutton sample to obtain the initial weight; After drying the sample mutton sample, the weight of the dried sample mutton sample is measured to obtain a constant weight; Based on the initial weight and the constant weight, the actual value of the moisture content of the sample mutton sample is calculated.

7. The method for detecting moisture content of mutton according to claim 1, characterized in that: The wavelength range of the preset band is 400nm-1000nm.

8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for detecting moisture content in mutton as described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting moisture content in mutton described in any one of claims 1 to 7 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for detecting moisture content in mutton described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Rapid pork product moisture content detection method

    CN104880427A

  • Detection method for origin of mutton

    CN107907500A

  • Intelligent fishery regulation and control method and system based on hyperspectral fish meat quality detection

    CN114136906A

  • Hyperspectral image detection method for mutton quality indexes

    CN117929294A

Cited By

  • Cold fresh mutton freshness nondestructive testing method based on double-branch hierarchical spectral feature sensing network

    CN119992541A