Method and device for evaluating intramuscular fat content of sheep living body based on ultrasonic image

By combining ultrasound image segmentation and prediction models, the destructive nature of traditional methods for measuring intramuscular fat content in sheep has been solved, enabling high-precision and rapid assessment of intramuscular fat content in live sheep.

CN121258910APending Publication Date: 2026-01-02XINJIANG ACAD OF ANIMAL SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511346798.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

Traditional methods for measuring intramuscular fat content in sheep require slaughter, which is highly destructive and cannot be used on live animals. Existing deep learning methods also lack sufficient prediction accuracy.

Method used

A two-stage approach based on ultrasound images is adopted. First, the oculomotor region in the spinal ultrasound image is segmented using an image segmentation model. Then, the intramuscular fat content prediction model based on the ConvNext-Tiny architecture is used, and global attention mechanism and multi-scale feature fusion are introduced for prediction.

Benefits of technology

It enables high-precision, non-invasive, and rapid assessment of intramuscular fat content in sheep, suitable for live animal measurement, reducing costs and improving prediction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121258910A_ABST
    Figure CN121258910A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for evaluating intramuscular fat content of a sheep living body based on an ultrasonic image, and relates to the field of intramuscular fat prediction based on deep learning, and the method comprises the steps: obtaining a spinal ultrasonic image of a target sheep, inputting the spinal ultrasonic image into an image segmentation model, and obtaining an eye muscle region segmentation mask in the spinal ultrasonic image; and according to the eye muscle region segmentation mask and the spine ultrasonic image, obtaining an eye muscle region feature map, inputting the eye muscle region feature map into the intramuscular fat content prediction model, and predicting the corresponding intramuscular fat content. On one hand, an image segmentation model adopts an improved model based on a DeepLabV3 + architecture, an eye muscle region can be accurately segmented, and further the intramuscular fat content is accurately predicted, on the other hand, an intramuscular fat content prediction model adopts an architecture based on ConvNext-Tiny, and a global attention mechanism and multi-scale feature fusion are introduced into the architecture, so that the intramuscular fat content prediction accuracy is improved. And the prediction accuracy of the intramuscular fat content of the target sheep is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of intramuscular fat prediction based on deep learning, and particularly relates to a method and device for evaluating intramuscular fat content of sheep in vivo based on ultrasound images. BACKGROUND

[0002] Intramuscular fat (IMF) is an important factor determining the quality of mutton. Traditional methods for measuring IMF include Soxhlet extraction, Roes-Gottlieb method and gravimetric method, which have high precision. However, these methods have a major drawback, that is, the sheep must be slaughtered and then a series of measurements of meat quality traits are performed, which is highly destructive. After slaughter, the meat sample is treated by removing external fat, grinding and drying, and then the fat is extracted by an organic solvent, which takes a long time and consumes a large amount of cost, and can only be performed after the animal is slaughtered, and cannot be used for live animals. In addition, manual measurement is usually required, which relies on skilled technicians.

[0003] How to reduce the above-mentioned cost and detect the intramuscular fat of sheep based on live animals has become the focus of research. With the development of computer vision and deep learning technology, non-invasive imaging methods such as ultrasound imaging, CT, MRI and other related technologies have been gradually widely researched and applied in the field of animal husbandry. Among them, ultrasound waves can be distinguished from muscle, fat and bone tissue according to the degree of reflection of ultrasound waves in different media due to the difference in propagation of ultrasound waves in different tissues. Therefore, ultrasound imaging has the advantages of high efficiency, economy and non-invasiveness, providing a new way and method for estimating the IMF content of sheep. However, early research on IMF prediction relies on traditional statistical methods such as linear regression (LSR) and support vector machine (SVM), although certain achievements have been made, but the current IMF content prediction accuracy still has deficiencies. SUMMARY

[0004] The purpose of the present application is to provide a method and device for evaluating the intramuscular fat content of sheep in vivo based on ultrasound images, which can improve the accuracy of predicting the intramuscular fat content of target sheep.

[0005] To achieve the above-mentioned purpose, the present application provides the following solutions:

[0006] In a first aspect, the present application provides a method for evaluating the intramuscular fat content of sheep in vivo based on ultrasound images, comprising:

[0007] obtaining a spine ultrasound image of a target sheep;

[0008] inputting the spine ultrasound image into an image segmentation model to obtain an eye muscle region segmentation mask in the spine ultrasound image;

[0009] obtaining an eye muscle region feature map according to the eye muscle region segmentation mask and the spine ultrasound image;

[0010] The eye muscle region feature map is input into an intramuscular fat content prediction model to predict the corresponding intramuscular fat content; the intramuscular fat content prediction model adopts an architecture based on ConvNext-Tiny, and a global attention mechanism and multi-scale feature fusion are introduced into the architecture.

[0011] In a second aspect, the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for evaluating the intramuscular fat content of a sheep in vivo based on an ultrasound image.

[0012] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executable by a processor to implement the method for evaluating the intramuscular fat content of a sheep in vivo based on an ultrasound image.

[0013] In a fourth aspect, the present application provides a computer program product comprising a computer program, wherein the computer program is executable by a processor to implement the method for evaluating the intramuscular fat content of a sheep in vivo based on an ultrasound image.

[0014] According to the specific embodiments provided by the present application, the following technical effects are disclosed:

