A method and system for constructing an automatic pork meat quality pH nondestructive determination model based on hyperspectral imaging
Patent Information
- Application Number
- CN202511491141.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-18
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2045-10-18
AI Technical Summary
现有高光谱图像分析中通常需要手工在图像中选取感兴趣区域(ROI),或者将样本修剪为特定形状,该过程不仅耗时,而且阻碍了检测流程的自动化;
[0014]有益效果:本发明通过自动化的图像与光谱处理流程,结合基于局部连接层的深度学习模型,实现了猪肉pH值的高精度、快速预测。无需人工干预即可提取目标光谱,并通过改进神经网络结构显著提升了预测性能。该方法适用于肉类品质无损检测领域,具有较高的实用价值和推广意义。
Smart Images

Figure CN121305355B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image recognition technology, specifically relating to an automated method and system for constructing a non-destructive pH measurement model for pork meat based on hyperspectral imaging. Background Technology
[0002] The pH value of pork is one of the important indicators for evaluating meat quality. Traditional methods of determination usually require chemical analysis in a laboratory, which is both damaging to the sample and time-consuming. In recent years, hyperspectral imaging (HSI), as a non-destructive testing technology that integrates spectroscopy and imaging, has been widely used in food quality testing. Hyperspectral imaging can simultaneously acquire the reflectance spectral information and spatial distribution of a sample at various wavelengths without contact, enabling rapid and comprehensive quality assessment. Existing studies often use methods such as partial least squares regression (PLSR) and support vector regression (SVR) to quantitatively analyze hyperspectral data. However, these traditional methods usually rely heavily on spectral preprocessing and have limited model accuracy. To improve accuracy, the academic community has begun to introduce deep learning methods, especially structures such as one-dimensional convolutional neural networks (1DCNN), to learn predictive models directly from hyperspectral data. However, due to the high dimensionality and limited sample size of hyperspectral data, traditional CNNs often require a large number of parameters and are prone to overfitting. In addition, it is usually necessary to manually crop the meat samples or manually select the Region of Interest (ROI) to extract spectral features, which presents the following problems: (1) Target region segmentation relies on manual labor. Current hyperspectral image analysis usually requires manually selecting regions of interest (ROI) in the image or cropping samples into specific shapes. This process is not only time-consuming, but also hinders the automation of the detection process; (2) Traditional spectral modeling has low accuracy. Existing spectral modeling methods have limited accuracy in predicting meat characteristics (such as pH value), making it difficult to meet the requirements for accurate detection; (3) Insufficient data preprocessing. Hyperspectral image data is susceptible to interference from instrument dark current and ambient light, requiring preprocessing such as black and white plate correction. However, the existing technology often fails to adequately handle these noise interferences, resulting in the raw spectral data containing a lot of noise. (4) Hyperspectral images are subject to severe noise interference. Due to sensor thermal noise and quantization noise, hyperspectral images generally have significant noise. If preprocessing is insufficient, the noise will directly lead to distortion of spectral features and affect the accuracy of analysis. (5) Convolutional neural networks cannot effectively capture spectral order information. For hyperspectral data, each band has a unique pattern, and the values of the spectral curve in different bands are highly dependent on its position. Position information is crucial for spectral feature modeling. However, existing hyperspectral curve analysis methods based on 1d CNNs have the inherent characteristic of shared parameters in convolutional kernels, making it difficult to capture position-dependent features when performing sliding convolutions on the data. Therefore, the prediction accuracy of 1d CNN methods is limited.
[0003] Therefore, how to automatically extract spectra and improve prediction accuracy without human intervention is a problem that existing technologies urgently need to solve. Summary of the Invention
[0004] To overcome the above shortcomings, this invention discloses an automated method and system for constructing a non-destructive pH measurement model for pork meat based on hyperspectral imaging. It aims to improve the accuracy and automation of pork pH measurement through technical approaches such as automated ROI selection algorithm, improved data preprocessing and denoising process, and construction of a deep learning network that takes into account both spectral and spatial features.
[0005] To achieve the above objectives, the first technical solution of this application discloses a method for constructing an automated non-destructive pH determination model for pork meat based on hyperspectral imaging, comprising the following steps: S1. Automatic Spectral Extraction: Acquire hyperspectral images of fresh pork and process them automatically to obtain image spectral curve data; S2. Spectral preprocessing: The spectral curves are sequentially subjected to Savitzky-Golay smoothing filtering, standard normal transformation, and first derivative calculation to obtain the preprocessed ROI spectral curves; S3. Deep Learning Regression Model: The preprocessed spectral curve is used as input, and an improved deep neural network is used for regression to output the pH prediction value of the corresponding sample. The predicted value is paired with the measured pH value and multiple rounds of iterative training are performed until the loss converges, thus obtaining an automated non-destructive pH determination model for pork meat quality based on hyperspectral imaging; wherein the improved deep neural network contains at least one local connection layer.
[0006] Furthermore, the automated processing described in S1 includes removing invalid bands from the hyperspectral image to obtain a filtered image, then dividing the image by the first two bands to obtain a difference image, performing OTSU threshold segmentation on the difference image, performing morphological operations to obtain the foreground image after segmentation, calculating its integral image to locate the ROI region, obtaining the ROI hyperspectral image, and calculating the average value by band to obtain the image spectral curve.
[0007] Furthermore, the wavelength range of the hyperspectral image of fresh pork acquired in S1 is the reflectance spectrum of 1157-1977 nm.
[0008] Furthermore, the improved deep neural network is specifically as follows: The preprocessed spectral curve is first input into a local connection layer, wherein the local connection layer consists of several convolutional kernels with a local receptive field width of 7 that do not share weights. The number of convolutional kernels is equal to the number of input bands. Spectral features are specifically extracted, and then higher-order features are extracted through convolutional layers and pooling layers. Finally, the pH prediction value of the corresponding sample is output through a fully connected layer.
[0009] Furthermore, the multi-round iterative training uses smoothed L1 loss as the loss function and optimizes the parameters through the backpropagation algorithm.
[0010] And, based on the above model construction method, an automated non-destructive pH determination model for pork meat quality based on hyperspectral imaging.
[0011] Another technical solution of this application discloses an automated non-destructive method for determining the pH of pork meat based on hyperspectral imaging. The method uses the above-mentioned model for identification, specifically by inputting a hyperspectral image of the target pork, and after the model runs, outputting the pH data of the target pork.
[0012] Furthermore, an automated, non-destructive pH measurement system for pork meat based on hyperspectral imaging, comprising the aforementioned model, and used in the measurement method, comprising: Automatic spectral extraction module: used to acquire hyperspectral images of the target pork and automatically obtain the spectral curves of the images; Spectral preprocessing module: used to perform Savitzky-Golay smoothing filtering, standard normal transformation, and first derivative calculation on spectral curves; Deep learning regression module: used to process the preprocessed spectral image to obtain the pH value of the target pork.
[0013] And a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor being used in the system.
[0014] Beneficial Effects: This invention achieves high-precision and rapid prediction of pork pH value through an automated image and spectral processing workflow combined with a deep learning model based on local connection layers. Target spectra can be extracted without manual intervention, and the prediction performance is significantly improved by refining the neural network structure. This method is applicable to the field of non-destructive testing of meat quality and has high practical value and promotional significance. Attached Figure Description
[0015] Figure 1This is a schematic diagram of the overall process of the automated non-destructive pH determination method for meat described in this invention; Figure 2 This is a schematic diagram of the automatic spectral extraction described in this invention; Figure 3 This is a schematic diagram of the spectral preprocessing described in this invention; Figure 4 This is a visual comparison of the differences between the local connection layer and the traditional one-dimensional convolution in the deep learning regression model described in this invention. Figure 5 The results show a comparison of the pH measurement performance of different models. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0017] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of this application. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following drawings denote similar items; therefore, once an item is defined in one drawing, it need not be further discussed in subsequent drawings.
[0018] Unless otherwise specified, the technical terms in this specification have the same meaning as those generally understood by those skilled in the art; however, in case of any conflict, the definitions in this specification shall prevail.
[0019] Example 1: Construction of an automated, non-destructive model for determining the pH of pork meat based on hyperspectral imaging, such as... Figure 1 As shown, it includes the following steps: S1. Automatic Spectral Extraction: Acquire hyperspectral images of fresh pork and process them automatically to obtain image spectral curve data.
[0020] This application uses a near-infrared hyperspectral imaging device to scan and collect data from fresh pork samples. The imaging instrument has a wavelength range of 1157–1977 nm for reflectance spectra, with a total of 172 data bands. A total of 314 pork samples were collected in the experiment. After removing abnormal samples, 265 valid data points were retained for model training and testing.
[0021] Then, 265 valid data points were automatically processed to obtain image spectral curve data. For example... Figure 2 The diagram shown illustrates the automatic spectral extraction described in this invention, demonstrating how to automatically acquire spectral curve data of a sample.
[0022] (1) Invalid band removal: First, the obtained hyperspectral image of fresh pork (original hyperspectral image) is filtered by removing invalid bands: First, radiometric correction is performed on the acquired original hyperspectral data to convert the original signal into reflectance data. Depending on the equipment performance and analysis needs, bands with poor signal-to-noise ratio can be removed, and only valid bands can be retained to reduce the amount of computation. For example, in this implementation example, edge bands with excessively short and long wavelengths are removed, and 132 bands in the range of 1248~1881 nm are finally selected; this processing can reduce the data dimensionality.
[0023] (2) Image segmentation: The first and last band images of the hyperspectral image after filtering out invalid bands are divided to obtain the difference image. The difference image is segmented using the automatic OTSU algorithm to determine the threshold and binarize the image to separate the pork region from the background. Then, morphological operations (such as opening and closing operations) are performed on the binary image to remove scattered noise and fill the holes inside the meat to obtain the foreground image; the morphological operations can remove noise, and then the closing operation is performed to fill the holes, and then the process is iterated repeatedly to optimize the integrity of the region, etc.
[0024] (3) Calculate the spectral curve: Calculate the integral image of the segmented image (foreground image) and find the largest rectangular region that meets the conditions in the foreground (meat block) as the ROI. For example, in this example, calculate the 50*50 rectangular region in the foreground that is closest to the centroid of the meat block to ensure that the region of interest is located at the center of the meat block. Then, obtain the region data corresponding to the filtered hyperspectral image based on the ROI, calculate the average value of all pixels for each band as the representative spectral value of that band, and thus obtain a one-dimensional original spectral curve. This spectral curve represents the hyperspectral data of the pork sample.
[0025] S2. Spectral preprocessing: The spectral curves are sequentially subjected to Savitzky-Golay smoothing filtering, standard normal transformation, and first derivative calculation to obtain the preprocessed ROI spectral curves.
[0026] Specifically, the spectral data curves obtained from S1 are preprocessed sequentially. First, Savitzky-Golay (SG) smoothing filtering is applied, using a second-order polynomial to fit and smooth the spectrum over each band window (e.g., a window width of 11), reducing random noise in the spectrum. Then, a standard normal transformation is performed on the smoothed spectrum, i.e., subtracting the mean from each spectrum and dividing by the standard deviation, to eliminate baseline drift caused by scattering effects. Finally, the first derivative of the spectrum is calculated to highlight the curve slope information, helping to enhance the discernibility of weak absorption peaks. Figure 3 The diagram shown illustrates the spectral preprocessing of this application, which visualizes the changes in the spectral curves before and after preprocessing. It can be seen that this series of preprocessing steps can significantly improve the fitting effect of the subsequent regression model.
[0027] S3. Deep Learning Regression Model: The preprocessed spectral curve is used as input, and an improved deep neural network is used for regression to output the pH prediction value of the corresponding sample. The predicted value is paired with the measured pH value and multiple rounds of iterative training are performed until the loss converges, thus obtaining an automated non-destructive pH determination model for pork meat quality based on hyperspectral imaging; wherein the improved deep neural network contains at least one local connection layer.
[0028] Model Construction and Training: Using the preprocessed spectrum as input, a deep neural network is constructed for regression. Unlike traditional CNNs, the first layer of the network structure in this invention employs a locally connected layer. Its characteristic is that convolutional kernel weights are not shared, and each spectral location uses an independent filter. For example, assuming the first layer of the network is a locally connected layer, multiple filters with a local receptive field width of 3 are applied to the input one-dimensional spectral data. The filter weights at different locations are not shared, enabling the capture of location-specific spectral features. Further convolutional and pooling layers are then used to extract higher-order features. Finally, a fully connected layer outputs a single pH value prediction. The entire network uses Smooth L1 Loss as the loss function, and the parameters are optimized using the backpropagation algorithm. During training, the spectral data of the aforementioned effective samples are paired with measured pH values for multiple rounds of iterative training until the loss converges.
[0029] like Figure 4 The image shows a visual comparison of the differences between the local connection layer and the traditional one-dimensional convolution in the deep learning regression model described in this application. As can be seen from the image, the traditional one-dimensional convolution extracts the same feature patterns at different spectral band positions, and cannot extract and learn effective information from the band-specific spectral reflectance data. However, the local connection layer uses convolution kernels that do not share weights, meaning that the convolution kernel at each spectral band position is specific. This allows the local connection layer to effectively learn the band-specific information in the spectral curve, thereby better predicting the pH characteristics of the meat.
[0030] Example 2: Model Performance Comparison The model constructed in Example 1 was compared with traditional methods. Specifically, Partial Least Squares Regression (PLSR), Support Vector Machine Regression (SVR), Random Forest (RF), XGBoost, and traditional 1D CNN were used to process the same data. 265 images of pork directly taken from the longissimus dorsi muscle of pigs were used. Five-fold cross-validation was employed to validate the different models, and the mean of the five cross-validations was taken as the model performance evaluation result. Figure 5 The processing results are shown. The results indicate that the correlation coefficient (R) between the model-predicted pH and the measured pH reached 0.7, and the root mean square error (RMSE), mean absolute error (MAE), and mean percentage error (MAPE) were 0.21, 0.17, and 2.7%, respectively, significantly outperforming other models. This is because the local connection layer can learn more subtle local features in the spectrum, improving the model's generalization and fitting ability. These results demonstrate that the model proposed in this application can accurately predict the pH of pork meat under non-destructive conditions, and can be used to screen out substandard or potentially unsafe products such as PSE-prone meat and DFD-prone meat in advance, ensuring consumer safety. Furthermore, its objectivity and quantitative performance promote industry standardization in testing, provide data support for scientific research such as high-quality breeding and process optimization, and help the pork industry upgrade towards high-quality development.
[0031] Therefore, those skilled in the art will recognize that although embodiments of the present invention have been shown and described in detail herein, many other variations or modifications conforming to the principles of the present invention can be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Therefore, the scope of the present invention should be understood and recognized as covering all such other variations or modifications.
Claims
1. A method for constructing an automated, non-destructive pH determination model for pork meat based on hyperspectral imaging, characterized in that, Includes the following steps: S1. Automatic Spectral Extraction: Acquire hyperspectral images of fresh pork and process them automatically to obtain image spectral curve data; S2. Spectral preprocessing: The spectral curve data are sequentially processed by Savitzky-Golay smoothing filter, standard normal transformation and first derivative operation to obtain the preprocessed ROI spectral curve; S3. Deep Learning Regression Model: The preprocessed spectral curve is used as input, and an improved deep neural network is used for regression to output the pH prediction value of the corresponding sample. The predicted value is paired with the measured pH value and multiple rounds of iterative training are performed until the loss converges, thus obtaining an automated non-destructive pH determination model for pork meat quality based on hyperspectral imaging; wherein, the improved deep neural network contains at least one local connection layer. The automated processing described in S1 includes removing invalid bands from the hyperspectral image to obtain a filtered image, then dividing the image by the first two bands to obtain a difference image, performing OTSU threshold segmentation on the difference image, performing morphological operations to obtain the foreground image after segmentation, calculating its integral image to locate the ROI region, obtaining the ROI hyperspectral image, calculating the average value by band, and obtaining the image spectral curve. S1 describes the acquisition of hyperspectral images of fresh pork with a wavelength range of 1157-1977 nm for the reflectance spectrum. The improved deep neural network is specifically as follows: The preprocessed spectral curve is first input into a local connection layer, which consists of several convolutional kernels with a local receptive field width of 7 that do not share weights. The number of convolutional kernels is equal to the number of input bands. Spectral features are specifically extracted, and then higher-order features are extracted through convolutional and pooling layers. Finally, the pH prediction value of the corresponding sample is output through a fully connected layer.
2. The model construction method according to claim 1, characterized in that, The multi-round iterative training uses smooth L1 loss as the loss function and optimizes the parameters through the backpropagation algorithm.
3. An automated, non-destructive pH determination model for pork meat based on hyperspectral imaging, obtained by the model construction method described in claim 1 or 2.
4. An automated, non-destructive method for determining the pH of pork meat based on hyperspectral imaging, characterized in that, The identification is performed using the model described in claim 3. Specifically, the target pork hyperspectral image is input, and after the model described in claim 3 is run, the pH data of the target pork is output.
5. An automated, non-destructive pH measurement system for pork meat based on hyperspectral imaging, characterized in that, The device includes the model of claim 3 and is used to perform the measurement method of claim 4, comprising: Automatic spectral extraction module: used to acquire hyperspectral images of the target pork and automatically obtain the spectral curves of the images; Spectral preprocessing module: used to perform Savitzky-Golay smoothing filtering, standard normal transformation, and first derivative calculation on spectral curves; Deep learning regression module: used to process the preprocessed spectral image to obtain the pH value of the target pork.
6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor being configured to execute the system of claim 5.
Citation Information
Patent Citations
Pork quality index accurate determination method and system based on multi-modal spectrum fusion
CN120446045A
Systems and methods for recognizing objects in radar imagery
US20160019458A1