Marbling is a crucial indicator that significantly impacts beef quality grading. Currently, Chinese beef processing enterprises rely on prof
Marbling is a crucial indicator that significantly impacts beef quality grading. Currently, Chinese beef processing enterprises rely on professional graders who visually assess marbling using national standard atlases. However, this manual evaluation method is highly subjective and time consuming. This study proposes a beef marbling grading algorithm based on an enhanced YOLOv8x model to address these challenges. The model integrates a convolutional neural network (CNN) augmented with an improved attention mechanism and loss function, along with a Region-of-Interest (ROI) preprocessing algorithm to automate the marbling grading process. A dataset comprising 1300 beef sample images was collected and split into training and test sets at an 8:2 ratio. Comparative experiments were conducted with other deep learning models as well as ablation tests to validate the proposed model’s effectiveness. The experimental results demonstrate that the improved YOLOv8x achieves a validation accuracy of 99.93%, a practical grading accuracy of 97.82%, and a detection time of less than 0.5 s per image. The proposed algorithm enhances grading efficiency and contributes to intelligent agricultural practices and livestock product quality assessment.