[0015] The present application provides a method and device for evaluating the intramuscular fat content of a sheep in vivo based on an ultrasound image, which comprises obtaining the spinal ultrasound image of a target sheep and inputting it into an image segmentation model to obtain the eye muscle region segmentation mask in the spinal ultrasound image; according to the eye muscle region segmentation mask and the spinal ultrasound image, the eye muscle region feature map is obtained and input into an intramuscular fat content prediction model to predict the corresponding intramuscular fat content; the intramuscular fat content prediction model adopts an architecture based on ConvNext-Tiny, and a global attention mechanism and multi-scale feature fusion are introduced into the architecture, thereby improving the accuracy of the intramuscular fat content prediction of the target sheep. In addition, the spinal ultrasound image of the target sheep is first applied to the image segmentation model to obtain the eye muscle region segmentation mask, and then the intramuscular fat content is predicted based on the segmented eye muscle region, which can improve the accuracy of the intramuscular fat content prediction. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0017] Figure 1An application environment diagram of a method for evaluating IMF content of a sheep in vivo based on an ultrasound image according to an embodiment of the present application;

[0018] Figure 2 A flowchart of a method for evaluating IMF content of a sheep in vivo based on an ultrasound image according to an embodiment of the present application;

[0019] Figure 3 A structure diagram of an image segmentation model according to an embodiment of the present application;

[0020] Figure 4 A structure diagram of an IMF content prediction model according to an embodiment of the present application;

[0021] Figure 5 An IMF experimental data statistical diagram of a Hart crossbred sheep according to an embodiment of the present application;

[0022] Figure 6 An eye muscle segmentation diagram at different stages according to an embodiment of the present application;

[0023] Figure 7 A structure diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0025] In order to make the above objectives, characteristics and advantages of the present application more apparent, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0026] The method for evaluating IMF content of a sheep in vivo based on an ultrasound image provided by the embodiments of the present application can be applied to, for example, Figure 1The terminal communicates with the server through the network. The data storage system can store the data required to be processed by the server. The data storage system can be separately arranged, integrated on the server, or placed on the cloud or other servers. The terminal can send the spine ultrasound image of the target sheep to the server. After the server receives the spine ultrasound image of the target sheep, the server inputs the spine ultrasound image into the image segmentation model to obtain an eye muscle region segmentation mask in the spine ultrasound image; according to the eye muscle region segmentation mask and the spine ultrasound image, an eye muscle region feature map is obtained; the eye muscle region feature map is input into the intramuscular fat content prediction model to predict the corresponding intramuscular fat content; the intramuscular fat content prediction model adopts an architecture based on ConvNext-Tiny, and introduces a global attention mechanism and multi-scale feature fusion in the architecture. The server can feed back the obtained intramuscular fat content to the terminal. In addition, in some embodiments, the method for evaluating the intramuscular fat content of a sheep in vivo based on an ultrasound image can also be implemented by the server or the terminal alone, such as the terminal directly evaluating the intramuscular fat content of a sheep in vivo for the spine ultrasound image of the target sheep, or the server obtaining the spine ultrasound image of the target sheep from the data storage system and evaluating the intramuscular fat content of a sheep in vivo.

[0027] The terminal can be, but is not limited to, various desktop computers, notebook computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of multiple servers, and can also be a cloud server.

[0028] In an exemplary embodiment, as Figure 2 shown, a method for evaluating the intramuscular fat content of a sheep in vivo based on an ultrasound image is provided. The method is executed by a computer device, which can be executed by a terminal or a server alone, or by a terminal and a server together. In the embodiments of the present application, the method is applied to the server in Figure 1 The following steps 101 to 104 are included.

[0029] Step 101, obtaining a spine ultrasound image of a target sheep.

[0030] Step 102, inputting the spine ultrasound image into an image segmentation model to obtain an eye muscle region segmentation mask in the spine ultrasound image.

[0031] Step 103, according to the eye muscle region segmentation mask and the spine ultrasound image, an eye muscle region feature map is obtained.

[0032] Step 104, input the eye muscle region feature map into the intramuscular fat content prediction model to predict the corresponding intramuscular fat content; the intramuscular fat content prediction model adopts the architecture based on ConvNext-Tiny, and introduces global attention mechanism and multi-scale feature fusion in the architecture.

[0033] The steps 101 to 104 described above are implemented, and the application estimates the intramuscular fat content in two stages. In the first stage, an image segmentation model is applied to accurately segment the eye muscle region in the ultrasound image parallel to the spine; in the second stage, an improved model based on ConvNext Tiny architecture (intramuscular fat content prediction model) is introduced, global attention mechanism and multi-scale feature fusion are introduced, the global attention mechanism (GA) is used to enhance the key region perception ability, and the multi-scale feature (MS) is used to retain local and global information. When the GA-MS-ConvNext architecture proposed in the first stage is used to estimate the intramuscular fat content, the prediction accuracy and robustness are significantly improved, which provides a high-precision and high-efficiency solution for live animal meat quality evaluation, and has important significance for promoting the development of intelligent animal husbandry.

[0034] In another exemplary embodiment of the application, the image segmentation is performed in the first stage to obtain the eye muscle region, wherein the image segmentation model adopts an improved model based on DeepLabV3+ architecture, which aims to segment the background long muscle region in the ultrasound image collected parallel to the spine of the sheep, and prepare for the next step of intramuscular fat content prediction. As shown in Figure 3 The image segmentation model mainly includes the following three parts:

[0035] (1) MobileNetV2 is used as a lightweight backbone network, and the input image of 704x448x3 is down-sampled to 352x224x16 through initial 3x3 convolution (stride=2, padding=1), and multi-scale features are gradually extracted through 7 inverted residual bottleneck layers (corresponding to the Bottleneck block in Figure 3 , with an expansion ratio of 6), wherein the 4th layer further compresses the spatial dimension to 88x56 by stride=2, and finally outputs a high-dimensional feature map of 22x14x320.

[0036] The ultrasound image of 704x448x3 is input, and the image is down-sampled to 352x224x16 through initial 3x3 convolution (stride=2, padding=1), and the calculation process is as follows:

[0037] F o1 =BN(ReLU(Conv 3×3 ,s=2(Input)))

[0038] Subsequently, 7 Bottleneck blocks are used for deep feature extraction, and an inverted residual structure with an expansion ratio of 6 is adopted. The first and second inverted residual bottleneck layers maintain a resolution of 352x224x16, the third inverted residual bottleneck layer is down-sampled to 176x112x32 with stride=2, the fourth and fifth inverted residual bottleneck layers are further down-sampled to 88x56x64, the sixth inverted residual bottleneck layer is down-sampled to 44x28x128, and finally a high-dimensional feature map of 22x14x320 is output. The calculation process of each Bottleneck block is as follows:

[0039] F s = ReLU(BN(Conv 1×1 (F in ))

[0040] F t = ReLU(BN(DWConv 3×3 (F s ))

[0041] F o2 = BN(Conv 1×1 (F t ))+ F in

[0042] (2) Design an enhanced ASPP module. On the basis of the traditional dilated convolution, separable convolution is introduced to reduce the computational complexity. Through four-branch parallel processing (including 1x1 standard convolution, 3x3 dilated convolution with d=6 and d=12, and global average pooling + bilinear interpolation), the outputs of each branch are activated by BatchNorm and ReLU, and then the features are spliced. Then, 1x1 convolution is used to fuse 256-dimensional features with shallow features output by the main network (such as the fourth or fifth inverted residual bottleneck layer in Figure 3 ).

[0043] The processing process of the enhanced ASPP module is as follows:

[0044] Branch 1: 1x1 standard convolution generates 256-dimensional features:

[0045] F1 = ReLU(BN(Conv 1×1 (F_{in}))

[0046] Branch 2: 3x3 dilated convolution (d=6) using separable convolution:

[0047] F2 = ReLU(BN(Conv 3×3 , d=6(F_{in}))

[0048] Branch 3: 3x3 dilated convolution (d=12) using separable convolution:

[0049] F3 = ReLU(BN(Conv) 3×3 ,d=12(F_{in})))

[0050] Branch 4: Restore spatial dimension using bilinear interpolation after global average pooling:

[0051] F4=Interp(GAP(F_{in}), size=(22,14))

[0052] GAP() represents global average pooling operation; Interp() represents bilinear interpolation operation.

[0053] The outputs of the four branches are concatenated along the channel dimension to obtain 22×14×1024 features, which are then compressed to 256 dimensions by a 1×1 convolution:

[0054] F aspp =Conv 1×1 (Concat(F1, F2, F3, F4))

[0055] (3) Construct a multi-level progressive upsampling decoder (e.g.) Figure 3 The algorithm consists of five levels, each containing a 3×3 transposed convolution (stride = 2, output padding = 1), a BN layer, and a LeakyReLU layer (α = 0.2). Finally, a 704×448×1 segmentation mask is generated by compressing the number of channels using a 1×1 convolution and applying sigmoid activation. α defines the output slope of the LeakyReLU function when the input value is negative.

[0056] The processing procedure of the five-stage progressive upsampling decoder is as follows:

[0057] Level 1: Transposed convolution upsamples 22×14 to 44×28:

[0058] F up1 =LeakyReLU(BN(ConvTrans) 3×3 , s = 2(F aspp )))

[0059] Level 2: Transposed convolution upsamples 44×28 to 88×56:

[0060] F up2 =LeakyReLU(BN(ConvTrans) 3×3 , s = 2(F up1 )))

[0061] Level 3: Transposed convolution upsamples 88×56 to 176×112:

[0062] F up3=LeakyReLU(BN(ConvTrans) 3×3 , s = 2(F up2 )))

[0063] Level 4: Transposed convolution upsamples 176×112 to 352×224:

[0064] F up4 =LeakyReLU(BN(ConvTrans) 3×3 , s = 2(F up3 )))

[0065] Level 5: Transposed convolution upsamples 352×224 to 704×448:

[0066] F up5 =LeakyReLU(BN(ConvTrans) 3×3 , s = 2(F up4 )))

[0067] Finally, a 704×448×1 segmentation mask is generated through 1×1 convolution and sigmoid activation:

[0068] Mask = σ(Conv) 1×1 (F up5 ))∈R 704×448×1 .

[0069] Where σ() represents the Sigmoid function.

[0070] Based on the above, the image segmentation model includes: a feature extraction module, an enhanced ASPP module, a decoder upsampling module, and a first convolutional layer connected in sequence.

[0071] The feature extraction module includes a second convolutional layer, M inverse residual bottleneck layers, and a third convolutional layer connected in sequence. The output of the enhanced ASPP module is also connected to the output of the target inverse residual bottleneck layer. The target inverse residual bottleneck layer refers to any one of the M inverse residual bottleneck layers. The output of the target inverse residual bottleneck layer undergoes a 1×1 convolution and downsampling operation, then is fused with the output of the enhanced ASPP module, and after another 1×1 convolution, it is input to the decoder upsampling module. The first convolutional layer outputs an eye muscle region segmentation mask.

[0072] like Figure 3 As shown, the enhanced ASPP module includes: a fourth convolutional layer, a first dilated convolutional layer, a second dilated convolutional layer, a global average pooling layer, a feature concatenation layer, and a fifth convolutional layer.

[0073] The inputs of the fourth convolutional layer, the first dilated convolutional layer, the second dilated convolutional layer, and the global average pooling layer are all connected to the output of the feature extraction module; the inputs of the fourth convolutional layer, the first dilated convolutional layer, the second dilated convolutional layer, and the global average pooling layer are all connected to the input of the feature concatenation layer; the output of the feature concatenation layer is connected to the input of the fifth convolutional layer; and the output of the fifth convolutional layer is connected to the input of the decoder upsampling module.

