Intelligent detection system and method for pig meat quality

By using image recognition and CNN convolutional neural network technology, the boundary between muscle and fat on the surface of pork is identified, and the fat distribution characteristics are calculated. This solves the problems of low efficiency and high cost in traditional pork quality testing, and enables efficient quality assessment on the snowflake pork production line.

CN121032989APending Publication Date: 2025-11-28SICHUAN AGRI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511193214.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

Traditional pork quality testing methods are inefficient, subjective, and destructive. Existing intelligent testing technologies are susceptible to ambient light interference, cannot directly reflect internal components, and high-precision equipment is bulky and expensive, making it difficult to deploy on slaughter lines.

Method used

Image recognition technology is used to identify the boundary between muscle and fat on the surface of pork. Image features are extracted using a CNN convolutional neural network, and the fat distribution uniformity coefficient and area ratio are calculated to build an intelligent detection system for the quality assessment of marbled pork.

Benefits of technology

It enables continuous and rapid quality assessment on the snowflake pork production line, improving testing efficiency, reducing equipment costs, and minimizing subjectivity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121032989A_ABST
    Figure CN121032989A_ABST
Patent Text Reader

Abstract

The invention discloses a pig meat quality intelligent detection system and method, and the method comprises the steps: collecting a surface image of a snowflake pork piece, screening a boundary pixel combination located on a fat and muscle boundary according to a pixel gray value, and obtaining all muscle regions in a gray image region; calculating a fat area proportion and a fat distribution uniformity coefficient of the surface image; constructing a CNN convolutional neural network, training the CNN convolutional neural network, and outputting a convergent CNN convolutional neural network; the method comprises the following steps: acquiring surface images of snowflake pork produced on a snowflake pork production line in real time, inputting the surface images into a convergent CNN convolutional neural network, outputting a fat distribution uniformity coefficient and a fat area proportion, and evaluating the quality of the produced snowflake pork. The system comprises an image acquisition module, an image analysis and processing module and a display module. The method provides support for high-efficiency quality evaluation on the snowflake pork production line, and can realize continuous and rapid snowflake pork quality evaluation on the snowflake pork production line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent detection of pork quality, specifically to an intelligent detection system and method for pork quality. Background Technology

[0002] Snowflake pork stands out in the market for its unique texture and superior quality, earning its name from its comparison to snowflake beef. Well-known breeds such as the Iberian Black Pig and the Yihao Native Pig are typical examples, with intramuscular fat content exceeding 10%, a key indicator contributing to its tender, juicy, and flavorful characteristics. Traditional pork quality testing methods mainly rely on manual sensory evaluation or laboratory chemical analysis, which suffers from low efficiency, strong subjectivity, and significant destructiveness. While existing intelligent detection technologies such as near-infrared spectroscopy and machine vision have achieved rapid detection of some indicators, they still have the following shortcomings: spectral analysis is easily affected by ambient light interference, and machine vision cannot directly reflect internal components (such as intramuscular fat); feature extraction relies on manual design: traditional methods require manual selection of spectral bands or image features, easily missing crucial information; high-precision detection equipment (such as hyperspectral cameras) is bulky and costly, making it difficult to deploy on slaughter lines. Summary of the Invention

[0003] In view of the above-mentioned shortcomings of the prior art, the present invention provides a pork quality intelligent detection system and method, which can realize continuous and rapid pork quality detection from the pork production line.

[0004] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows: A method for intelligent detection of pork quality is provided, comprising the following steps: S1: Acquire a surface image of the snowflake pork chunks, and use the image selection tool to randomly select from the surface image. N Each sub-image region is divided into several distinct sub-image regions, and each sub-image region is converted to grayscale to obtain... N A grayscale image region; S2: Obtain the gray value corresponding to each pixel in the grayscale image region, filter the boundary pixel combinations located on the boundary between fat and muscle based on the pixel gray values, and calculate the boundary point coordinates corresponding to the boundary pixel combinations; S3: Obtain the set of pixel boundary points in the grayscale image region. By using the equation of the line connecting the pixel boundary points, the set of pixel boundary point coordinates corresponding to the boundary of the same muscle region is filtered to obtain all muscle regions within the grayscale image area. S4: Calculate the fat area ratio of the surface image and the fat distribution uniformity coefficient corresponding to the surface image based on the number of muscle pixels in the muscle region. S5: Using the fat area ratio and fat distribution uniformity coefficient as output features, construct a CNN convolutional neural network, use the CNN convolutional neural network to identify the image features of the surface image, train the CNN convolutional neural network, and output a converged CNN convolutional neural network. S6: Real-time acquisition of surface images of the snowflake pork produced on the snowflake pork production line, input into a convergent CNN convolutional neural network, outputting the fat distribution uniformity coefficient and fat area ratio to evaluate the quality of the produced snowflake pork.

