Livestock and poultry meat texture recognition and cutting method based on deep learning
Through the improved YOLOv8 model, the species and texture direction of livestock and poultry meat are identified and the cutting path is automatically planned, which solves the problems of low efficiency and poor consistency in traditional cutting methods, and achieves efficient and accurate meat cutting.
Patent Information
- Application Number
- CN202510477285.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-07-25
AI Technical Summary
Traditional livestock and poultry meat cutting methods rely on manual operations, with low efficiency and poor consistency, making it difficult to ensure the accuracy and consistency of the cutting direction, resulting in insufficient meat quality integrity and processing efficiency.
The improved YOLOv8 model is used to identify livestock and poultry meat species and texture directions, combined with multi-condition judgment mechanism and region segmentation strategy, the cutting path is automatically planned, and the precise cutting of livestock and poultry meat species is achieved through deep learning technology.
It significantly improves the accuracy and robustness of texture recognition of livestock and poultry meat species, automatically plans the optimal cutting path, maximizes meat integrity, improves processing efficiency and product consistency, and reduces manual intervention.
Smart Images

Figure CN120375009A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image analysis of fresh or chilled livestock and poultry meat, and more specifically, to a method for identifying and cutting livestock and poultry meat texture based on deep learning. Background Art
[0002] In the processing industry of livestock and poultry meat, the cutting efficiency and product quality directly affect the production efficiency. Traditional cutting of livestock and poultry meat mainly relies on manual operation, which has problems such as low efficiency, poor consistency, and high labor intensity. With the development of machine vision and automation technology, using a computer to identify the type and texture direction of meat and combining it with an automated cutting device for precise cutting has become a key technology to improve the processing efficiency and quality of livestock and poultry meat.
[0003] The identification of livestock and poultry meat texture plays a very important role in the cutting process. Different types of livestock and poultry meat have different muscle fiber structures and fat distributions, and different cutting directions need to be adopted to ensure the best taste and quality. For livestock such as beef and pork, they are usually cut along the texture for segmentation to maintain the integrity of the meat and avoid the meat from falling apart; while for cutting into small pieces, thin strips, and shredded meat, it is usually cut against the texture, and by cutting off the muscle fibers, the meat becomes more tender and easier to chew. Poultry meat such as chicken has a relatively uniform texture distribution, but the cutting direction still needs to be adjusted according to the specific parts (such as chicken breast and chicken leg) to optimize the taste and appearance.
[0004] Traditional cutting methods rely on the experience of workers and it is difficult to ensure the consistency and accuracy of the cutting direction. Usually, slicing or dicing equipment does not have the function of adjusting the cutting direction according to the texture. Usually, it is necessary for workers to adjust the placement orientation of the raw materials during feeding, which has obvious limitations in large-scale production. Machine vision technology can quickly and accurately identify features such as the texture direction and muscle distribution of livestock and poultry meat through image acquisition and processing. Based on the identified meat type and texture information, planning the optimal cutting path can maximize the retention of the integrity of the meat, reduce waste, and improve the cutting efficiency.
[0005] In view of this, the present invention provides a method for identifying and cutting livestock and poultry meat texture based on deep learning to solve the above problems. Summary of the Invention
[0006] In order to overcome the problems in the prior art, the present invention proposes a method for identifying and cutting livestock and poultry meat texture based on deep learning. By accurately identifying the texture direction of livestock and poultry meat and combining characteristics such as the type, part, and quality of the meat variety, it recommends suitable livestock and poultry meat products and plans the cutting path, improving the quality and efficiency of livestock and poultry meat processing and meeting the needs of consumers for high-quality meat products.
[0007] In a first aspect, the present invention provides a method for identifying and cutting livestock and poultry meat texture based on deep learning, comprising the following steps:
[0008] Step S1: Add a classification task branch after the 9th layer corresponding to the C2f module in the Backbone network of the YOLOv8 model, and use the Hough Line Detection HoughL layer after the 16th, 19th, and 22nd layers corresponding to the C2f module in the Neck network to obtain an improved YOLOv8 model with bidirectional detection;
[0009] Step S2: Use the target image as an input factor to iteratively train the improved YOLOv8 model until the training result meets the update requirements of the composite loss function, and output the detection result, where the detection result is the texture line feature, the type of livestock and poultry meat, and the result confidence;
[0010] Step S3: Determine that the current livestock and poultry meat type is successfully recognized if the texture line feature, the type of livestock and poultry meat, and the result confidence simultaneously meet the preset livestock and poultry meat type conditions, otherwise re-recognize the livestock and poultry meat type or perform manual quality inspection;
[0011] Step S4: Extract multiple texture line features from the target image in which the livestock and poultry meat type is successfully recognized, integrate the multiple texture line features into an overall texture direction, and determine the cutting direction based on the texture direction.
[0012] As a preferred technical solution of the present invention, the classification task branch extracts the type of livestock and poultry meat and the result confidence through global semantic information analysis; the classification task branch includes three first convolutional modules and two fully connected FC layers, and the first convolutional module includes a Conv2d layer, a BN layer, a Hardswish activation layer, a Conv2d layer, and a BN layer.
[0013] As a preferred technical solution of the present invention, the Hough Line Detection HoughL layer performs texture direction detection on the feature map to extract a large-size feature map, obtains a small-size feature map through the AvgPool downsampling layer for the large-size feature map, obtains an upsampled feature map through the Upsample upsampling layer for the small-size feature map, and outputs the line detection result through the concat splicing layer.
[0014] As a preferred technical solution of the present invention, the composite loss function includes a classification loss function and a line detection loss function.
[0015] As a preferred technical solution of the present invention, the loss functions for line detection are respectively the distance from the predicted line midpoint to the true line midpoint and the distance difference between the predicted left starting point of the line and the true left starting point of the line.
[0016] As a preferred technical solution of the present invention, the preset livestock and poultry meat type conditions include:
[0017] Condition 1: The confidence level of the recognition result of the improved YOLOv8 model for the types of livestock and poultry meat is higher than the result confidence threshold.
[0018] Condition 2: Among the straight lines detected in the improved YOLOv8 model, at least a% of the straight line lengths reach b% of the total sample length.
[0019] Condition 3: The variance of the angles between all the detected straight lines and the horizontal line does not exceed c.
[0020] If Condition 1 is not satisfied, the image is input into the original YOLOv8 model for recognition. If the recognition is successful, the subsequent processing is carried out in combination with the texture direction information of the improved model; if it still cannot be correctly recognized, the sample is excluded and judged by manual inspection.
[0021] As a preferred technical solution of the present invention, if Condition 1 is satisfied, but any one of Condition 2 or Condition 3 is not satisfied, the texture surface of the sample is stretched and then recognized again.
[0022] If Conditions 2 and 3 still cannot be satisfied after stretching, it is considered that the texture direction on the meat surface is regional, and the next step of operation is entered.
[0023] As a preferred technical solution of the present invention, the regional processing logic is as follows:
[0024] The meat image is input into the original YOLOv8 model to obtain the bounding box of the meat.
[0025] The bounding box is evenly divided into multiple small boxes, and the image in each small box is separately input into the improved YOLOv8 model to run the branch for outputting straight lines, and Conditions 2 and 3 are detected again.
[0026] If more than the preset number of boxes satisfy Conditions 2 and 3, it is considered that the texture of the meat is regional, and the cutting path is adjusted according to different regions in the subsequent processing; if it still does not satisfy, the sample is excluded and judged by manual inspection.
[0027] As a preferred technical solution of the present invention, the judgment logic of the texture direction is as follows:
[0028]
[0029] Where: β is the texture orientation of the sample, n is the total number of straight lines recognized, and γ i is the angle between the i-th straight line recognized and the horizontal line.
[0030] The specific advantages of the present invention are as follows:
[0031] The invention simultaneously completes the classification of livestock and poultry meat types, the classification of parts, and the detection of texture directions through an improved YOLOv8 model. By combining a multi-condition judgment mechanism and a region segmentation strategy, the accuracy and robustness of texture recognition for livestock and poultry meat types are significantly improved. It can automatically plan the optimal cutting path to achieve precise cutting along or against the grain, thereby maximizing the preservation of meat integrity, reducing waste, improving processing efficiency and product consistency, while reducing the need for manual intervention and being applicable to large-scale livestock and poultry meat processing scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a flowchart of the method of the present invention;
[0033] Figure 2 It is an overall architecture diagram of the deep learning model for detecting meat types, parts, and textures of the present invention;
[0034] Figure 3 It is a schematic diagram of the straight line detection loss function of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0036] Embodiment 1
[0037] As Figure 1 shown, the present invention provides a technical solution: a method for texture recognition and cutting of livestock and poultry meat based on deep learning, which simultaneously completes two tasks of classification and texture detection based on an improved YOLOv8 model, identifies the types, parts, and texture directions of livestock and poultry meat, and combines an automated cutting device to achieve precise cutting; including the following steps:
[0038] Step S1: Add a classification task branch after the 9th layer corresponding to the C2f module in the Backbone backbone network of the YOLOv8 model, and use the Hough line detection HoughL layer after the 16th, 19th, and 22nd layers corresponding to the C2f module in the Neck neck network to obtain an improved YOLOv8 model for two-way detection;
[0039] Specifically, as Figure 2 shown, the optimization logic of the improved YOLOv8 model:
[0040] The improved YOLOv8 model includes the baseline model of the YOLOv8 model. The baseline model includes a Backbone network, a Neck network, and a Head network. After the 9th layer of the Backbone network corresponding to the C2f module, a classification task branch is added to extract the types of livestock and poultry meat and the confidence of the results. After the 16th, 19th, and 22nd layers of the Neck network corresponding to the C2f module, the HoughL layer of Hough line detection is used to perform line detection to obtain texture line features;
[0041] It should be noted that: based on the YOLOv8 model, single-task detection is completed, such as one of object detection, instance segmentation, and keypoint detection. The improved YOLOv8 model can simultaneously complete two tasks of classification and texture detection, and retain the Backbone network and Neck network of the baseline model; among them:
[0042] The Backbone network includes a Conv convolution module as the input layer, and repeatedly passes through the Conv convolution module to the C2f module for downsampling to extract general features; the general features are passed to the Neck network to realize texture detection and output texture line features;
[0043] After the 9th layer C2f module, a classification task branch is added, and global semantic information analysis is performed based on the classification task branch to extract the types of livestock and poultry meat and the confidence of the results;
[0044] Further explanation, the classification task branch includes three first convolution modules and two fully connected FC layers. Based on the classification task branch, the types and parts features of livestock and poultry meat are output, and the recognition accuracy of the types and parts features of livestock and poultry meat is initially determined, marked as the confidence of the results. The higher the confidence of the results, the higher the accuracy of the current algorithm for the identified types of livestock and poultry meat. On the contrary, the lower the confidence of the results, the lower the accuracy of the current algorithm for the identified types of livestock and poultry meat. The first convolution module includes one Conv2d layer + one BN (Batch Normalization) layer + one Hardswish activation layer + one Conv2d layer + one BN layer;
[0045] It should be noted that: currently, the number of types of livestock and poultry meat classification is 10, namely pork belly, pork tenderloin, pork loin, pork leg, beef tenderloin, beef rib, beef tendon, beef brisket, chicken breast, and chicken leg. Among them, the Conv2d layer, BN layer, Hardswish activation function, and fully connected layer are all common network structures in the deep learning framework, and their principles and structures will not be elaborated here.
[0046] After the Neck network corresponds to the C2f module, the HoughL layer of Hough line detection is inserted, which directly detects the texture direction of the feature map to extract the large-size feature map. The large-size feature map is dimension-reduced by the AvgPool layer to obtain a small-size feature map, and the small-size feature map is dimension-increased by the Upsample layer to obtain a dimension-increased feature map, and the line detection result is output through the concat splicing layer.
[0047] The Neck network includes an Upsample layer + a concat splicing layer, which is used to fuse the shallow and deep layer features. The fused shallow and deep layer features are optimized and extracted by the C2f layer to obtain the fused features. The HoughL layer of Hough line detection is used after the 16th, 19th, and 22nd layers of the Neck network, that is, the Hough line detection layer detects lines in the feature map. The large-size feature map after detection is average-pooled, and the small-size feature map is upsampled and spliced with the medium-size feature map, and then the line detection result of the feature map is converted into a line in the image to complete the line detection task. The detection head of the baseline model is changed to a detection head only for lines. The line is the direction of the surface texture of the livestock and poultry meat types.
[0048] It should be noted that for the HoughL layer: Hough line detection is a classic method for detecting lines in an image, and its principle will not be elaborated here. There are already cases where Hough line detection is applied to high-order feature images.
[0049] Step S2: Using the target image as the input factor, the improved YOLOv8 model is iteratively trained until the training result meets the update requirements of the composite loss function, and the detection result is output. The detection result is the texture line feature, the livestock and poultry meat type, and the result confidence, where: the texture line feature includes the starting point, ending point, and angle of the texture line;
[0050] It should be noted that: the side with clearly recognized texture is defined as the texture side, the image corresponding to the texture side is determined as the target image, and the target image is detected by the improved YOLOv8 model to output the texture line feature, the livestock and poultry meat type, and the result confidence.
[0051] Specifically, the composite loss function includes a classification loss function and a line detection loss function;
[0052] The composite loss function is: L = L cls +L line
[0053] Among them, L cls is the classification loss function, and L line is the line detection loss function. The specific formulas are as follows:;
[0054] The classification loss function is:
[0055] k represents the category of livestock and poultry meat types. Assume k = 3, indicating that there are a total of 3 categories, namely pork, beef, and chicken; y ij is the true label, represented using one-hot encoding, where only the position corresponding to the target category is 1 and the other positions are 0; is the confidence level of the prediction result of the model.
[0056] The straight-line detection loss function is: L line = L distance_center + L distance_leftpoint ;
[0057] The loss function of straight-line detection is divided into two parts, namely the distance from the midpoint of the predicted straight line to the midpoint of the true straight line and the distance difference between the starting point on the left side of the predicted straight line and the starting point on the left side of the true straight line. For example, Figure 3 in which θ g_center represents the midpoint of the true straight line, and θ g_leftpoint represents the starting point on the left side of the true straight line; θ p_center represents the midpoint of the predicted straight line, and θ p_leftpoint represents the starting point on the left side of the predicted straight line; d1 represents the distance difference of the midpoint, and the projected values in the horizontal and vertical directions are d h1 and d w1 ; d2 represents the distance difference of the starting point on the left side, and the projected values in the horizontal and vertical directions are d h2 and d w2 .
[0058]
[0059] In the formula: e is the natural logarithm.
[0060] Based on the above formula combined with the actual application scenario, technicians set the update requirements for the composite loss function after repeated training in the improved YOLOv8 model with a large amount of experimental data, so that the predicted value of the improved YOLOv8 model approaches the true label infinitely.
[0061] Step S3: Determine whether the texture straight-line feature, the type of livestock and poultry meat, and the result confidence level simultaneously meet the preset conditions for the type of livestock and poultry meat. If so, it is determined that the current type of livestock and poultry meat is successfully recognized; otherwise, re-recognize the type of livestock and poultry meat or conduct manual quality inspection;
[0062] Specifically, the preset conditions for the type of livestock and poultry meat include:
[0063] Condition 1: The confidence level of the recognition result of the type of livestock and poultry meat by the improved YOLOv8 model is higher than the result confidence threshold (here, the result confidence threshold is taken as 0.7, and the parameter value can be adjusted according to actual experience);
[0064] Condition 2: Among the straight lines detected in the improved YOLOv8 model, at least a% of the straight line lengths reach b% of the total sample length. (Here, a ranges from 30 to 40, and b ranges from 40 to 60. The parameter values can be adjusted according to actual experience);
[0065] Condition 3: The variance of the angles between all detected straight lines and the horizontal line does not exceed c (c ranges from 25 to 64, and the parameter can be adjusted according to actual experience).
[0066] If only Condition 1 is not met, the image is input into the pre-trained original YOLOv8 model. Since the recognition task of the original model is only object detection, the recognition accuracy is relatively high for the classification task alone. If it is successfully recognized after being input into the original YOLOv8 model, subsequent processing is carried out in combination with the texture direction information of the improved model. If it still cannot be correctly recognized, the sample is excluded and judged by manual inspection.
[0067] If Condition 1 is met but either Condition 2 or Condition 3 is not met, the sample is turned over and re-photographed for recognition. If all sides have been photographed and recognized and still cannot meet Conditions 2 and 3, the meat product is stretched and then recognized again. If it still cannot meet Conditions 2 and 3, it is considered that the surface texture direction of the meat product may have regionality, so the following operations are carried out:
[0068] A. Input the meat product image into the original YOLOv8 model to obtain the bounding box of the meat product.
[0069] B. Divide the bounding box into 9 small boxes on average, and the image in each small box is separately input into the improved YOLOv8 model for recognition classification and texture, but only the branch that outputs straight lines is run, and Conditions 2 and 3 are detected again.
[0070] C. If more than d boxes (d ranges from 5 to 6, and the parameter can be adjusted according to actual experience) meet Conditions 2 and 3, it is considered that the texture of the meat product has regionality, and the cutting path is adjusted according to different regions in subsequent processing. If it still does not meet the conditions, it is judged by manual inspection.
[0071] If Conditions 1, 2, and 3 are all not met, the sample is excluded and judged by manual inspection.
[0072] Step S4: Extract multiple texture straight line features from the target images with successful identification of livestock and poultry meat types, integrate the multiple texture straight line features into an overall texture direction, and determine the cutting direction based on the texture direction.
[0073] The judgment logic of the texture direction is as follows:
[0074]
[0075] Where: β is the texture orientation of the sample, n is the total number of recognized straight lines, and γ i is the angle between the i-th recognized straight line and the horizontal line.
[0076] In addition, it should be noted that: the cutting direction of livestock and poultry meat types needs to be planned according to the type of meat, the texture direction, and the cutting products, as follows:
[0077] Pork belly: Cut along the texture; Pork loin, beef loin, marbled beef, pork leg, beef rib: Cut into strips along the texture and slice against the texture; Beef shank: Slice against the texture; Beef brisket: Cut into pieces against the texture; Chicken breast: Shred along the texture and cut into slices crosswise against the texture; Chicken leg: Cut into pieces along the texture.
[0078] Cutting along the texture: Place the meat product on the cutting device, make the cutting tool perpendicular to the texture surface and parallel to the texture direction, and perform cutting. Complete operations such as slicing and cutting into strips according to the product requirements. If cutting into pieces is required, after the cutting into strips operation is completed, rotate the cutting tool 90 degrees and cut again.
[0079] Cutting against the texture: Place the meat product on the cutting device, make the cutting tool perpendicular to the texture surface and perpendicular to the texture direction, and perform cutting. Complete operations such as slicing and cutting into strips according to the product requirements. If cutting into pieces is required, after the cutting into strips operation is completed, rotate the cutting tool 90 degrees and cut again.
[0080] As described above, it is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claimed rights.
[0081] Finally: The above is only the preferred embodiment of the present invention and is not used to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should all be included within the protection scope of the present invention.
Claims
1. A method for identifying and cutting livestock and poultry meat texture based on deep learning, characterized in that, It includes the following steps: Step S1: Add a classification task branch after the 9th layer corresponding to the C2f module in the Backbone network of the YOLOv8 model, and use the HoughL layer for line detection after the 16th, 19th, and 22nd layers corresponding to the C2f module in the Neck network to obtain an improved YOLOv8 model for bidirectional detection; Step S2: Use the target image as the input factor to iteratively train the improved YOLOv8 model until the training result meets the update requirements of the composite loss function, and output the detection result. The detection result is the texture line feature, the type of livestock and poultry meat, and the result confidence. The texture line feature includes the starting point, ending point, and angle of the texture line; Step S3: Judge whether the texture line feature, the type of livestock and poultry meat, and the result confidence simultaneously meet the preset conditions for the type of livestock and poultry meat. If so, it is determined that the current type of livestock and poultry meat is successfully recognized; otherwise, re-recognize the type of livestock and poultry meat or perform manual quality inspection; Step S4: Extract multiple texture line features from the target image in which the type of livestock and poultry meat is successfully recognized, integrate the multiple texture line features into an overall texture direction, and determine the cutting direction based on the texture direction.
2. The method for identifying and cutting livestock and poultry meat texture based on deep learning according to claim 1, characterized in that, The classification task branch extracts the type of livestock and poultry meat and the result confidence through global semantic information analysis; the classification task branch includes three first convolution modules and two fully connected FC layers. The first convolution module includes a Conv2d layer, a BN layer, a Hardswish activation layer, a Conv2d layer, and a BN layer.
3. The method for identifying and cutting livestock and poultry meat texture based on deep learning according to claim 2, characterized in that, The HoughL layer for line detection performs texture direction detection on the feature map to extract a large-size feature map, obtains a small-size feature map through the AvgPool downsampling layer for the large-size feature map, obtains an upsampled feature map through the Upsample upsampling layer for the small-size feature map, and outputs the line detection result through the concat splicing layer.
4. The method for identifying and cutting livestock and poultry meat texture based on deep learning according to claim 3, wherein The composite loss function includes a classification loss function and a line detection loss function.
5. The method for identifying and cutting livestock and poultry meat texture based on deep learning according to claim 4, characterized in that, The loss functions for line detection are respectively the distance from the midpoint of the predicted line to the midpoint of the true line and the distance difference between the starting point on the left side of the predicted line and the starting point on the left side of the true line.
6. The method for identifying and cutting livestock and poultry meat texture based on deep learning according to claim 5, characterized in that, The preset conditions for the type of livestock and poultry meat include: Condition 1: The result confidence of the improved YOLOv8 model for recognizing the type of livestock and poultry meat is higher than the result confidence threshold; Condition 2: Among the lines detected in the improved YOLOv8 model, at least a% of the line lengths reach b% of the total sample length; Condition 3: The variance of the angles between all detected lines and the horizontal line does not exceed c; If Condition 1 is not satisfied, input the image into the original YOLOv8 model for recognition. If the recognition is successful, perform subsequent processing in combination with the texture direction information of the improved model; if it still cannot be correctly recognized, eliminate the sample and let the manual detection determine.
7. The method for identifying and cutting livestock and poultry meat texture based on deep learning according to claim 6, characterized in that, If Condition 1 is satisfied, but any one of Condition 2 or Condition 3 is not satisfied, stretch the texture surface of the sample and then perform recognition again; If it still cannot meet Conditions 2 and 3 after stretching, it is considered that the texture direction on the meat surface has regionality, and enter the next operation.
8. The method for identifying and cutting livestock and poultry meat texture based on deep learning according to claim 7, characterized in that, The regionalization processing logic is: Input the meat image into the original YOLOv8 model to obtain the bounding box of the meat; The bounding box is evenly divided into multiple small boxes, and the images within each small box are separately input into the improved YOLOv8 model. The branch for running the output line is executed, and it is detected again whether conditions 2 and 3 are met; If the number of bounding boxes greater than the preset number meets conditions 2 and 3, it is considered that the texture of the meat product has regional characteristics, and the cutting path is adjusted according to different regions during subsequent processing; if it still does not meet the conditions, the sample is excluded and judged by manual inspection.
9. The method for identifying and cutting livestock and poultry meat texture based on deep learning according to claim 8, wherein The judgment logic for the texture direction is as follows: Where: β is the texture orientation of the sample, n is the total number of recognized straight lines, and γ i is the angle between the i-th recognized straight line and the horizontal line.