[0074] The decoder upsampling module includes multiple transposed convolutional layers connected in sequence.

[0075] In another exemplary embodiment of this application, step 102 involves inputting a spinal ultrasound image into an image segmentation model to obtain a segmentation mask for the oculomotor region in the spinal ultrasound image, specifically including:

[0076] (1) Input the spinal ultrasound image into the feature extraction module to obtain the first feature map.

[0077] (2) Input the first feature map into the enhanced ASPP module to obtain the second feature map.

[0078] (3) The second feature map and the output of the target inverse residual bottleneck layer in the feature extraction module are fused to obtain the first fused feature map.

[0079] (4) Input the first fused feature map into the decoder upsampling module to obtain the third feature map.

[0080] (5) Input the third feature map into the first convolutional layer to obtain the oculomotor region segmentation mask in the spinal ultrasound image.

[0081] The image segmentation model used for processing spinal ultrasound images is a trained model. On the test set, this model achieves a Dice coefficient of 0.961 (±0.02) and has only 5.3M parameters, which is 18% of ResNet-50. In a real-world test environment using an NVIDIA GeForce RTX 4070 Laptop GPU (80W TGP), the inference speed reaches 79 FPS when inputting a single 704×448 image. Its lightweight characteristics make it particularly suitable for edge computing deployments in portable ultrasound devices. In addition to standard metrics (IoU = 0.93, Accuracy = 0.97, Precision = 0.95, Recall = 0.94), the evaluation phase also introduced R... 2The consistency between the model's predictions (0.91) and ICC (0.98, 95% CI: 0.96-0.99) validates the model's predictions and the annotations by professional researchers, making the IMF content predicted based on image segmentation results practically meaningful. The lightweight nature of the image segmentation model stems from: 1) the inverse residual design of the MobileNetV2 backbone network; 2) the use of separable convolutions instead of standard convolutions in the ASPP module, reducing computation by 72%; and 3) the shallow feature fusion strategy (corresponding to the feature processing and fusion process between the feature extraction module and the decoder upsampling module) avoids complex decoding structures while ensuring accuracy.

[0082] The image segmentation model in this application uses MobileNetV2 as the backbone network and improves it to DeepLabV3+ model to achieve accurate segmentation of the ocular muscle region in ultrasound images parallel to the sheep's spine, providing an accurate image basis for subsequent prediction of intramuscular fat content.

[0083] In another exemplary embodiment of this application, in the second stage, the intramuscular fat content is predicted based on the eye muscle region segmented from the above image.

[0084] The eye muscle region segmentation mask (704×448 binary image) output by the DeepLabV3+-based image segmentation model in the first stage is multiplied pixel by pixel with the original spinal ultrasound image to extract the ROI (160×704 pixels) that contains only the eye muscle region.

[0085] The intramuscular fat content prediction model is a regression prediction model built on an improved ConvNext architecture. First, the input 160×704 pixel ultrasound image undergoes standardized preprocessing. Then, through normalization with a mean of 0.5 and a standard deviation of 0.45, the single-channel grayscale image is expanded into a three-channel image. The formula for calculating channel replication is as follows:

[0086] I norm = (I_input - 0.5) / 0.45

[0087] I_input is the input to the intramuscular fat content prediction model.

[0088] The feature extraction stage employs a multi-level progressive downsampling architecture, such as... Figure 4 Taking the three-stage progressive downsampling architecture shown as an example, the first stage of progressive downsampling uses a 4×4 convolutional kernel with a stride of 4 to achieve a four-fold downsampling, outputting a 96-channel feature map with a resolution of 40×176:

[0089] F 1 =GELU(BN(Conv2d(I norm W 4×4 stride=4)))

[0090] The second stage of progressive downsampling, using a 2×2 convolution kernel with a stride of 2, yields a 192-dimensional feature representation of 20×88:

[0091] Downsample(x)=LayerNorm(Conv2d(x,W 2×2 stride=2))

[0092] Here, LayerNorm() represents layer normalization. Downsample(x) is a complete downsampling operation. x refers to the input feature of the downsampling operation.

[0093] The third stage involves progressive downsampling, followed by a second 2x downsampling to generate 384-dimensional high-level semantic features (10×44). Each stage includes an improved ConvNext block, whose core consists of a 7×7 depthwise separable convolution and a GeLU activation function. Combined with an inverted bottleneck structure that first expands the channels by four times and then compresses them, this significantly enhances feature representation capabilities. In all three stages, the downsampling operation is followed by a deeper processing of the downsampled features using the improved ConvNext block.