[0005] Further, step S2 includes: S21: Set the standard grayscale value for muscle pixels Standard grayscale value of fat pixels ; S22: Calculate the grayscale standard deviation between muscle pixels and fat pixels. Set the pixel grayscale redundancy value for determining the boundary between muscle and fat. Construct the allowable grayscale difference range for determining the boundary between muscle and fat. ; S23: Obtain the gray value corresponding to each pixel in the grayscale image region. , x Let the pixel in the grayscale image region be numbered, and calculate the pixel numbering of any two pixels. grayscale value The difference ; S24: Determine the difference Does it fall within the range of grayscale difference? inside, if If so, proceed to step S25; If so, return to step S23 and continue to calculate the difference in grayscale values ​​between any two pixels; S25: Recalculate pixels pixel distance between And set a threshold for the distance between the muscle and fat boundaries. ; like Then determine the pixel Located at the pixel boundary between muscle and fat, the pixels As a combination of boundary pixels located at the boundary between fat and muscle; Otherwise, pixels If the pixel is not located on the boundary between muscle and fat, return to step S23; in, pixels Pixel coordinates; S26: Filter out all boundary pixel combinations located on the pixel boundaries between muscle and fat in the grayscale image region. And calculate the coordinates of the midpoint of each boundary pixel combination. , which serves as the coordinates of the pixel boundary points between muscle and fat in the grayscale image region; ; in, i This is the number of the pixel boundary point.

[0006] Further, step S3 includes: S31: Obtain the set of pixel boundary points in the grayscale image region. Based on the set of pixel boundary points Filter the set of pixel boundary point coordinates of any two pixel boundary points within the same muscle region boundary. , m Number the muscle regions present within the grayscale image area; Filter the set of pixel boundary point coordinates of the same muscle region boundary The objective function is: ; in, Set of pixel boundary point coordinates Any two pixel boundary points The pixel boundary point coordinates, Represents the coordinates of the pixel boundary point The equation of the straight line, The coordinates of the points passing through the pixel boundary are respectively The slope and intercept of the equation of the line. Indicates passing through two pixel boundary points All pixels on the line are muscle pixels. , For muscle pixels grayscale value, For muscle pixels Pixel coordinates; This is the error threshold for the grayscale values ​​of muscle pixels in the set grayscale image region. To filter the set of pixel boundary point coordinates of the same muscle region. The objective function; S32: After obtaining the set of pixel boundary point coordinates corresponding to the boundaries of all muscle regions in the grayscale image region, smoothly connect the corresponding pixel boundary point coordinates in each set of pixel boundary point coordinates to obtain all muscle regions in the identified grayscale image region.

[0007] Further, step S4 includes: S41: Based on the number of muscle pixels contained in each muscle region vCalculate the fat area ratio of the grayscale image region, and calculate the overall fat area ratio of the surface image corresponding to the snowflake pork block. ; ; in, n The numbering of the grayscale image region. For the first n The first gray image region m Number of muscle pixels in each muscle region s 0 represents the area of ​​a single pixel. The pixel area of ​​the grayscale image region. M This represents the number of muscle regions within the grayscale image area; S42: Utilize pixel area data of each muscle region within the grayscale image area. , For the first M The pixel area of ​​each muscle region , For the first n The first gray image region M Number of muscle pixels in each muscle region; S43: Based on the difference in pixel area between muscle regions within the grayscale image region, calculate the fat distribution uniformity coefficient corresponding to the surface image, and obtain the fat distribution uniformity coefficient corresponding to the surface image. ; ; in, For the first m The pixel area of ​​each muscle region For the first n The average pixel area of ​​the muscle region in a grayscale image region.

