Beef thawing degree and end point prediction method based on ultrasonic technology
By combining ultrasonic detection and machine learning algorithms, a beef thaw prediction model is established, which solves the inhomogeneity and traditional evaluation methods during beef thawing, and achieves high-precision, real-time thawing end point prediction and uniform thawing, improving the quality and safety of beef products.
Patent Information
- Application Number
- CN202510491686.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-18
AI Technical Summary
The existing technology cannot effectively respond to changes in size, shape, initial temperature and environmental conditions of beef of different specifications, resulting in uneven, insufficient or excessive thawing during the thawing process. The traditional thawing evaluation methods are subjective and inefficient, making it difficult to meet the modern food industry's demand for precise thawing control.
Combining ultrasonic detection technology and machine learning algorithms, a high-precision beef thaw prediction model is established through signal acquisition, preprocessing, and quantifying the degree of thawing to achieve non-destructive, real-time monitoring and evaluation of the beef thawing process.
It realizes high accuracy, uniformity and real-time monitoring of the beef thawing process, avoids excessive or insufficient thawing, significantly improves product quality and food safety, and provides accurate thawing end point prediction.
Smart Images

Figure CN120337090A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of food detection, and particularly relates to a method for predicting the thawing degree and end point of beef based on ultrasonic technology. Background Art
[0002] Beef, with its rich protein, vitamin, and mineral content, has become a high-quality food source favored by consumers worldwide. With the improvement of the global living standard and the enhancement of health awareness, consumers have put forward more stringent requirements for the traceability of beef product sources, the transparency of processing technology, and the quality stability. Due to the rich nutrients and water in beef, its perishable nature makes frozen storage an indispensable preservation method in the food industry. However, the thawing process after freezing has a decisive impact on maintaining the sensory quality, food safety, and nutritional value integrity of beef.
[0003] The existing timed thawing method in the prior art has limitations and cannot effectively cope with the changes in different specifications of beef in terms of size, shape, initial temperature, and environmental conditions, resulting in frequent problems such as uneven, insufficient, or over-thawing during the thawing process. These problems not only reduce the product quality but also may pose food safety hazards. Traditional thawing evaluation methods such as manual tactile inspection and empirical timed judgment cannot meet the requirements of modern food industry for precise thawing control due to their strong subjectivity, high destructiveness, and low efficiency. Although non-invasive technologies such as hyperspectral imaging, electrical impedance tomography, and infrared thermal imaging have been gradually applied to thawing process monitoring in recent years, due to factors such as the complexity of beef tissue, uneven internal water distribution, conductivity differences, and external environmental interference, these technologies are still difficult to accurately evaluate the overall thawing state in practical applications, and their practicability is severely restricted.
[0004] In view of the above technical problems, the food industry urgently needs a technical method with non-destructiveness, universality, and high precision for real-time monitoring and evaluation of the beef thawing process to maximize the retention of product nutritional value, improve sensory quality, and ensure food safety. Summary of the Invention
[0005] In view of the deficiencies of the prior art, the present invention proposes a method for predicting the thawing degree and end point of beef based on ultrasonic technology. By innovatively combining ultrasonic detection technology with advanced machine learning algorithms, a high-precision beef thawing prediction model is developed, providing key technical support for intelligent food production systems, and having significant theoretical significance and practical application value.
[0006] To achieve the above objectives, the following technical solutions are adopted in the present invention:
[0007] A method for predicting the thawing degree and end point of beef based on ultrasonic technology, comprising the following steps:
[0008] Step (1) Sample Preparation
[0009] S1: Select fresh beef tenderloin that meets national quarantine standards;
[0010] S2: After removing the surface fat, fascia and connective tissue, cut it into cubes with a side length of N cm along the muscle fiber direction to obtain beef sample T1, which contains Q sub-samples, denoted as Q1, Q2,... Qn in sequence, where n is a positive integer not less than 10;
[0011] S3: Freeze sample T1 to ensure that the central temperature drops to ≤ -15 °C to form a uniform ice crystal structure, and obtain the frozen sample, denoted as sample T2, which also contains Q sub-samples, denoted as Q1-1, Q2-2,... Qn-n in sequence, for subsequent signal acquisition;
[0012] Preferably, in S2 of step (1), the value of the side length N is 20 - 30 cm; the value range of n is 10 - 30.
[0013] Step (2) Signal Acquisition
[0014] S1: The signal acquisition device includes a host computer, an ultrasonic flaw detector and a thermal imager; among them, the host computer is electrically connected to the ultrasonic flaw detector and the thermal imager to realize signal transmission and control;
[0015] Preferably, in S1 of step (2), the host computer is a computer (Intel i7 processor, 8GB memory); the ultrasonic flaw detector is a CTS-9006PLUS ultrasonic flaw detector, and the probe is an immersion probe with a frequency of 2.5 MHz and a diameter of 20 mm, and the specific model is 2.5Z20SJ immersion probe; the thermal imager is a Fotric326 thermal imager.
[0016] S2: Sampling is carried out based on the signal acquisition device: Ultrasonic signal acquisition is carried out according to sample T2 (n sub-samples) obtained in S3 of step (1); first, place Q1-1 in sample T2 in water; within the thawing cycle T time, ultrasonic signal acquisition is carried out every t min. Among them, the ultrasonic signal data collected in the initial 0 - t is denoted as X1, and the ultrasonic sound velocity signal data is denoted as X1-1; similarly, Q2-2,... Qn-n are measured at intervals of t min in sequence to obtain the corresponding ultrasonic signal data denoted as X2,... Xn, and the ultrasonic sound velocity signal data denoted as X2-2,... Xn-n;
[0017] Preferably, in S2 of step (2), the value of T is 20 - 30 min, and the interval t is 2 - 3 min.
[0018] Preferably, the specific operation of ultrasonic signal acquisition in S2 of step (2) is as follows: insert the probe of the ultrasonic flaw detector into the water submerging the sample without contacting the sample, then use the ultrasonic flaw detector to send an electrical signal, which is first transmitted to the ultrasonic probe, and then the probe converts it into ultrasonic waves through the piezoelectric effect and emits them to the sample; when the ultrasonic waves encounter the interfaces of different media inside the sample, reflections will occur. The reflected waves are received by the probe and further converted into electrical signals through the piezoelectric effect and sent back to the ultrasonic flaw detector, and then transmitted to the host computer, thus completing the acquisition of the ultrasonic signal and the sound velocity signal of the sample.
[0019] S3: Take out the sample for which ultrasonic signal acquisition is completed in S2 from the water, perform surface cutting along its center to obtain the cut sample; then use the Fotric 326 thermal imager to scan the cross-section of the sample after Q1-1 cutting to obtain thermal imaging data, denoted as R1; similarly, scan Q2-2,...Qn-n in sequence, and the corresponding thermal imaging data are denoted as R2,...Rn respectively.
[0020] Step (3) Signal preprocessing
[0021] S1: Based on the data X1-Xn collected in S2 of step (2), first use differential operation to calculate the change rate or approximate slope of each point, and identify and exclude outliers that appear as abnormally steep curves on the graph by setting a derivative threshold; then, use Fourier transform to convert the signal from the time domain to the frequency domain, and accurately identify and remove outliers based on the spectral characteristics of the single peak of the normal signal and the extra-high amplitude peak of the abnormal signal to obtain the ultrasonic signal data after removing outliers, denoted as Z1-Zn; subsequently, use the empirical mode decomposition (EEMD) technique to filter Z1-Zn to obtain the filtered data, denoted as C1-Cn;
[0022] Preferably, the operation of filtering in S1 of step (3) is as follows: EEMD is based on the empirical mode decomposition (EMD). White noise is introduced into Z1-Zn, and then each dataset after adding noise is decomposed by EMD. Finally, all the added-noise intrinsic mode functions (IMFs) are averaged to obtain the final IMF (this method can retain the key attributes of the ultrasonic signal during the beef thawing process, and effectively remove noise through the selective reconstruction and recombination of relevant IMFs), that is, the C1-Cn data after completing filtering is obtained.
[0023] S2: Based on the data X1-1-Xn-n collected in S2 of step (2), use the window moving average method covering B data points to perform sound velocity denoising on the X1-1-Xn-n data. The ultrasonic sound velocity data after sound velocity denoising is denoted as K1-Kn, where B is a positive integer;
[0024] Preferably, in S2 of step (3), the value of B is 5 - 8.
[0025] Quantification of the freezing degree in step (4)
[0026] S1: According to the thermal imaging data R1 - Rn obtained in S3 of step (2), save the data in the.IR format and import it into the AnalyZIR software built into the host computer. Set the ice - water phase change threshold in the software to generate the temperature gradient maps V1 - Vn of the sample cross - section, and save them in the.PNG format;
[0027] Preferably, in S1 of step (4), the ice - water phase change threshold is 2°C.
[0028] S2: Use the Python image processing library to achieve automatic calculation of the thawing area.
[0029] First, convert the V1 - Vn obtained in S1 of step (4) into a binary image through Otsu threshold segmentation, and combine Gaussian filtering to remove noise (to highlight the difference between the thawed area and the non - thawed area); then, use the four - neighborhood connected component labeling method to identify the effective thawed area, filter out small - area noise, and accurately screen out the real thawed area; then, use the Canny edge detection and Douglas - Peucker algorithm to extract the contour, calculate the Euclidean distance to evaluate the edge features, so as to accurately outline the boundary of the thawed area; finally, calculate the thawing rate based on the pixel - area conversion relationship (when the beef temperature reaches 2°C, it can be considered that the thawing process has been completed physically). The specific calculation formula is as follows:
[0030]
[0031] A i is the area of the i - th connected region, A 总 is the total cross - sectional area (the core of this method is to convert the thawing state of beef into a quantifiable area ratio through the key indicator of temperature);
[0032] According to the formula, the scanning data R1 - Rn is converted into the corresponding thawing rates, and the thawing rates are respectively labeled as Y1 - Yn;
[0033] Model establishment in step (5)
[0034] S1: Based on steps (3) and (4), the input data C1 - Cn, K1 - Kn and their corresponding thawing rate data Y1 - Yn are obtained. Use them as the input data and labels of the machine learning model respectively to implement the binary regression model of ultrasonic signal and ultrasonic sound speed; that is, establish the binary mapping relationship between the input data C1 - Cn, K1 - Kn and the thawing rate data Y1 - Yn, and create an independent data set A1;
[0035] Repeat the operations in steps (1) to (4) to obtain Y groups of input data and their corresponding thawing rate data, and then establish Y groups of data sets, denoted as A2, …, AY. Import the Y groups of data sets into an Excel spreadsheet and integrate them. Denote the integrated data set as M. At the same time, divide M into a training set and a test set proportionally for convenient subsequent calling in Python.
[0036] S2: Select to combine ultrasonic signals and ultrasonic velocity for prediction, and use Python to construct a learning model in combination with a learning algorithm; and train the learning model with the training set data to learn the binary mapping relationship between the input data C1-Cn, K1-Kn and the thawing rate data Y1-Yn; the evaluation of the performance of the learning model is judged by the coefficient of determination (R 2 ) and the root mean square error (RMSE). Finally, select the learning model with the best performance as the final model; and save it to a file in the.pkl format; in the Python environment, the pickle library can be used to load the model and make predictions.
[0037] Preferably, in S1 of step (5), the value of Y is 60-100; each data set is divided into a training set and a test set proportionally, where the proportion of the training set is 70-80%, and the remainder is used as the test set (Note: In step S1, the relationship quantity is expressed as: for any group of data such as Cr, Kr, its corresponding thawing rate data is Yr, 1≤r≤n, and a binary mapping relationship is formed by Cr, Kr and Yr).
[0038] Preferably, in S2 of step (5), the learning algorithms include K-Nearest Neighbor (KNN), Artificial Neural Network (ANN), Extra-Trees, and Light Gradient Boosting Machine (LightGBM); the basis for judgment is: the coefficient of determination (R 2 ) is used to measure the ability of the model to explain the data, and the closer its value is to 1, the higher the fitting degree of the model to the data; the root mean square error (RMSE) is used to measure the deviation between the predicted value and the true value of the model, and the smaller its value, the higher the prediction accuracy of the model.
[0039] Step (6) Practical model application
[0040] Select a sample to be tested, obtain the ultrasonic data of the sample according to the operations in steps (1) to (3), and substitute it into the final model constructed in step (6). Then, the corresponding thawing rate can be quickly predicted through the loaded model, realizing the acquisition of the thawing degree of the sample and the prediction of the end point.
[0041] Advantages of the present invention:
[0042] Ultrasonic testing technology has excellent penetration ability, high sensitivity, and non-invasive analysis characteristics. At the same time, machine learning algorithms, with their powerful data processing and pattern recognition capabilities, provide new possibilities for the application of ultrasonic testing technology in the food processing field. This invention combines ultrasonic technology and machine learning algorithms to propose a method for accurately predicting the thawing degree and end point of beef, optimizing the thawing process. Through the comprehensive ultrasonic signal and ultrasonic sound speed, automated data preprocessing, noise filtering, and abnormal data elimination are achieved, ensuring the continuity and accuracy of the data during the thawing process. The constructed prediction model exhibits excellent prediction ability, with R 2 exceeding 0.9, and some reaching 0.986, and the predicted RMSEP is only 0.239. Compared with the traditional timed thawing method, this model can accurately determine the thawing end point, avoid over-thawing or under-thawing, ensure uniform thawing of beef, and significantly improve the accuracy of thawing. This evaluation method not only ensures the uniformity of thawing, significantly improves the quality of products and food safety levels, but also brings innovative technical support to the beef processing industry.
[0043] The specific advantages are as follows:
[0044] Precise quantification: Through thermal imaging technology and image processing algorithms, this invention conducts real-time analysis of the temperature distribution of the beef cross-section, divides the thawing process into multiple quantitative stages, and thus realizes the precise quantification of the thawing degree of beef. This method not only provides reliable data support for the prediction model but also ensures the standardized management of the thawing process, effectively improving the product quality and thawing uniformity.
[0045] High-precision prediction: This invention uses ultrasonic signals and ultrasonic sound speed, combined with advanced machine learning algorithms (such as KNN, ANN, Extra-Trees, LightGBM), to establish a beef thawing prediction model, achieving high-precision prediction of the thawing degree of beef. The determination coefficient of the model can be as high as 0.986, and the prediction error is significantly reduced.
[0046] Non-destructive real-time monitoring: Through the organic integration of ultrasonic testing technology and thermal imaging technology, the system realizes real-time online monitoring of the beef thawing process without destroying the sample, effectively ensuring the continuity and accuracy of data collection, and at the same time avoiding the damage to the sample by traditional detection methods.
[0047] Optimizing thawing uniformity: By accurately predicting the thawing end point of beef, the thawing uniformity is significantly improved, effectively preventing the loss of taste, color, and nutritional components caused by over-thawing or under-thawing, and ensuring the high-quality flavor and edible safety of beef. Brief Description of the Drawings
[0048] Figure 1 It is a schematic diagram of the operation process of the embodiment of this invention.
[0049] Figure 2 Schematic diagram of the signal acquisition device.
[0050] Figure 3 Outlier rejection: (a) Normal data is applied with differential operation; (b) Baseline-offset data is applied with differential operation; (c) Signal-distorted data is applied with differential operation; (d) Normal data is applied with Fourier transform; (e) Baseline-offset data is applied with Fourier transform; (f) Signal-distorted data is applied with Fourier transform.
[0051] Figure 4 In which, (a) is the comparison chart of EEMD filtering; (b) is the spectrum comparison chart of EEMD decomposition and each IMF component.
[0052] Figure 5 In which, (a) is the original ultrasonic sound velocity waveform chart; (b) is the ultrasonic sound velocity waveform chart after denoising.
[0053] Figure 6 It is a quantization example chart for beef thawing.
[0054] Figure 7 Model performance comparison, in which (a) is KNN; (b) is ANN; (c) is Extra-Trees; (d) is LightGBM. Specific implementation mode
[0055] The present invention is more elaborately explained and interpreted through the following implementation examples. It should be clear that the said examples are only for illustrative purposes, and the protection scope of the present invention should not be limited or restricted by these examples.
[0056] It should be understood that the terms described in the present invention are only used to describe specific implementation modes, rather than aiming to limit the protection scope of the present invention. Unless otherwise clearly stated, all technical and scientific terms used herein have the same meanings and connotations as those commonly understood by those skilled in the art in the field described in the present invention.
[0057] Although the present invention only describes in detail the preferred methodologies and materials, any methods and materials similar or equivalent to those described herein can also be used during the implementation or experimental verification of the present invention. All documents mentioned in this specification are incorporated herein by reference to disclose and elaborate on the methodologies and / or materials related to the said documents. The raw materials and reagents described in the present invention can be obtained through commercial channels or conventional means. If there are any conflicts or inconsistencies between the cited documents and this specification, the content of this specification shall prevail.
[0058] Example 1:
[0059] (1) Preparation of beef samples
[0060] Fresh beef tenderloin meeting national quarantine standards was purchased from the market, and its surface fat, fascia, and connective tissues were carefully removed. The processed beef tenderloin was cut into 10 cubes with a length, width, and height of 25 cm, thus forming beef sample T1 (the 10 sub-samples were respectively denoted as Q1, Q2,..., Q10).
[0061] The beef sample T1 was placed in a -18°C freezer and frozen for 24 hours. During the freezing period, with the aid of a temperature monitoring device, it was ensured that the central temperature of the sample remained at ≤ -15°C, prompting the formation of a uniform ice crystal structure in the T1 sample. The frozen sample was denoted as T2 (the 10 sub-samples were respectively denoted as Q1-1, Q2-2,..., Q10-10), which was used for subsequent signal measurement.
[0062] (2) Selection of ultrasonic probe
[0063] S1: In this invention, longitudinal wave straight probe, transverse wave oblique probe, longitudinal wave oblique probe, and immersion probe were compared. Finally, the immersion probe was selected because it can be adapted to the water coupling agent used in the beef thawing process and has a relatively high acoustic impedance matching degree with water.
[0064] S2: Probes of 1 MHz, 2.5 MHz, 5 MHz, and 10 MHz were screened. The resolution of the 1 MHz probe was insufficient. Although the 5 MHz and 10 MHz probes had relatively high resolution, the ultrasonic attenuation was relatively significant. In contrast, the 2.5 MHz probe performed best in waveform capture and data acquisition.
[0065] S3: In the selection of the probe diameter, a smaller diameter improved the resolution but had poor penetration; a larger diameter increased the length of the near-field region, thus reducing the resolution. Through preliminary experiments on 2.5 MHz probes with diameters of 10 mm, 15 mm, and 20 mm, the results showed that the 2.5 MHz probe with a diameter of 20 mm had the best detection effect.
[0066] Therefore, a 2.5 MHz, 20 mm diameter immersion probe (model 2.5Z20SJ) was finally selected for subsequent operations.
[0067] (3) Data acquisition
[0068] S1: The signal acquisition device includes a host computer, an ultrasonic flaw detector, and a thermal imager; among them, the host computer is electrically connected to the ultrasonic flaw detector and the thermal imager to achieve signal transmission and control (such as Figure 2 )
[0069] Among them, the host computer is a computer (Intel i7 processor, 8GB memory); the ultrasonic flaw detector is a CTS-9006PLUS ultrasonic flaw detector, the probe is an immersion probe with a frequency of 2.5MHz and a diameter of 20mm, and the specific model is 2.5Z20SJ immersion probe; the thermal imager is a Fotric326 thermal imager.
[0070] S2: Take the sample T2 obtained in step (1). This sample contains 10 sub-samples. The sub-samples to be measured are sequentially placed in a water bath cup. During the thawing cycle of 0 - 20 minutes, for sub-samples Q1 - Q10, the gradient acquisition method is used, and ultrasonic signal acquisition is performed every 2 minutes.
[0071] The specific operation is as follows: When the thawing cycle is within 0 - 2 minutes, operate the ultrasonic flaw detector and click the "signal acquisition button" on it. The flaw detector emits an electrical signal that is transmitted to the ultrasonic probe. The probe converts the electrical signal into ultrasonic waves through an internal mechanism and emits them to sub-samples Q1 - 1 in the sample to be measured area. When encountering different medium interfaces, reflections will occur. The probe receives the reflected wave, and through the internal mechanism, the reflected wave is converted back into an electrical signal and transmitted back to the flaw detector to complete the signal acquisition of sub-samples Q1 - 1. The ultrasonic signal data collected is recorded as X1, and the ultrasonic sound velocity data is recorded as X1 - 1; similarly, Q2 - 2,... Q10 - 10 are measured, and the corresponding ultrasonic signal data is sequentially recorded as X2,... X10, and the ultrasonic sound velocity data is sequentially recorded as X2 - 2,... X10 - 10.
[0072] S3: After the ultrasonic signal data is collected in step S2, take out the collected Q1 sub-sample from the water bath cup, and use a cutter to perform a planar cut along the center of the sub-sample. After cutting, use the Fotric 326 thermal imager to scan the cut cross-section. After the scan is completed, record the data obtained by the thermal imager as R1; similarly, scan Q2 - 2,... Q10 - 10 in sequence, and the corresponding thermal imaging data is recorded as R2,... R10.
[0073] (4) Data processing
[0074] S1: According to the data signals X1 to X10 collected in step (4). First, calculate the change rate or approximate slope of each data point, set a derivative threshold, and identify and exclude the outliers with abnormally steep graphs; then, through Fourier transform, convert the signal from the time domain to the frequency domain, and use the characteristics of the single peak of the normal signal and the extra-high amplitude peak in the abnormal signal to further accurately remove the outliers. The data signals after removing the outliers are denoted as Z1 - Z10 pairs Figure 3 (a), (b) and (c) analysis shows that, Figure 3 (b) represents the baseline offset data, showing an obvious steep peak, and the derivative value greatly exceeds Figure 3(a) The derivative value of normal data. On the contrary, Figure 3 (a) and (c) show that the peak values of the derivative values of normal data and signal distortion data are basically equivalent. Therefore, this method is applicable to excluding baseline shift anomalies.
[0075] Similarly, for Figure 3 (d), (e) and (f), the analysis shows that, as Figure 3 (d) shows, the Figure 3 (f) describing the signal distortion data shows three obvious peaks within the frequency range, and the amplitudes are much larger than those of the normal data. In contrast, Figure 3 (d) and (e) show that the spectral patterns of normal data and baseline shift data are consistent, effectively excluding signal distortion anomalies.
[0076] Next, the EEMD technique is used to filter Z1-Z10. Based on EMD, white noise is introduced into the data signals Z1 to Z10 and decomposed. After averaging all the IMFs after adding noise, the final IMF is obtained, retaining the key attributes of the ultrasonic signal and removing high-frequency noise. The data after filtering is denoted as C1-C10. As Figure 4 shown, the noise of the filtered C1-C10 is significantly reduced, highlighting the efficiency of EEMD in extracting relevant signal components from noisy data.
[0077] S2: Based on the data signals X1-1 to X10-10 collected in step (4), the moving average method covering 5 data points is used to perform sound speed denoising on X1-1 to X10-10, calculating the average value of each data point and its adjacent data points, effectively smoothing the random fluctuations in the data and stabilizing the time series data. As Figure 5 shown, the smoothness of the data is significantly improved. The ultrasonic signals after preprocessing are denoted as K1-K10.
[0078] (5) Thawing degree quantification
[0079] S1: Save the scan data R1 to R10 obtained in step (4) as an.IR format file and import it into the AnalyZIR software. Set 2°C as the ice-water phase change threshold in the software, and the software will automatically generate a temperature gradient map of the sample cross-section. Save the generated temperature gradient map as a.PNG format, and the saved result is prepared for subsequent image processing; as Figure 6 It can be observed that the progressive temperature change of beef from the periphery to the core. Initially, the outer layer starts to thaw, and the color changes from dark blue to light blue, and finally becomes yellow (2°C), indicating the completion of thawing.
[0080] S2: Implement the automatic calculation of the thawed area with the help of the Python image processing library. First, use the Otsu threshold segmentation method to convert the grayscale image into a binary image, and combine it with Gaussian filtering to remove noise, highlighting the difference between the thawed and unfrozen areas. Then, use the four-neighborhood connected component labeling method to identify the effective thawed area, remove small-area noise, and accurately determine the true thawed area. Next, extract the contour of the thawed area through the Canny edge detection and Douglas-Peucker algorithms, calculate the Euclidean distance to evaluate the edge features, and finally outline the boundary of the thawed area. Finally, calculate the thawing rate of R1-R10 according to the conversion relationship between pixels and area, denoted as Y1-Y10. As Figure 6 , the quantified thawing rates are: 0%, 12.42%, 19.04%, 31.16%, 41.33%, 57.29%, 72.06%, 82.84%, 93.45%, 100%.
[0081] (6) Model construction
[0082] S1: According to steps (4) and (5), obtain the preprocessed signals C1-C10, K1-K10 and their corresponding thawing rates Y1 to Y10, establish a binary mapping relationship between the input data C1-C10, K1-K10 and the thawing rate data Y1-Y10, and create 1 dataset A1; repeat the operations of steps (1), (3) to (5) to obtain the input data and thawing rate data, and establish 79 more datasets (constructed in the same way as dataset A1), denoted as A2-A80, and then integrate the 80 sub-datasets and import them into an Excel table denoted as M. Divide M into a training set according to 70% and the remaining 30% as a test set.
[0083] S2: Use the ultrasonic signal + sound velocity signal for prediction. Call four machine learning algorithms, KNN, ANN, Extra-Trees and LightGBM, in Python to construct a binary regression prediction model. Use R 2 and RMSE to evaluate the model performance. After model training and testing, the results are as shown in Table 1:
[0084] Table 1 Results of the prediction model
[0085]
[0086] The results show that the dataset combining the ultrasonic signal and ultrasonic velocity achieves relatively good prediction effects under the four algorithms, and the R 2 is all over 0.9. Among them, the R 2 of the KNN algorithm is the highest, reaching 0.96, and the RMSE is the lowest, being 0.6, showing strong prediction performance. Figure 7It is the fitting effect diagram of the model. The models predicted by the four algorithms all show a high fitting effect, and the KNN model has the best fitting effect.
[0087] (7) Model application
[0088] Select the best model KNN, save the model in the.pkl format to a file. In Python, you can use pickle to load the model for application.
[0089] Randomly select two groups of exactly the same beef samples to be thawed, with 10 samples in each group. One group is used for the traditional thawing method with controlled time, and the other group is used for the model prediction of the present invention.
[0090] Similarly, for the model prediction samples, complete signal acquisition and data preprocessing in sequence and import them into the model to obtain the thawing degree. The comparison results are shown in Table 2. The thawing temperatures of the control group samples vary greatly, the average temperature fluctuates significantly, and the variance is 12.314, indicating that the traditional method is difficult to ensure uniform thawing and is prone to problems such as partial over-thawing or under-thawing. While the average temperature of the experimental group is relatively stable, and the variance is only 0.239, which can ensure uniform thawing of beef.
[0091] Table 2 Thawing end-point temperature results under the traditional method and the prediction model method
[0092]
[0093] Therefore, the present invention has developed an accurate non-destructive method that uses ultrasonic technology combined with machine learning algorithms to determine the thawing degree of beef. By quantifying the thawing process, integrating ultrasonic signals and velocity data, an effective model for predicting the thawing end-point is constructed. The Rp of all model accuracies 2 are all greater than 0.9. This method greatly reduces the problems related to under-thawing or over-thawing. This method provides an effective solution for optimizing the beef thawing process in food production and automated systems.
[0094] Note: The above embodiments are only used to illustrate the present invention and do not limit the technical solutions described in the present invention; therefore, although this specification has described the present invention in detail with reference to the above respective embodiments, those of ordinary skill in the art should understand that the present invention can still be modified or equivalently replaced; and all technical solutions and their improvements that do not depart from the spirit and scope of the present invention shall be covered within the scope of the claims of the present invention.
Claims
1. A method for predicting the thawing degree and end point of beef based on ultrasonic technology, characterized in that, The steps are as follows: Step (1) Sample preparation: S1: Select fresh beef tenderloin that meets the national quarantine standards; S2: After removing the surface fat, fascia and connective tissue, cut it into cubes with side length N along the muscle fiber direction to obtain beef sample T1, which contains Q sub-samples, denoted as Q1, Q2,... Qn in sequence, where n is a positive integer not less than 10; S3: Freeze sample T1 to ensure that the central temperature drops to ≤ -15 °C to form a uniform ice crystal structure, and obtain the frozen sample, denoted as sample T2, which also contains Q sub-samples, denoted as Q1-1, Q2-2,... Qn-n in sequence, for subsequent signal acquisition; Step (2) Signal acquisition: S1: The signal acquisition device includes a host computer, an ultrasonic flaw detector and a thermal imager; among them, the host computer is electrically connected to the ultrasonic flaw detector and the thermal imager to realize signal transmission and control; S2: Sampling is carried out based on the signal acquisition device: Ultrasonic signal acquisition is carried out according to the sample T2 (n sub-samples) obtained in S3 of step (1); First, immerse Q1-1 in the sample T2 in water; within the thawing cycle T time, ultrasonic signal acquisition is carried out every t minutes. Among them, the ultrasonic signal data collected in the initial 0 - t is denoted as X1, and the ultrasonic sound velocity signal data is denoted as X1-1; Similarly, measure Q2-2,... Qn-n at intervals of t minutes in sequence to obtain the corresponding ultrasonic signal data denoted as X2,... Xn, and the ultrasonic sound velocity signal data denoted as X2-2,... Xn-n; S3: Take out the sample that has completed ultrasonic signal acquisition in S2 from the water, and perform surface cutting along its center to obtain the cut sample; Then use the Fotric 326 thermal imager to scan the cross-section of the sample after cutting Q1-1 to obtain thermal imaging data, denoted as R1; Similarly, scan Q2-2,... Qn-n in sequence to obtain the corresponding thermal imaging data denoted as R2,... Rn; Step (3) Signal preprocessing: S1: Based on the data X1 - Xn collected in S2 of step (2), first use differential operation to calculate the change rate or approximate slope of each point, and by setting the derivative threshold, identify and exclude the outliers that appear as abnormally steep curves on the graph; Then, use Fourier transform to convert the signal from the time domain to the frequency domain, and accurately identify and remove the outliers according to the spectral characteristics of the single peak of the normal signal and the extra-high amplitude peak of the abnormal signal to obtain the ultrasonic signal data after removing the outliers, denoted as Z1 - Zn. Subsequently, use empirical mode decomposition technology to filter Z1 - Zn to obtain the filtered data, denoted as C1 - Cn; S2: Based on the data X1-1 - Xn-n collected in S2 of step (2), use the window moving average method covering B data points to perform sound velocity denoising on the X1-1 - Xn-n data. The ultrasonic sound velocity data after sound velocity denoising is denoted as K1 - Kn, where B is a positive integer; Step (4) Freezing degree quantification: S1: Based on the thermal imaging data R1-Rn obtained in S3 of step (2), save the data in the.IR format and import it into the AnalyZIR software built into the host computer. Set the ice-water phase change threshold in the software to generate the temperature gradient maps V1-Vn of the sample cross-section, and save them in the.PNG format; S2: Use the Python image processing library to achieve automatic calculation of the thawed area: First, convert the V1-Vn obtained in S1 of step (4) into a binary image through Otsu threshold segmentation, and remove noise by combining Gaussian filtering; then, use the four-neighborhood connected component labeling method to identify the effective thawed area, filter out small-area noise, and accurately screen out the real thawed area; then, use the Canny edge detection and Douglas-Peucker algorithm to extract the contour, calculate the Euclidean distance to evaluate the edge features, so as to accurately outline the boundary of the thawed area; finally, calculate the thawing rate based on the pixel-area conversion relationship. The specific calculation formula is as follows: A i is the area of the i-th connected region, A 总 is the total cross-sectional area; Convert the scan data R1-Rn into the corresponding thawing rates according to the formula, and label the thawing rates as Y1-Yn respectively; Step (5) Model establishment: S1: Based on steps (3) and (4), obtain the input data C1-Cn, K1-Kn and their corresponding thawing rate data Y1-Yn, and use them as the input data and labels of the machine learning model respectively to implement a binary regression model of ultrasonic signal and ultrasonic sound speed; that is, establish a binary mapping relationship between the input data C1-Cn, K1-Kn and the thawing rate data Y1-Yn, and create an independent data set A1; Repeat the operations in steps (1) to (4) to obtain Y groups of input data and their corresponding thawing rate data, and then establish Y groups of data sets, denoted as A2,..., AY. Import the Y groups of data sets into an Excel table and integrate them. Denote the integrated data set as M, and at the same time divide M into a training set and a test set in proportion for convenient subsequent calling in Python; S2: Select to combine ultrasonic signals and ultrasonic velocities for prediction, and use Python to build a learning model in combination with learning algorithms; and train the learning model with the training set data to learn the binary mapping relationship between the input data C1-Cn, K1-Kn and the thawing rate data Y1-Yn; The performance of the learning model is evaluated by the coefficient of determination and the root mean square error, and finally the learning model with the best performance is selected as the final model; And save it to a file in the.pkl format; in the Python environment, you can use the pickle library to load the model and make predictions; Step (6) Practical model application: Select the sample to be tested, obtain the ultrasonic data of the sample according to the operations in steps (1) to (3), and substitute it into the final model constructed in step (6). Then, the corresponding thawing rate can be quickly predicted through the loaded model, realizing the acquisition of the thawing degree of the sample and the prediction of the end point.
2. The method for predicting the thawing degree and end point of beef based on ultrasonic technology according to claim 1, wherein, In S2 of step (1), the value of the side length N is 20-30 cm; the value range of n is 10-30.
3. A method for predicting the thawing degree and end point of beef based on ultrasonic technology according to claim 1, characterized in that, In step S1 of (2), the host computer is a computer; the ultrasonic flaw detector is a CTS-9006PLUS ultrasonic flaw detector, the probe is an immersion probe with a frequency of 2.5MHz and a diameter of 20mm, and the specific model is 2.5Z20SJ immersion probe; the thermal imager is a Fotric326 thermal imager.
4. A method for predicting the thawing degree and end point of beef based on ultrasonic technology according to claim 1, characterized in that, In step S2 of (2), the value of T is 20 - 30min, and the interval t is 2 - 3min.
5. A method for predicting the thawing degree and endpoint of beef based on ultrasonic technology according to claim 1, characterized in that, In step S2 of (2), the operation of ultrasonic signal acquisition is as follows: insert the probe of the ultrasonic flaw detector into the water submerging the sample without contacting the sample, then use the ultrasonic flaw detector to send an electrical signal, which is first transmitted to the ultrasonic probe, and then the probe converts it into ultrasonic waves through the piezoelectric effect and emits them to the sample; when the ultrasonic waves encounter the interfaces of different media inside the sample, reflections will occur, the reflected waves are received by the probe, and further converted into electrical signals through the piezoelectric effect and sent back to the ultrasonic flaw detector, and then transmitted to the host computer, thus completing the acquisition of the ultrasonic signal and the sound velocity signal of the sample.
6. The beef thawing degree and end point prediction method based on ultrasonic technology according to claim 1, wherein In step S1 of (3), the operation of filtering processing is as follows: based on empirical mode decomposition, white noise is introduced into Z1 - Zn in EEMD, then EMD decomposition is performed on each dataset after adding noise, and finally all the added-noise intrinsic mode functions are averaged to obtain the final IMF, that is, the C1 - Cn data after filtering is obtained.
7. A method for predicting the thawing degree and end point of beef based on ultrasonic technology according to claim 1, characterized in that, In step S2 of (3), the value of B is 5 - 8.
8. A method for predicting the thawing degree and end point of beef based on ultrasonic technology according to claim 1, characterized in that, In step S1 of (4), the ice-water phase change threshold is 2℃.
9. A method for predicting the thawing degree and end point of beef based on ultrasonic technology according to claim 1, characterized in that, In step S1 of (5), the value of Y is 60 - 100; each dataset is divided into a training set and a test set according to a certain proportion, where the training set accounts for 70 - 80%, and the rest is used as the test set.
10. A method for predicting the thawing degree and end point of beef based on ultrasonic technology according to claim 1, characterized in that, In step S2 of (5), the learning algorithms include K-nearest neighbor, artificial neural network, extremely randomized tree, and light gradient boosting machine; the basis for judgment is as follows: the coefficient of determination is used to measure the ability of the model to explain the data, and the closer its value is to 1, the higher the fitting degree of the model to the data; the root mean square error is used to measure the deviation between the predicted value and the true value of the model, and the smaller its value, the higher the prediction accuracy of the model.