[0094] Multi-scale feature fusion innovatively integrates hierarchical information: it combines the first-stage feature F 1 (correspond Figure 4 The first-stage feature (40×176×96) is compressed to 64 dimensions by 1×1 convolution and then downsampled to 20×88 resolution. The second-stage feature F 2 (correspond Figure 4 The second-stage feature (20×88×192) is projected to 64 dimensions through a 1×1 convolution while preserving its original size. The third-stage feature F 3 (correspond Figure 4 The Stage 3 features (10×44×384) are upsampled to 20×88 resolution via bilinear interpolation, and then a spatial weight map is generated through a two-layer convolutional global attention mechanism. The calculation formula for the global attention mechanism is as follows:

[0095] Attn(x)=σ(Conv 1×1 (GELU(Conv 1×1 (x1))))

[0096] x1 represents the input to the global attention mechanism layer.

[0097] The three features are concatenated at a uniform 20×88 scale to form 512-channel features, which are then reduced to 256 dimensions by 1×1 convolution and further compressed to 128 channels after GELU activation.

[0098]

[0099] in, Indicates the first-stage feature F 1 Features after 1×1 convolution and downsampling; Indicates the second-stage feature F 2 Features projected after 1×1 convolution; Indicates the third-stage feature F 3 Features obtained through bilinear interpolation upsampling and global attention mechanism.

[0100] Finally, global average pooling is used to compress the 20×88×128 features into a 128-dimensional vector, which is then normalized and output as an IMF prediction through a fully connected layer.

[0101] IMF=Linear(LayerNorm(GAP(F_fused)))

[0102] Here, Linear() represents the linear operation of a fully connected layer.

[0103] Based on the above, the intramuscular fat content prediction model includes a multi-stage downsampling module, a multi-scale feature fusion module, and a prediction output module.

[0104] The multi-stage downsampling module includes multiple sequentially connected downsampling stages. Each downsampling stage includes a convolutional layer and a ConvNext block, which are used to extract multi-scale features from the input eye muscle region feature map to obtain multiple feature maps of different scales.

[0105] The multi-scale feature fusion module includes a feature projection layer, a global attention mechanism layer, and a feature splicing and fusion layer, which are used to fuse feature maps of different scales.

[0106] The prediction output module includes a pooling layer, a normalization layer, and a fully connected layer, used to output the predicted value of intramuscular fat content.

[0107] The output of the multi-stage downsampling module is connected to the input of the multi-scale feature fusion module, and the output of the multi-scale feature fusion module is connected to the input of the prediction output module.

[0108] In another exemplary embodiment of this application, step 104, inputting the eye muscle region feature map into the intramuscular fat content prediction model to predict the corresponding intramuscular fat content, specifically includes:

[0109] (1) Input the feature map of the eye muscle region into the multi-stage downsampling module, and perform multi-level feature extraction through multiple downsampling stages to obtain feature maps of multiple scales;

[0110] (2) Shallow feature maps are channel-projected and size-adjusted through a feature projection layer, and deep feature maps are attention-weighted through a global attention mechanism layer.

[0111] (3) The processed multi-scale features are fused through the feature splicing and fusion layer to obtain a fused feature map containing rich semantic information;

[0112] (4) Input the fused feature map into the prediction output module, and after processing by the pooling layer, normalization layer and fully connected layer, output the predicted value of intramuscular fat content.

[0113] The intramuscular fat content prediction model is trained when processing ocular muscle region feature maps. As an example, during the training phase, a stratified sampling strategy with an interval of 0.5 is used to ensure balanced data distribution. The optimizer uses AdamW with an initial learning rate of 3e-5 and a weight decay of 0.001. The loss function is the mean squared error. An early stopping mechanism is implemented during the validation process; the optimal model is saved when the validation loss does not decrease for 10 consecutive rounds. The evaluation system includes traditional regression indicators and statistical tests: mean squared error 0.034, mean absolute error 0.141, and coefficient of determination 0.936. Additionally, the intraclass correlation coefficient ICC(3,1) is introduced to assess predictive consistency, with a value of 0.983 and a 95% confidence interval of 0.973 to 0.993.

[0114] This application proposes a non-invasive method for estimating intramuscular fat content (IMF) based on a combination of DeepLabV3+ and GA-MS-ConvNext. It uses deep learning technology to accurately predict IMF content in sheep ultrasound images. Its core contribution lies in proposing a lightweight and high-precision two-stage prediction framework. This segmentation-regression co-design not only solves the reliance on manual annotation in traditional methods but also, through joint optimization of the GA-MS module, achieves non-destructive and rapid assessment of IMF content in live sheep (single image inference time <15ms), providing technical support for real-time monitoring in smart animal husbandry.

[0115] The image segmentation model and intramuscular fat content prediction model were trained using Python 3.9.21, PyTorch 2.0.1, an NVIDIA RTX 4070 GPU, CUDA version 11.8, cuDNN version 8.7, and the Adam optimizer with an initial learning rate of 3×10⁻⁶. -5 weight__decay is 1×10 -3 L2 regularization and early stopping mechanisms were added to prevent overfitting. The training epoch was set to 40, the batch size to 10, the loss function to mean squared error (MSE), and the optimal weights were saved based on the validation set loss.

[0116] During model training, training data were obtained from two types of sheep from the Suffolk Sheep Breeding Farm in Zhaosu County, Xinjiang: 51 Kazakh sheep aged 7.5 months and 89 Khat crossbred sheep aged 6.5 to 7.5 months, totaling 423 ultrasound images. Image acquisition was performed using the MyLab vet ultrasound device manufactured by Esaote, with the probe frequency set to 5MHz and the maximum depth set to 9cm. The original resolution of the acquired ultrasound images was 880×688. Three to four different ultrasound images were collected from each sheep, and the oculomotor region was subsequently labeled by professional researchers. The images were collected one day before slaughter, located in the longissimus dorsi muscle region between the 12th and 13th ribs on the left side. After slaughter, 200 grams of muscle samples were extracted from the same location, and the true intramuscular fat (IMF) content was measured using the Soxhlet extraction method, serving as the label for this application.

[0117] During image preprocessing (for the original ultrasound image with a resolution of 880×688, the following two steps were performed: First, regions containing information such as equipment parameters and sheep numbers were removed by cropping, retaining only the region of interest (ROI), whose rectangular coordinates are (170, 145) at the top left corner, 700 pixels wide and 420 pixels high. Second, the eye muscle regions were annotated using Labelme version 5.8.1 based on previously annotated regions, generating their corresponding JSON files). To address the issue of uneven sampling, stratified sampling was used, dividing the data into intervals of 0.5 units based on the measured IMF values, and dividing the training and test sets in an 8:2 ratio. Two enhancement methods were designed: image rotation of ±3° and ±1.5°, and brightness adjustments of γ = 0.8, 1.0, and 1.2. Fifteen enhancement samples were generated for each training image to improve model robustness.

[0118]

[0119] Where i∈{R, G, B}, γ≥0.

[0120] in, This represents the original pixel value of the i-th channel; The transformed pixel values ​​are shown. The parameter γ is set to 0.8, 1, and 1.2, generating 15 enhancement configurations based on three different rotation angles, ultimately resulting in an enhancement dataset containing 2970 images. A stratified sampling method was used, dividing the samples into nine intervals based on IMF values: [0.5, 1.0), [1.0, 1.5), [1.5, 2), [2, 2.5), [2.5, 3), [3, 3.5), [3.5, 4), [4, 4.5), and [4.5, 5). All samples were randomly shuffled and then divided into training and test sets in an 8:2 ratio, as shown in the distribution diagram. Figure 5 As shown, the image sample processing described above solves the problems of poor data quality, insufficient samples, and uneven sample distribution in existing technologies.

[0121] For model performance evaluation metrics, in the eye muscle segmentation stage, MSE, MAE, RMSE, and MAPE are used as the main evaluation metrics. MSE measures the mean squared error between predicted and actual values. This metric is sensitive to overall prediction error and helps to identify large deviations. MAE represents the mean absolute error, has a higher tolerance, and is suitable for situations with outliers. RMSE is the square root of MSE, providing an error measure consistent with the original data units. MAPE reflects the relative proportion of prediction error and is more intuitive. In the IMF content prediction stage, in addition to the above evaluation metrics, the coefficient of determination (R²) is also used. 2 The intragroup correlation coefficient (ICC, or mixed-effects model) was used to verify the accuracy of intramuscular fat assessment. Since GPU and cuDnn were used to accelerate training during the experiment, the experiment was repeated ten times, and the average value was taken as the final result.

[0122] The Dice coefficient measures the similarity between the predicted mask and the ground truth mask, and is equivalent to the F1 score in binary classification. Its calculation formula is as follows:

[0123]

[0124] Where A represents the predicted mask region, B represents the actual mask region, and ∈ is a smoothing factor to avoid the denominator being zero.

[0125] IoU (Intersection over Union) is another important metric for evaluating segmentation accuracy, and its calculation formula is as follows:

[0126]

[0127] The formulas for calculating accuracy, precision, and recall are as follows:

[0128]

[0129] Among them, TP (True Positive) is the number of pixels predicted as an eye muscle region and actually being an eye muscle region; TN (True Negative) is the number of pixels predicted as a non-eye muscle region and actually being a non-eye muscle region; FP (False Positive) is the number of pixels predicted as an eye muscle region but actually being a non-eye muscle region; and FN (False Negative) is the number of pixels predicted as a non-eye muscle region but actually being an eye muscle region.

[0130] The following evaluation indicators were used for predicting IMF content:

[0131]

[0132] in, y represents the model prediction value for the i-th sample; i This represents the true value of the i-th sample; n is the total number of samples.

[0133] The formula for calculating ICC(3,1) (two-way mixed-effects model, single measurement) is as follows:

[0134]

[0135] Where MSR is the Between-subjects Mean Square; MSE is the Error Mean Square; and k is the number of measurements per group (here, the number of model predictions).

[0136] The following describes the process of verifying the effectiveness of the image segmentation model and intramuscular fat content prediction model of this application. The image segmentation model achieved a Dice coefficient of 0.961, an IoU value of 0.925, an accuracy of 0.983, a precision of 0.968, and a recall of 0.954 on the test set, demonstrating that the image segmentation model can accurately segment the lumbar oculomotor muscle region, such as... Figure 6 As shown in Table 1. Furthermore, the image segmentation model of this application was compared with other image segmentation models, and the comparison results are shown in Table 1. Figure 6 In the image, A is the original image, B is the irregular polygonal eye muscle region after labelme annotation, C is the eye muscle mask region segmented by the image segmentation model of this application, and D is the eye muscle region segmented by the image segmentation model of this application on the original image.

[0137] Table 1. Experimental results of various models for eye muscle segmentation in Hart's hybrid sheep.

[0138] Model Dice IoU Accuracy Precision Recall ModelSize DeepLabV3+ 0.961 0.925 0.983 0.968 0.954 4.5M Unet 0.981 0.964 0.990 0.987 0.977 31M FCN 0.658 0.490 0.830 0.706 0.617 134M

[0139] Table 1 compares the performance and model complexity of three different models (the image segmentation model of this application, the Unet model, and the FCN model) on the Hart hybrid sheep eye muscle segmentation task. The experimental results show that the Unet model exhibits the best overall performance, with significantly higher Dice coefficient (0.981) and IoU (0.964) than the other models. Furthermore, its Accuracy (0.990), Precision (0.987), and Recall (0.977) are all near perfect, indicating significant advantages in segmentation accuracy and robustness. However, the Unet model size (31M) is significantly larger than the image segmentation model of this application (4.5M), resulting in relatively higher computational resource requirements.

[0140] Although the image segmentation model in this application has the smallest model size (4.5M), its performance is second only to the Unet model, especially in terms of balanced performance in Precision (0.968) and Recall (0.954), making it suitable for resource-constrained scenarios requiring high accuracy. In contrast, the FCN model lags significantly behind (Dice is only 0.658, IoU is 0.490), and has the largest model size (134M). Its computational efficiency and segmentation results are both unsatisfactory, possibly due to the insufficient adaptability of its fully convolutional structure to complex segmentation tasks.

[0141] In summary, in the actual eye muscle region segmentation process, MobileNetV2 is used as the backbone network, combined with the enhanced ASPP module. While maintaining lightweight (4.5M parameters), it significantly improves the segmentation ability of small objects (Dice coefficient 0.961) through dilated convolution and multi-branch fusion, which is better than the efficiency-accuracy balance of traditional FCN (Dice 0.658) and U-Net (31M parameters).

[0142] This application compares the intramuscular fat content prediction model with other existing network architectures, including MobileNetV2, EfficientNetV3, AlexNet, and the traditional ResNet-34. Similarly, a fully connected layer is added after the original output layer of these network architectures to make them suitable for regression tasks of IMF content prediction. The results are shown in Table 2.

[0143] Table 2 Comparison of IMF content prediction and evaluation index results for each model.

[0144] Model MSE MAE RMSE MAPE [R 2 ]] ICC GA-MS-ConvNext 0.034 0.141 0.186 8.49% 0.936 0.983 Resnet-34 0.045 0.166 0.212 10.30% 0.917 0.960 MobileNetV2 0.056 0.154 0.238 16.22% 0.868 0.893 EfficientNetV3 0.157 0.233 0.338 17.32% 0.788 0.763 AlexNet 0.332 0.422 0.565 20.97% 0.332 0.453

[0145] Analysis of the IMF content prediction experimental results for each model in Table 2 shows that the GA-MS-ConvNext model (the intramuscular fat content prediction model of this application) exhibits significant advantages in the IMF content prediction task. Its MSE (0.034), MAE (0.141), and MAPE (8.49%) are all significantly better than other comparative models. In particular, the ICC value reaches 0.983, indicating that the prediction results have near-perfect consistency with the actual values, and R... 2 The value of 0.936 confirms that the model in this application has the strongest explanatory power for data variation. Compared with the second-place ResNet-34 model, the GA-MS-ConvNext model reduced the prediction error by 24.4% (MSE decreased from 0.045 to 0.034), and R... 2The RMSE improved to 0.936, confirming the model's excellent feature extraction capabilities. Notably, model performance exhibits a clear architecture dependency: while modern CNN architectures (ResNet-34, MobileNetV2) significantly outperform the traditional AlexNet (MSE reduction of 86.5%), they still lag behind the GA-MS-ConvNext model with its attention mechanism; while the lightweight MobileNetV2, while maintaining lower computational cost, still outperforms the more parameter-intensive EfficientNetV3 (0.338) with its RMSE (0.238). These results validate the synergistic effect of the global attention mechanism and multi-scale feature fusion, which simultaneously enhances the model's local feature extraction capabilities and global context awareness, achieving accurate modeling of ultrasound image features. Therefore, in practical applications, the GA-MS-ConvNext architecture should be prioritized, ensuring both prediction accuracy and speed while consuming fewer computational resources.

[0146] The ablation experiments conducted in this application are shown in Table 3.

[0147] Table 3 Ablation experiments using the GA-MS-ConvNext model

[0148] Method MSE MAE RMSE MAPE [R 2 ]]> ICC baseline 0.055 0.187 0.236 11.38% 0.897 0.973 attention__only 0.058 0.190 0.241 12.28% 0.892 0.969 multiscale__only 0.067 0.194 0.256 11.33% 0.878 0.960 full__model 0.044 0.160 0.209 9.44% 0.919 0.982

[0149] Table 3 shows the performance improvement of the ConvNext module by the Global Attention (GA) mechanism and Multiscale Features (MS). According to the ablation experiment results, the synergistic effect of GA and MS significantly improved the performance of the intramuscular fat content prediction model. Specifically, the complete model (the intramuscular fat content prediction model that includes both GA and MS) achieved the best results on all evaluation metrics: MSE (0.044) was reduced by 20% compared to the baseline model, MAE (0.160) was reduced by 14.4%, and R... 2The MSE improved by 2.5 percentage points (0.919%), and the ICC (0.982) indicates extremely strong predictive consistency. Notably, the model performance was slightly lower than the baseline when using the attention mechanism alone (MSE increased by 5.5%), while the worst performance was achieved when only multi-scale feature fusion was used (MSE increased by 21.8%). This phenomenon indicates a significant synergistic effect between the two modules—multi-scale features provide cross-level representation capabilities, while the attention mechanism effectively filters key feature regions. The combination of these two modules allows the intramuscular fat content prediction model to focus on the most discriminative information while maintaining feature richness. In particular, the MAPE (9.44%) of the complete model was significantly lower than other configurations, demonstrating better robustness at the actual percentage error level. This ablation experiment verifies that the superior performance of the GA-MS-ConvNext model stems from the synergistic effect of its two modules: the GA mechanism focuses on key regions of ocular fat distribution through spatial weights, while the MS module captures fat texture patterns of different granularities in ultrasound images through cross-level feature fusion, thereby significantly reducing prediction error.

[0150] This application employs a two-stage model for predicting intramuscular fat content: the first stage utilizes an improved DeepLabV3+ model to achieve accurate segmentation of the ocular muscle region (Dice coefficient reaches 0.961); the second stage uses the GA-MS-ConvNext model to predict IMF content, which significantly outperforms other comparative models (MSE = 0.034, MAE = 0.141, R...). 2 =0.936, ICC=0.983). Ablation experiments verified the effectiveness of the global attention mechanism and multi-scale feature fusion, and found that the model's prediction performance on Hart crossbred sheep was better than that on Kazakh sheep. This method provides an efficient and accurate solution for estimating the IMF content of live sheep and has important practical application value.