[0008] Further, step S5 includes: S51: Fat distribution uniformity coefficient and fat area percentage As the output features for recognizing surface images, a CNN convolutional neural network is constructed. The surface image is input into the CNN convolutional neural network to extract image features from the surface image. ; in, This is the output function of the CNN convolutional neural network. For CNN convolutional neural networks, k Number the convolution kernel. For the first k The weights of each convolutional kernel, For the first kThe bias of each convolution kernel Image features extracted by the convolution kernel; S52: Collect surface images of different marbled pork and perform steps S1-S4 to calculate the fat distribution uniformity coefficient corresponding to each surface image. and fat area percentage As output features, the surface image and the corresponding output features are used as training data; S53: Input the training data into the CNN convolutional neural network to train the CNN, iteratively optimizing the initial weights and biases of the convolutional kernels until... T After several iterations of optimization, the output is the optimal weights and biases that satisfy the iterative optimization objective function, resulting in a converged CNN convolutional neural network. Iterative optimization of the objective function for: ; The iterative optimization process of the convolution kernel weights and biases satisfies: ; in, The first t The weights and biases of the convolutional kernels obtained from the next iteration of optimization. The first t The weights and biases of the convolutional kernel obtained after -1 iterations of optimization. They are respectively T The weight set and bias set obtained from the next iteration of optimization These are the iteration optimization step sizes for the weights and biases, respectively. These are the outputs of the CNN convolutional neural network. These are the weighting coefficients for fat distribution uniformity and fat area percentage, respectively.

[0009] Further, step S6 includes: S61: Real-time acquisition of surface images of marbled pork produced on the marbled pork production line, input into a converged CNN convolutional neural network, outputting the fat distribution uniformity coefficient corresponding to the marbled pork surface image. and fat area percentage ; S62: Set the threshold for the fat distribution uniformity coefficient. and the threshold range of fat area percentage Using the fat distribution uniformity coefficient and fat area percentage Assess the quality of the produced marbled pork; like and If the quality is good, the produced snowflake pork will be of good quality; otherwise, the produced snowflake pork will be of poor quality.

[0010] A smart pork quality detection system is provided for performing the above-mentioned smart pork quality detection method, comprising: The image acquisition module is installed on the snowflake pork production line to acquire surface images of the produced snowflake pork in real time and send them to the image analysis and processing module. The image analysis and processing module is equipped with a memory containing a computer program. When the image analysis and processing module runs the computer program, it executes the aforementioned intelligent pork quality detection method and outputs the quality assessment results of the produced snowflake pork. The display module and image analysis and processing module send the output of the snowflake pork quality assessment results to the display module for display.

[0011] The beneficial effects of this invention are as follows: This solution, based on image recognition and image feature processing, identifies the boundary pixels between muscle and fat on Wagyu pork, and obtains boundary points based on these boundary pixels to obtain the muscle region on the surface image. The fat distribution uniformity coefficient and fat area ratio are calculated based on the pixel area of ​​the muscle region, thus enabling the evaluation of Wagyu pork quality. Simultaneously, this invention utilizes a CNN convolutional neural network to identify image features of the Wagyu pork surface image, constructing a feature correlation between the surface image and the fat distribution uniformity coefficient and fat area ratio. This provides support for efficient quality evaluation on the Wagyu pork production line, enabling continuous and rapid quality evaluation of Wagyu pork on the production line. Attached Figure Description

[0012] Figure 1 This is a flowchart of a smart detection method for pork quality.

[0013] Figure 2 This is a diagram illustrating the principle of muscle region recognition. Detailed Implementation

[0014] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0015] like Figure 1 As shown, a method for intelligent detection of pork quality includes the following steps: S1: Acquire a surface image of the snowflake pork chunks, and use the image selection tool to randomly select from the surface image. NEach sub-image region is divided into several distinct sub-image regions, and each sub-image region is converted to grayscale to obtain... N A grayscale image region; S2: Obtain the grayscale value corresponding to each pixel in the grayscale image region, filter the boundary pixel combinations located on the boundary between fat and muscle based on the pixel grayscale values, and calculate the coordinates of the boundary points corresponding to the boundary pixel combinations. Step S2 specifically includes the following steps: S21: Set the standard grayscale value for muscle pixels Standard grayscale value of fat pixels Standard grayscale value of muscle pixels Standard grayscale value of fat pixels The settings can be flexibly adjusted according to different lighting conditions to ensure the accuracy of the determination of the muscle and fat boundary.

[0016] S22: Calculate the grayscale standard deviation between muscle pixels and fat pixels. Set the pixel grayscale redundancy value for determining the boundary between muscle and fat. Construct the allowable grayscale difference range for determining the boundary between muscle and fat. In this embodiment, the pixel grayscale redundancy value needs to be flexibly set according to different image qualities. To ensure accurate boundaries and avoid large errors.

