Method for detecting the quality of beef cut based on machine vision
Patent Information
- Application Number
- CN202611020317.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-09
- Publication Date
- 2026-10-27
AI Technical Summary
现有方案主要关注“如何切准”(切割路径规划)和“切出来的产品品级如何”(品质分级),对于“切得好不好”这一反映分切工艺质量本身的指标缺乏系统性的视觉评价方法
本发明通过面向牛肉分切工艺质量的多维度图像评价指标体系,从边缘平整度、脂肪-肌肉分离度、切面毛刺度和尺寸偏差四个维度全面刻画分切质量,弥补了现有技术中仅关注产品品质或切割路径的不足;本发明通过设计双分支多任务神经网络,第一分支负责边缘形态特征提取,第二分支负责组织界面分析,两个分支共享主干特征,既保证了检测精度又降低了计算开销,改进的流形注意力机制可针对牛肉脂肪区域形态多变的特点进行专门优化,提升了不规则脂肪与肌肉边界的分割准确性。
Smart Images

Figure CN122990288A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of food processing and machine vision technology, and in particular to a machine vision-based method for detecting the quality of beef cutting. Background Technology
[0002] Beef slicing is a crucial processing step that involves cutting beef carcasses or large cuts of beef into specific shapes and sizes according to required specifications. The quality of slicing directly affects the product's appearance, adaptability to subsequent processing, and market price. With increasing consumer demands for beef product quality and the development of automated food processing, machine vision-based intelligent inspection technology is being increasingly widely applied in the beef processing industry.
[0003] Currently, machine vision inspection technology for beef mainly focuses on two directions: one is beef quality grading, which involves collecting images of beef cut surfaces, extracting features such as marbling richness, meat color, and fat color, and using traditional image processing or deep learning models to determine the grade; the other is vision-guided intelligent cutting control, which involves acquiring three-dimensional information of raw meat through an RGB-D camera, planning the cutting trajectory, and controlling a robotic arm or cutting equipment to complete the cutting operation.
[0004] However, existing technologies generally have the following shortcomings: (1) Lack of direct online detection of cutting quality. Existing solutions mainly focus on "how to cut accurately" (cutting path planning) and "what is the grade of the cut product" (quality grading). There is a lack of systematic visual evaluation methods for the indicator of "how well it is cut", which reflects the quality of the cutting process itself. Defects that may occur during the cutting process, such as uneven edges, incomplete separation of fat and muscle, burrs on the cut surface, and size deviation, cannot be automatically identified and quantified by existing machine vision systems. (2) Existing detection indicators are singular and have not formed a multi-dimensional evaluation system for cutting quality. A few technologies involving the quality judgment of cut meat pieces only identify the uniformity of the distribution of fat and meat pixels. The dimension is singular and it is difficult to comprehensively describe the cutting quality. (3) Lack of differentiated detection strategies for the cutting quality of different beef parts. The muscle fiber structure, fat content and distribution pattern of different parts of beef (such as ribeye, sirloin, tenderloin, brisket, etc.) are significantly different. A unified detection standard and algorithm is difficult to adapt to the cutting quality evaluation needs of all parts. Therefore, this invention proposes a machine vision-based beef cutting quality detection method to solve the above problems. Summary of the Invention
[0005] To address the aforementioned issues, this invention proposes a machine vision-based method for detecting the quality of beef slicing. The method characterizes the slicing quality through a multi-dimensional index system, improves detection accuracy by employing a dual-branch neural network and manifold attention, and achieves differentiated evaluation by combining part classification. The results can guide process adjustments, and the algorithm is lightweight, real-time, and easy to deploy.
[0006] To achieve the objectives of this invention, the invention is implemented through the following technical solutions: A machine vision-based method for inspecting the quality of beef cutting includes the following steps; S1: Acquire cross-sectional images of the cut beef chunks and perform noise reduction, illumination correction, and normalization preprocessing on the cross-sectional images; S2: Calculate evaluation indicators in at least four dimensions, including the smoothness of the cutting edge, the degree of fat-muscle separation, the degree of burrs on the cutting surface, and the deviation of the cutting size. S3: A dual-branch multi-task deep neural network is used to process the preprocessed cross-sectional image in S1; S4: Encode the prior information of the segmentation device into a spatial attention bias map, and then fuse it with the feature map of the dual-branch multi-task deep neural network in S3 to drive the dual-branch multi-task deep neural network to adaptively extract the segmentation region ROI. S5: Classify the beef chunks by part, then call the corresponding quality evaluation weight combination according to the identified part type, and weight and fuse the four evaluation indicators in S2 to obtain a comprehensive quality score. Finally, output the cutting quality level based on the preset threshold.
[0007] A further improvement is that the dual-branch multi-task deep neural network in S3 includes a shared backbone network, a first branch for outputting edge probability maps and edge orientation maps, and a second branch for outputting pixel-level semantic segmentation probability maps.
[0008] Further improvements are made in S3, where the shared backbone network of the dual-branch multi-task deep neural network adopts a structure combining convolutional neural networks and Transformers to output multi-scale feature maps. Then, the first branch receives the multi-scale feature maps and outputs edge probability maps and edge direction maps through a learnable edge sharpening kernel and gradient histogram guidance module. Next, the second branch receives the multi-scale feature maps and outputs pixel-level semantic segmentation probability maps through an encoder-decoder structure and an improved manifold attention mechanism.
[0009] A further improvement is that the improved manifold attention mechanism includes adding a shape prior bias term P based on geometric relations to the attention weight calculation, and introducing a manifold distance regularization term. .
[0010] A further improvement is made in S4, where, when driving the dual-branch multi-task deep neural network to adaptively extract the ROI of the cutting region, the following is achieved: the tool feed direction and the cutting station calibration data are encoded into a spatial attention bias map M. spatialThe feature map output by the shared backbone network is multiplied element-wise, and the result is input into the region proposal network to output candidate ROI boxes. The ROI box with the highest confidence is then selected for cropping.
[0011] A further improvement is made in S5, when classifying beef chunks by part, the part recognition model is jointly trained with a dual-branch multi-task deep neural network to output the part category to which the beef chunks belong; when calling the corresponding quality evaluation weight combination according to the identified part type, the quality evaluation weight combination is determined by a pre-constructed ternary mapping matrix including part, indicator and weight, different parts correspond to different weight distributions, and the weight sum = 1.
[0012] A further improvement is that, in step S5, when classifying beef chunks by cut, the beef chunks are divided into at least three categories, including ribeye, sirloin, tenderloin, brisket, and sirloin. The cut recognition model uses a classification network based on deep learning.
[0013] A further improvement is that the weight values in the ternary mapping matrix are determined by the analytic hierarchy process or a machine learning regression method based on historical data, and can be dynamically adjusted according to product specifications.
[0014] A further improvement is that the method also includes setting a grading threshold for the comprehensive quality score, providing feedback suggestions based on the comprehensive quality score, and when the comprehensive quality score is lower than the preset threshold, outputting improvement suggestions for adjusting the parameters of the slitting equipment or maintaining the cutting tools based on the scores of each evaluation indicator.
[0015] The beneficial effects of this invention are as follows: This invention employs a multi-dimensional image evaluation index system for beef slicing quality, comprehensively characterizing slicing quality from four dimensions: edge smoothness, fat-muscle separation, cut surface burr degree, and dimensional deviation. This overcomes the shortcomings of existing technologies that only focus on product quality or cutting path. Furthermore, this invention designs a dual-branch multi-task neural network. The first branch is responsible for edge morphology feature extraction, while the second branch is responsible for tissue interface analysis. The two branches share core features, ensuring detection accuracy while reducing computational overhead. The improved manifold attention mechanism is specifically optimized for the variable morphology of beef fat regions, enhancing the segmentation accuracy of irregular fat-muscle boundaries.
[0016] This invention classifies beef chunks by part and then uses a pre-built part identification model and a ternary mapping matrix to evaluate the cutting quality of different parts, avoiding misjudgments caused by the traditional one-cut inspection and evaluation mode, and is more in line with actual production needs.
[0017] The comprehensive quality score and slitting quality grade results output by this invention can be directly used to guide the adjustment of slitting process parameters or as a basis for product quality grading, and have clear application value. The algorithm of this invention, through lightweight network design and ROI adaptive extraction technology, can achieve real-time processing on conventional industrial computing platforms, and can seamlessly connect with existing automatic slitting production lines, with good adaptability. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation
[0019] To enhance understanding of the present invention, the present invention will be further described in detail below with reference to embodiments. These embodiments are only used to explain the present invention and do not constitute a limitation on the scope of protection of the present invention. Example 1
[0020] according to Figure 1 As shown, this embodiment proposes a machine vision-based method for inspecting the quality of beef slicing. The application is based on a production line that uses a six-axis industrial robot carrying a disc cutter for slicing, and the sliced beef pieces are transported to a vision inspection station via a conveyor belt. The specific steps include: S1: A darkroom is set up at the inspection station. A 5-megapixel industrial area scan camera (model: Baslerac A5472-17uc) is installed inside the darkroom with an 8mm lens focal length and a ring-shaped LED white light source. When the beef block on the conveyor belt passes the photoelectric trigger switch, the industrial area scan camera automatically captures the cross-sectional image of the beef block. The cross-sectional image resolution is 2592×1944 pixels. Then, the acquired raw cross-sectional images are preprocessed as follows: S1-1: Use median filtering (kernel size 3×3) to remove noise; S1-2: Color correction based on grayscale world algorithm to eliminate the influence of light source fluctuations; S1-3: Scale the image to a uniform size (1024×1024 pixels) and normalize the pixel values to the [0, 1] range.
[0021] S2: Calculate evaluation indicators in at least four dimensions, including the smoothness of the cutting edge, the degree of fat-muscle separation, the degree of burrs on the cutting surface, and the deviation of the cutting size. S2-1: Segmentation Edge Smoothness: The Canny edge detection operator (low threshold 50, high threshold 150) is used to extract the edge contour of the segmented region, resulting in a contour point set P={P1, P2, ..., P...} nIn this embodiment, the cutting target is a vertical cut. The ideal cutting plane is defined as a vertical plane perpendicular to the conveyor belt plane, and its equation is given by the calibration parameters of the cutting equipment. Then, each contour point p is calculated. i The vertical distance d to the plane i Then the flatness E is: Wherein: Wherein, d i is the vertical distance from the i-th contour point to the ideal cutting plane; d̄ is the average value of all dᵢ; n is the number of contour points; the smaller the E value, the smoother the edge, in mm.
[0022] S2-2: Fat-Muscle Separation: The pixel-level classification result output by the second branch of the bi-branch multi-task deep neural network is used as input, let the fat region A be... fat Muscle region A muscle The set of boundary lines between them is B = {b1, b2, ..., b}. m}, for boundary line b j Its completeness coefficient C(b) j )=L contiguous,j / L total,j L contiguous,j L is the pixel length of a continuous boundary segment. total,j Given the total length of the theoretically intact boundary, the separation degree S is defined as: Where: S takes values in the range of [0, 1], and the closer the value is to 1, the more thoroughly the fat and muscle are separated.
[0023] S2-3: Cutting burr degree: For the edge probability map obtained from edge detection, calculate the gradient direction angle θ(pi) of each edge pixel. In this embodiment, the main cutting direction angle θmain = 90° (vertical downward cutting), and set the angle threshold θth = 30°. Count the number of pixels with a direction deviation greater than this threshold |H|, where: ; Burr degree B is: .
[0024] S2-4: Cutting size deviation: In this embodiment, the requirement is to cut the beef chunks into lengths L. tar =80 mm, width W tar A rectangular block with a diameter of 60 mm is formed. The overall outline of the meat block is obtained through the second branch of a two-branch multi-task deep neural network, and the minimum bounding rectangle is calculated to obtain the actual length L. act and width W act Using length and width deviations: The overall area deviation is: .
[0025] S3: When using a dual-branch multi-task deep neural network to process the preprocessed cross-sectional image in S1, the specific parameters of the dual-branch multi-task deep neural network are as follows: The shared backbone network employs a lightweight CNN and Transformer hybrid architecture. First, a 3×3 convolutional layer (stretch 2, output channels 64) downsamples the input image to 512×512. Then, four hybrid modules are stacked, each containing a local convolutional block (3×3 depthwise separable convolution) and a global attention block (4-head self-attention, embedding dimension 256). The final output features maps at three scales: F1 (128×128×256), F2 (64×64×512), and F3 (32×32×1024). The first branch (edge enhancement module): It receives multi-scale feature maps, first upsamples F1, F2, and F3 using a feature pyramid structure and fuses them into a 256×256×256 fused feature. A learnable edge sharpening kernel (3×3, initialized with the Laplacian operator) is applied to this fused feature. Simultaneously, the gradient histogram feature (4-direction bins) at each pixel location is calculated and used as auxiliary guiding information, concatenated with the feature map. Finally, two 1×1 convolutional layers output an edge probability map M. edge (256×256×1) and edge orientation pattern M dir (256×256×4, four-directional probability); The second branch (semantic segmentation module): It also receives multi-scale feature maps and performs pixel-level classification using an encoder-decoder structure. The encoder uses F1, F2, and F3 from a shared backbone output, and the decoder gradually restores resolution through transposed convolutions. An improved manifold attention module is introduced in the skip connections, resulting in 4 output channels (categories: background, fat, muscle, fascia / other). A pixel-level probability map Mseg (256×256×4) is obtained through Softmax. Due to the improved manifold attention mechanism in the second branch, for the input feature map X, the query Q, key K, and value V are first calculated, followed by the attention weight matrix. A shape prior bias term P is added, where each element is calculated based on the geometric relationship (distance, curvature difference) between corresponding positions. Additionally, a manifold distance regularization term is defined for the attention output: Where: M(i,j) is pre-calculated based on the SIFT manifold distance of the fat region, and λ·R is added to the total loss (λ=0.01 in this embodiment).
[0026] During the training of the two-branch multi-task deep neural network, a self-built dataset (containing 5000 labeled beef slice images) was used for end-to-end training. The loss function of the first branch is the sum of the binary cross-entropy loss (edge prediction) and the angle mean square error loss (direction prediction). The loss function of the second branch is the weighted sum of the Dice loss and the cross-entropy loss (weight ratio 1:1). The total loss is the sum of the losses of the two branches plus the attention regularization term. The AdamW optimizer was used with an initial learning rate of 0.001, a batch size of 8, and 100 complete training cycles.
[0027] S4: Drive a dual-branch, multi-task deep neural network to adaptively extract the ROI of the cutting region. In this embodiment, the tool feed direction is vertically downward, and the camera calibration parameters at the cutting station are known. Then, the prior information is encoded into a spatial attention bias map Mspatial, with the same size as the shared backbone output F3 (32×32). Mspatial is given a high weight at the tool trajectory position and a lower weight at other positions. Mspatial is multiplied element-wise with F3 to obtain the weighted feature map F3′. Finally, F3′ is input into a small region proposal network, which outputs candidate ROI boxes (each box includes location and confidence score). The ROI box with the highest confidence score is selected, and the corresponding original image patch is cropped (size adjusted to 256×256) as input for subsequent quality feature extraction.
[0028] S5: Classify the beef chunks by cut, then apply the corresponding quality evaluation weight combination based on the identified cut type, and weight and fuse the four evaluation indicators from S2 to obtain a comprehensive quality score. Finally, output the segmented quality level based on a preset threshold. Specifically: When classifying beef cuts by part, a new part classification head is added to the second branch of the dual-branch multi-task deep neural network. The classification head receives the highest layer features (size 64×64×512) from the second branch decoder. Through global average pooling and two fully connected layers, it outputs the probability distribution of 6 cut categories (ribeye, sirloin, tenderloin, brisket, sirloin ribeye, and others). The part recognition model is jointly trained with the dual-branch multi-task deep neural network and cross-entropy loss is used. When constructing the ternary mapping matrix of parts, indicators and weights, the following weight matrix was constructed based on expert knowledge and previous experimental data (Table 1). The weight values were calculated using the analytic hierarchy process and satisfy wE+wS+wB+wΔ=1.
[0029] Table 1. Weights of Cutting Quality Indicators for Different Cuts of Beef eyelid 0.20 0.45 0.20 0.15 external spine 0.40 0.20 0.25 0.15 tenderloin 0.35 0.15 0.35 0.15 Sirloin 0.15 0.25 0.40 0.20 Milon 0.30 0.20 0.25 0.25 For the beef chunks being inspected, the cut category is first determined using a cut recognition model. If identified as "Other," the default weights (0.25, 0.25, 0.25, 0.25) are used to normalize the four indicators calculated in step 2, converting them to the [0, 1] interval, and treating them as positive indicators (higher values indicate better quality). For example, a higher flatness E and burr density B indicate lower quality. , The resolution S and dimensional deviation Δ are directly normalized or normalized by taking their reciprocals. The normalized values are denoted as E. norm S norm B norm Δ norm ; The overall quality score Q is: The grading thresholds are set according to actual production conditions: Excellent: Q≥0.85; Good: 0.70≤Q<0.85; Pass: 0.60≤Q<0.70; Unpass: Q<0.60.
[0030] In this embodiment, 500 pieces of beef (including 100 pieces each of ribeye, sirloin, tenderloin, brisket, and rump) were inspected online, and the results were compared with human expert scores (the human scores were averaged after being given by three senior quality inspectors). The results show that the correlation coefficient between the overall quality score of this invention and the human score reaches 0.94, the grading accuracy (the proportion of machine grading results consistent with the majority human judgment) is 92.6%, and the average processing time per image piece is 82ms, meeting the requirements for online inspection and significantly outperforming existing comparison methods based solely on a single indicator or uniform weighting. Example 2
[0031] according to Figure 1 As shown, this embodiment proposes a machine vision-based method for detecting the quality of beef slicing, which is basically the same as Embodiment 1. The difference lies in adding a feedback suggestion function for meat pieces that fail the quality control test. That is, when the overall quality score Q < 0.60, the system outputs suggestion information based on the specific scores of each indicator. In this embodiment, the specific suggestion content is: when E norm If the cutting speed is too low, it is recommended to check if the cutting tool has become dull or if the cutting speed is too fast. When S norm If the pressure is too low, it is recommended to reduce the cutting pressure or replace it with a sharper blade. When B norm If the temperature is too low, it is recommended to increase the cooling time or replace the blade with one that has finer teeth. When Δ norm If the value is too low, it is recommended to calibrate the positioning sensor or adjust the robot trajectory parameters.
[0032] Finally, the feedback information is directly transmitted to the operator or the slitting control system via the display screen or PLC communication, realizing closed-loop control of slitting quality.
[0033] This invention employs a multi-dimensional image evaluation index system for beef slicing quality, comprehensively characterizing slicing quality from four dimensions: edge smoothness, fat-muscle separation, cut surface burr degree, and dimensional deviation. This overcomes the shortcomings of existing technologies that only focus on product quality or cutting path. The invention utilizes a dual-branch multi-task neural network. The first branch is responsible for edge morphology feature extraction, and the second branch is responsible for interface analysis. The two branches share core features, ensuring detection accuracy while reducing computational overhead. The improved manifold attention mechanism is specifically optimized for the variable morphology of beef fat regions, enhancing the segmentation accuracy of irregular fat-muscle boundaries. Furthermore, this invention classifies beef pieces by part and then uses a pre-constructed part recognition model and ternary mapping matrix to specifically evaluate the slicing quality of different parts, avoiding misjudgments caused by traditional one-size-fits-all detection and evaluation methods, and better meeting actual production needs. The comprehensive quality score and slitting quality grade results output by this invention can be directly used to guide the adjustment of slitting process parameters or as a basis for product quality grading, and have clear application value. The algorithm of this invention, through lightweight network design and ROI adaptive extraction technology, can achieve real-time processing on conventional industrial computing platforms, and can seamlessly connect with existing automatic slitting production lines, with good adaptability.
[0034] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A machine vision-based method for inspecting the quality of beef cutting, characterized in that, Includes the following steps; S1: Acquire cross-sectional images of the cut beef chunks and perform noise reduction, illumination correction, and normalization preprocessing on the cross-sectional images; S2: Calculate evaluation indicators in at least four dimensions, including the smoothness of the cutting edge, the degree of fat-muscle separation, the degree of burrs on the cutting surface, and the deviation of the cutting size. S3: A dual-branch multi-task deep neural network is used to process the preprocessed cross-sectional image in S1; S4: Encode the prior information of the segmentation device into a spatial attention bias map, and then fuse it with the feature map of the dual-branch multi-task deep neural network in S3 to drive the dual-branch multi-task deep neural network to adaptively extract the segmentation region ROI. S5: Classify the beef chunks by part, then call the corresponding quality evaluation weight combination according to the identified part type, and weight and fuse the four evaluation indicators in S2 to obtain a comprehensive quality score. Finally, output the cutting quality level based on the preset threshold.
2. The method for detecting the quality of beef slicing based on machine vision according to claim 1, characterized in that: The dual-branch multi-task deep neural network in S3 includes a shared backbone network, a first branch for outputting edge probability maps and edge orientation maps, and a second branch for outputting pixel-level semantic segmentation probability maps.
3. The method for detecting the quality of beef slicing based on machine vision according to claim 2, characterized in that: In S3, the shared backbone network of the dual-branch multi-task deep neural network adopts a structure combining convolutional neural network and Transformer to output multi-scale feature maps. Then, the first branch receives the multi-scale feature maps and outputs edge probability maps and edge direction maps through a learnable edge sharpening kernel and gradient histogram guidance module. Next, the second branch receives the multi-scale feature maps and outputs pixel-level semantic segmentation probability maps through an encoder-decoder structure and an improved manifold attention mechanism.
4. The method for detecting the quality of beef slicing based on machine vision according to claim 3, characterized in that: The improved manifold attention mechanism includes incorporating a shape prior bias term P based on geometric relations into the attention weight calculation, and introducing a manifold distance regularization term. .
5. The method for detecting the quality of beef slicing based on machine vision according to claim 1, characterized in that: In step S4, when driving the dual-branch multi-task deep neural network to adaptively extract the ROI of the cutting region, the following is achieved: encoding the tool feed direction and cutting station calibration data into a spatial attention bias map M. spatial The feature map output by the shared backbone network is multiplied element-wise, and the result is input into the region proposal network to output candidate ROI boxes. The ROI box with the highest confidence is then selected for cropping.
6. The method for detecting the quality of beef slicing based on machine vision according to claim 4, characterized in that: In step S5, when classifying beef chunks by part, the part recognition model is jointly trained with a dual-branch multi-task deep neural network to output the part category to which the beef chunks belong. When calling the corresponding quality evaluation weight combination according to the identified part type, the quality evaluation weight combination is determined by a pre-constructed ternary mapping matrix including part, indicator and weight. Different parts correspond to different weight distributions, and the sum of the weights is 1.
7. The method for detecting the quality of beef slicing based on machine vision according to claim 6, characterized in that: In step S5, when classifying beef chunks by cut, the beef chunks are divided into at least three categories, including ribeye, sirloin, tenderloin, brisket, and sirloin. The cut recognition model uses a classification network based on deep learning.
8. The method for detecting the quality of beef slicing based on machine vision according to claim 7, characterized in that: The weight values in the ternary mapping matrix are determined by the analytic hierarchy process or a machine learning regression method based on historical data, and can be dynamically adjusted according to product specifications.
9. The method for detecting the quality of beef slicing based on machine vision according to claim 1, characterized in that: The method also includes setting a grading threshold for the comprehensive quality score, providing feedback suggestions based on the comprehensive quality score, and when the comprehensive quality score is lower than the preset threshold, outputting improvement suggestions for adjusting the parameters of the slitting equipment or maintaining the cutting tools based on the scores of each evaluation indicator.