[0151] This application also provides an application scenario in which the above-described method for assessing intramuscular fat content in live sheep based on ultrasound images is applied. Specifically, the method for assessing intramuscular fat content in live sheep based on ultrasound images provided in this embodiment can be applied to the scenario of predicting intramuscular fat content in mutton. This scenario includes an image acquisition stage, an image processing stage, and a fat content prediction stage; the image acquisition stage is used to acquire ultrasound images of the target sheep's spine; the image processing and fat content prediction stage is used to segment the eye muscle region and predict intramuscular fat content based on the acquired ultrasound images of the target sheep's spine. The method for assessing intramuscular fat content in live sheep based on ultrasound images provided in this embodiment belongs to the image processing and fat content prediction stage.

[0152] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 7As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data on assessing intramuscular fat content in sheep based on ultrasound images. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When executed by the processor, the computer program implements a method for assessing intramuscular fat content in sheep based on ultrasound images.

[0153] Those skilled in the art will understand that Figure 7 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0154] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0155] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0156] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0157] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0158] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0159] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0160] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for assessing intramuscular fat content in sheep based on ultrasound images, characterized in that, include: Obtain ultrasound images of the spine of the target sheep; The spinal ultrasound image is input into the image segmentation model to obtain the segmentation mask of the oculomotor region in the spinal ultrasound image; Based on the oculomotor region segmentation mask and spinal ultrasound images, a feature map of the oculomotor region was obtained; The feature map of the eye muscle region is input into the intramuscular fat content prediction model to predict the corresponding intramuscular fat content. The intramuscular fat content prediction model adopts a ConvNext-Tiny-based architecture and introduces a global attention mechanism and multi-scale feature fusion into the architecture.