[0017] S23: Obtain the gray value corresponding to each pixel in the grayscale image region. , x Let the pixel in the grayscale image region be numbered, and calculate the pixel numbering of any two pixels. grayscale value The difference ; S24: Determine the difference Does it fall within the range of grayscale difference? inside, if If so, proceed to step S25; If so, return to step S23 and continue to calculate the difference in grayscale values ​​between any two pixels; S25: Recalculate pixels pixel distance between And set a threshold for the distance between the muscle and fat boundaries. ; like Then determine the pixel Located at the pixel boundary between muscle and fat, the pixels As a combination of boundary pixels located at the boundary between fat and muscle; Otherwise, pixels If the pixel is not located on the boundary between muscle and fat, return to step S23; in, pixels Pixel coordinates; S26: Filter out all boundary pixel combinations located on the pixel boundaries between muscle and fat in the grayscale image region. And calculate the coordinates of the midpoint of each boundary pixel combination. , which serves as the coordinates of the pixel boundary points between muscle and fat in the grayscale image region; ; in, i This is the number of the pixel boundary point.

[0018] S3: Obtain the set of pixel boundary points in the grayscale image region. The set of pixel boundary point coordinates corresponding to the boundary of the same muscle region is filtered by using the equation of the straight line connecting the pixel boundary points, thus obtaining all muscle regions within the grayscale image area.

[0019] Step S3 specifically includes the following steps: S31: Obtain the set of pixel boundary points in the grayscale image region. Based on the set of pixel boundary points Filter the set of pixel boundary point coordinates of any two pixel boundary points within the same muscle region boundary. , m Number the muscle regions present within the grayscale image area; Filter the set of pixel boundary point coordinates of the same muscle region boundary The objective function is: ; in, Set of pixel boundary point coordinates Any two pixel boundary points The pixel boundary point coordinates, Represents the coordinates of the pixel boundary point The equation of the straight line, The coordinates of the points passing through the pixel boundary are respectively The slope and intercept of the equation of the line. Indicates passing through two pixel boundary points All pixels on the line are muscle pixels. , For muscle pixels grayscale value, For muscle pixels Pixel coordinates; This is the error threshold for the grayscale values ​​of muscle pixels in the set grayscale image region. To filter the set of pixel boundary point coordinates of the same muscle region. The objective function; In the textured image formed on the surface of marbled pork, the muscle fibers are divided into different, independent regions by a grid of varying thicknesses. This invention utilizes an objective function to filter out the pixel boundary points of different muscle regions. The pixel boundary points of each independent muscle region form a set of pixel boundary point coordinates. Any two pixel boundary points within the same set of coordinates are connected by a line that passes through the muscle pixels within the muscle region, ensuring that all muscle pixels on the line satisfy a linear equation. This allows for the filtering of all pixel boundary points on the boundary of the same muscle region.

[0020] S32: After obtaining the set of pixel boundary point coordinates corresponding to the boundaries of all muscle regions in the grayscale image region, smoothly connect the corresponding pixel boundary point coordinates within each set to obtain all muscle regions within the identified grayscale image region, such as... Figure 2 As shown. S4: Calculate the fat area ratio of the surface image and the fat distribution uniformity coefficient corresponding to the surface image based on the number of muscle pixels in the muscle region.

[0021] Step S4 specifically includes the following steps: S41: Based on the number of muscle pixels contained in each muscle region v Calculate the fat area ratio of the grayscale image region, and calculate the overall fat area ratio of the surface image corresponding to the snowflake pork block. ; ; in, n The numbering of the grayscale image region. For the first n The first gray image region m Number of muscle pixels in each muscle region s 0 represents the area of ​​a single pixel. The pixel area of ​​the grayscale image region. M This represents the number of muscle regions within the grayscale image area; High-quality Wagyu pork has an intramuscular fat content exceeding 10%, with the optimal fat content being between 10% and 20%. Excessive fat content results in a greasy texture. This invention assesses the fat content of Wagyu pork by calculating the percentage of pixel area representing the remaining fat region after removing the muscle area in a surface image. A larger percentage of fat area indicates a higher fat content, and vice versa.