2. The method for assessing intramuscular fat content in sheep based on ultrasound images according to claim 1, characterized in that, The intramuscular fat content prediction model adopts an enhanced architecture based on ConvNext, which includes a multi-stage downsampling module, a multi-scale feature fusion module, and a prediction output module connected in sequence. The multi-stage downsampling module includes multiple sequentially connected downsampling stages. Each downsampling stage contains a convolutional layer and a ConvNext block, which are used to extract multi-scale features from the input oculomotor region feature map. The multi-scale feature fusion module includes multiple feature projection layers for projecting feature maps of different scales onto a unified channel dimension; a global attention mechanism layer that uses channel compression and activation functions to generate a spatial attention weight map; and a feature stitching and fusion layer for stitching and fusing weighted deep features with projected shallow features through channels. The prediction output module includes a pooling layer, a normalization layer, and a fully connected layer, used to output the predicted value of intramuscular fat content.

3. The method for assessing intramuscular fat content in sheep based on ultrasound images according to claim 1, characterized in that, The image segmentation model consists of: a feature extraction module, an enhanced ASPP module, a decoder upsampling module, and a first convolutional layer connected in sequence; The feature extraction module includes a second convolutional layer, M inverse residual bottleneck layers, and a third convolutional layer connected in sequence; the output of the enhanced ASPP module is also connected to the output of the target inverse residual bottleneck layer; the target inverse residual bottleneck layer refers to any one of the M inverse residual bottleneck layers; The first convolutional layer outputs a segmentation mask for the eye muscle region.