[0022] S42: Utilize pixel area data of each muscle region within the grayscale image area. , For the first M The pixel area of ​​each muscle region , For the first n The first gray image region M Number of muscle pixels in each muscle region; S43: Based on the difference in pixel area between muscle regions within the grayscale image region, calculate the fat distribution uniformity coefficient corresponding to the surface image, and obtain the fat distribution uniformity coefficient corresponding to the surface image. ; ; in, For the first m The pixel area of ​​each muscle region For the first n The average pixel area of ​​the muscle region in a grayscale image region.

[0023] This invention uses the pixel area difference between the muscle regions segmented by fat lines on the surface of marbled pork to characterize the uniformity of fat distribution. The more uniform the muscle region area, the more uniform the fat lines in marbled pork. The smaller the fat distribution uniformity coefficient, the better the quality of marbled pork, and vice versa.

[0024] S5: Using the fat area ratio and fat distribution uniformity coefficient as output features, construct a CNN convolutional neural network, use the CNN convolutional neural network to identify image features of surface images, train the CNN convolutional neural network, and output a converged CNN convolutional neural network.

[0025] Step S5 specifically includes the following steps: S51: Fat distribution uniformity coefficient and fat area percentage As the output features for recognizing surface images, a CNN convolutional neural network is constructed. The surface image is input into the CNN convolutional neural network to extract image features from the surface image. ; in, This is the output function of the CNN convolutional neural network. For CNN convolutional neural networks, k Number the convolution kernel. For the first k The weights of each convolutional kernel, For the first k The bias of each convolution kernel Image features extracted by the convolution kernel; A CNN (Convolutional Neural Network) consists of convolutional layers, magnetization layers, and fully connected layers. Convolutional layers extract image features through convolution operations. The convolution operation involves a sliding window (filter) that moves across the input surface image and calculates the dot product of pixels within the window and filter weights to generate a feature map. This feature map extracts image features from the surface image, including the grayscale values ​​of muscle pixels, fat pixels, and the spatial relationships between muscle and fat pixels. Pooling layers reduce the spatial dimensionality of the feature map, decreasing computation and extracting important features. Fully connected layers flatten the feature map and output the final classification result, using an activation function to output the fat distribution uniformity coefficient corresponding to the classification result. and fat area percentage .

[0026] S52: Collect surface images of different marbled pork and perform steps S1-S4 to calculate the fat distribution uniformity coefficient corresponding to each surface image. and fat area percentage As output features, the surface image and the corresponding output features are used as training data; S53: Input the training data into the CNN convolutional neural network to train the CNN, iteratively optimizing the initial weights and biases of the convolutional kernels until... T After several iterations of optimization, the output is the optimal weights and biases that satisfy the iterative optimization objective function, resulting in a converged CNN convolutional neural network. Iterative optimization of the objective function for: ; The iterative optimization process of the convolution kernel weights and biases satisfies: ; in, The first t The weights and biases of the convolutional kernels obtained from the next iteration of optimization. The first t The weights and biases of the convolutional kernel obtained after -1 iterations of optimization. They are respectively T The weight set and bias set obtained from the next iteration of optimization These are the iteration optimization step sizes for the weights and biases, respectively. These are the outputs of the CNN convolutional neural network. These are the weighting coefficients for fat distribution uniformity and fat area percentage, respectively, and are generally taken as... .

[0027] S6: Real-time acquisition of surface images of the snowflake pork produced on the snowflake pork production line, input into a convergent CNN convolutional neural network, outputting the fat distribution uniformity coefficient and fat area ratio to evaluate the quality of the produced snowflake pork.

[0028] Step S6 specifically includes the following steps: S61: Real-time acquisition of surface images of marbled pork produced on the marbled pork production line, input into a converged CNN convolutional neural network, outputting the fat distribution uniformity coefficient corresponding to the marbled pork surface image. and fat area percentage ; S62: Set the threshold for the fat distribution uniformity coefficient. and the threshold range of fat area percentage Using the fat distribution uniformity coefficient and fat area percentage Assess the quality of the produced marbled pork; like and If the quality is good, the produced snowflake pork will be of good quality; otherwise, the produced snowflake pork will be of poor quality.

[0029] A smart pork quality detection system for performing the above-mentioned smart pork quality detection method includes: The image acquisition module is installed on the snowflake pork production line to acquire surface images of the produced snowflake pork in real time and send them to the image analysis and processing module. The image analysis and processing module is equipped with a memory containing a computer program. When the image analysis and processing module runs the computer program, it executes the aforementioned intelligent pork quality detection method and outputs the quality assessment results of the produced snowflake pork. The display module and image analysis and processing module send the output of the snowflake pork quality assessment results to the display module for display.

[0030] This invention, based on image recognition and image feature processing, identifies the boundary pixels between muscle and fat on Wagyu pork, and obtains boundary points based on these pixels to obtain the muscle region on the surface image. It then calculates the fat distribution uniformity coefficient and fat area ratio based on the pixel area of ​​the muscle region, thus enabling the evaluation of Wagyu pork quality. Simultaneously, this invention utilizes a CNN convolutional neural network to identify image features of the Wagyu pork surface image, constructing a feature correlation between the surface image and the fat distribution uniformity coefficient and fat area ratio. This provides support for efficient quality evaluation on the Wagyu pork production line, enabling continuous and rapid quality assessment of Wagyu pork.

Claims

1. A method for intelligent detection of pork quality, characterized in that, Includes the following steps: S1: Acquire a surface image of the snowflake pork chunks, and use the image selection tool to randomly select from the surface image. N Each sub-image region is divided into several distinct sub-image regions, and each sub-image region is converted to grayscale to obtain... N A grayscale image region; S2: Obtain the gray value corresponding to each pixel in the grayscale image region, filter the boundary pixel combinations located on the boundary between fat and muscle based on the pixel gray values, and calculate the boundary point coordinates corresponding to the boundary pixel combinations; S3: Obtain the set of pixel boundary points in the grayscale image region. By using the equation of the line connecting the pixel boundary points, the set of pixel boundary point coordinates corresponding to the boundary of the same muscle region is filtered to obtain all muscle regions within the grayscale image area. S4: Calculate the fat area ratio of the surface image and the fat distribution uniformity coefficient corresponding to the surface image based on the number of muscle pixels in the muscle region. S5: Using the fat area ratio and fat distribution uniformity coefficient as output features, construct a CNN convolutional neural network, use the CNN convolutional neural network to identify the image features of the surface image, train the CNN convolutional neural network, and output a converged CNN convolutional neural network. S6: Real-time acquisition of surface images of the snowflake pork produced on the snowflake pork production line, input into a convergent CNN convolutional neural network, outputting the fat distribution uniformity coefficient and fat area ratio to evaluate the quality of the produced snowflake pork.

2. The intelligent detection method for pork quality according to claim 1, characterized in that, Step S2 includes: S21: Set the standard grayscale value for muscle pixels Standard grayscale value of fat pixels ; S22: Calculate the grayscale standard deviation between muscle pixels and fat pixels. Set the pixel grayscale redundancy value for determining the boundary between muscle and fat. Construct the allowable grayscale difference range for determining the boundary between muscle and fat. ; S23: Obtain the gray value corresponding to each pixel in the grayscale image region. , x Let the pixel in the grayscale image region be numbered, and calculate the pixel numbering of any two pixels. grayscale value The difference ; S24: Determine the difference Does it fall within the range of grayscale difference? inside, if If so, proceed to step S25; If so, return to step S23 and continue to calculate the difference in grayscale values ​​between any two pixels; S25: Recalculate pixels pixel distance between And set a threshold for the distance between the muscle and fat boundaries. ; like Then determine the pixel Located at the pixel boundary between muscle and fat, the pixels As a combination of boundary pixels located at the boundary between fat and muscle; Otherwise, pixels If the pixel is not located on the boundary between muscle and fat, return to step S23; in, pixels Pixel coordinates; S26: Filter out all boundary pixel combinations located on the pixel boundaries between muscle and fat in the grayscale image region. And calculate the coordinates of the midpoint of each boundary pixel combination. , which serves as the coordinates of the pixel boundary points between muscle and fat in the grayscale image region; ; in, i This is the number of the pixel boundary point.

3. The intelligent detection method for pork quality according to claim 2, characterized in that, Step S3 includes: S31: Obtain the set of pixel boundary points in the grayscale image region. Based on the set of pixel boundary points Filter the set of pixel boundary point coordinates of any two pixel boundary points within the same muscle region boundary. , m Number the muscle regions present within the grayscale image area; Filter the set of pixel boundary point coordinates of the same muscle region boundary The objective function is: ; in, Set of pixel boundary point coordinates Any two pixel boundary points The pixel boundary point coordinates, Represents the coordinates of the pixel boundary point The equation of the straight line, The coordinates of the points passing through the pixel boundary are respectively The slope and intercept of the equation of the line. Indicates passing through two pixel boundary points All pixels on the line are muscle pixels. , For muscle pixels grayscale value, For muscle pixels Pixel coordinates; This is the error threshold for the grayscale values ​​of muscle pixels in the set grayscale image region. To filter the set of pixel boundary point coordinates of the same muscle region. The objective function; S32: After obtaining the set of pixel boundary point coordinates corresponding to the boundaries of all muscle regions in the grayscale image region, smoothly connect the corresponding pixel boundary point coordinates in each set of pixel boundary point coordinates to obtain all muscle regions in the identified grayscale image region.