4. The method for assessing intramuscular fat content in sheep based on ultrasound images according to claim 3, characterized in that, The enhanced ASPP module includes: a fourth convolutional layer, a first dilated convolutional layer, a second dilated convolutional layer, a global average pooling layer, a feature concatenation layer, and a fifth convolutional layer; The inputs of the fourth convolutional layer, the first dilated convolutional layer, the second dilated convolutional layer, and the global average pooling layer are all connected to the output of the feature extraction module; the outputs of the fourth convolutional layer, the first dilated convolutional layer, the second dilated convolutional layer, and the global average pooling layer are all connected to the input of the feature concatenation layer; the output of the feature concatenation layer is connected to the input of the fifth convolutional layer; and the output of the fifth convolutional layer is connected to the input of the decoder upsampling module.

5. The method for assessing intramuscular fat content in sheep based on ultrasound images according to claim 3, characterized in that, The decoder upsampling module includes multiple transposed convolutional layers connected in sequence.

6. The method for assessing intramuscular fat content in sheep based on ultrasound images according to claim 3, characterized in that, The spinal ultrasound image is input into the image segmentation model to obtain the segmentation mask of the oculomotor region in the spinal ultrasound image, specifically including: The spinal ultrasound image is input into the feature extraction module to obtain the first feature map; The first feature map is input into the enhanced ASPP module to obtain the second feature map; The second feature map and the output of the target inverse residual bottleneck layer in the feature extraction module are fused to obtain the first fused feature map. The first fused feature map is input into the decoder upsampling module to obtain the third feature map; The third feature map is input into the first convolutional layer to obtain the oculomotor region segmentation mask in the spinal ultrasound image.

7. The method for assessing intramuscular fat content in sheep based on ultrasound images according to claim 2, characterized in that, The feature map of the eye muscle region is input into the intramuscular fat content prediction model to predict the corresponding intramuscular fat content, specifically including: The feature map of the eye muscle region is processed sequentially through each downsampling stage of the multi-stage downsampling module to obtain multiple feature maps of different scales; The shallow feature map is projected onto a unified channel dimension through a feature projection layer and adjusted to the target size; The deep feature map is input into the global attention mechanism layer to generate a spatial attention weight map and perform weighted processing. The weighted deep feature map and the projected shallow feature map are concatenated along the channel dimension, and then fused by convolution through the feature concatenation fusion layer to obtain the fused feature map. The fused feature map is input into the prediction output module, and after processing by pooling layer, normalization layer and fully connected layer, the intramuscular fat content value is output.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the method for assessing intramuscular fat content in sheep based on ultrasound images, as described in any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the method for assessing intramuscular fat content in sheep based on ultrasound images, as described in any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the method for assessing intramuscular fat content in sheep based on ultrasound images, as described in any one of claims 1-7.