4. The intelligent detection method for pork quality according to claim 3, characterized in that, Step S4 includes: S41: Based on the number of muscle pixels contained in each muscle region v Calculate the fat area ratio of the grayscale image region, and calculate the overall fat area ratio of the surface image corresponding to the snowflake pork block. ; ; in, n The numbering of the grayscale image region. For the first n The first gray image region m Number of muscle pixels in each muscle region s 0 represents the area of ​​a single pixel. The pixel area of ​​the grayscale image region. M This represents the number of muscle regions within the grayscale image area; S42: Utilize pixel area data of each muscle region within the grayscale image area. , For the first M The pixel area of ​​each muscle region , For the first n The first gray image region M The number of muscle pixels in each muscle region; S43: Based on the difference in pixel area between muscle regions within the grayscale image region, calculate the fat distribution uniformity coefficient corresponding to the surface image, and obtain the fat distribution uniformity coefficient corresponding to the surface image. ; ; in, For the first m The pixel area of ​​each muscle region For the first n The average pixel area of ​​the muscle region in a grayscale image region.

5. The intelligent detection method for pork quality according to claim 4, characterized in that, Step S5 includes: S51: Fat distribution uniformity coefficient and fat area percentage As the output features for recognizing surface images, a CNN convolutional neural network is constructed. The surface image is input into the CNN convolutional neural network to extract image features from the surface image. ; in, This is the output function of the CNN convolutional neural network. For CNN convolutional neural networks, k Number the convolution kernel. For the first k The weights of each convolutional kernel, For the first k The bias of each convolution kernel Image features extracted by the convolution kernel; S52: Collect surface images of different marbled pork and perform steps S1-S4 to calculate the fat distribution uniformity coefficient corresponding to each surface image. and fat area percentage As output features, the surface image and the corresponding output features are used as training data; S53: Input the training data into the CNN convolutional neural network to train the CNN, iteratively optimizing the initial weights and biases of the convolutional kernels until... T After several iterations of optimization, the output is the optimal weights and biases that satisfy the iterative optimization objective function, resulting in a converged CNN convolutional neural network. Iterative optimization of the objective function for: ; The iterative optimization process of the convolution kernel weights and biases satisfies: ; in, The first t The weights and biases of the convolutional kernels obtained from the next iteration of optimization. The first t The weights and biases of the convolutional kernel obtained after -1 iterations of optimization. They are respectively T The weight set and bias set obtained from the next iteration of optimization These are the iteration optimization step sizes for the weights and biases, respectively. These are the outputs of the CNN convolutional neural network. These are the weighting coefficients for fat distribution uniformity and fat area percentage, respectively.

6. The intelligent detection method for pork quality according to claim 5, characterized in that, Step S6 includes: S61: Real-time acquisition of surface images of marbled pork produced on the marbled pork production line, input into a converged CNN convolutional neural network, outputting the fat distribution uniformity coefficient corresponding to the marbled pork surface image. and fat area percentage ; S62: Set the threshold for the fat distribution uniformity coefficient. and the threshold range of fat area percentage Using the fat distribution uniformity coefficient and fat area percentage Assess the quality of the produced marbled pork; like and If the quality is good, the produced snowflake pork will be of good quality; otherwise, the produced snowflake pork will be of poor quality.

7. A pork quality intelligent detection system, used to execute the pork quality intelligent detection method according to any one of claims 1-6, characterized in that, include: The image acquisition module is installed on the snowflake pork production line to acquire surface images of the produced snowflake pork in real time and send them to the image analysis and processing module. The image analysis and processing module is equipped with a memory, which stores a computer program. When the image analysis and processing module runs the computer program, it executes the intelligent pork quality detection method according to any one of claims 1-6 and outputs the quality assessment results of the produced snowflake pork. The display module and image analysis and processing module send the output of the snowflake pork quality assessment results to the display module for display.