Beef cattle weight estimation model training method and beef cattle weight estimation method

By extracting morphological and texture features from images of beef cattle backs using a semantic decoupling model and updating parameters using total loss, the joint optimization of beef cattle weight and identification is achieved. This solves the problems of low efficiency and high error in existing technologies, improves the accuracy and robustness of beef cattle weight estimation, and supports large-scale automated monitoring.

CN121582702APending Publication Date: 2026-02-27BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511703263.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

In beef cattle livestock management, existing technologies suffer from low efficiency and high error rates in the process of predicting and identifying the weight of beef cattle, and cannot be effectively and automatically correlated. This results in insufficient real-time performance and automation of the system, making it difficult to meet the requirements of accuracy and comprehensiveness.

Method used

A semantic decoupling model is used to extract morphological and texture features from images of beef cattle backs. Through multi-scale semantic information extraction and dynamic aggregation, combined with identity recognition and weight estimation, the model parameters are updated using total loss to achieve joint optimization of weight estimation and identity recognition. Furthermore, through multi-image aggregation and identity consistency constraint mechanisms, the weight results are automatically matched with individual identities.

Benefits of technology

It improves the accuracy and robustness of beef cattle weight estimation, enhances the automatic correlation between identity data and weight data, supports parallel monitoring of multiple beef cattle and large-scale application scenarios, and reduces the consumption of computing resources and manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582702A_ABST
    Figure CN121582702A_ABST
Patent Text Reader

Abstract

The invention provides a beef cattle weight estimation model training method and a beef cattle weight estimation method, and the training method comprises the steps: carrying out the training step of at least one iteration round on a semantic decoupling model based on each group of training data, so as to enable the semantic decoupling model to converge or enable the number of iterations to reach a preset number threshold; wherein the training step comprises the steps of inputting a beef cattle back image into a semantic decoupling model corresponding to a current iteration round, so that the semantic decoupling model performs morphological feature recognition and textural feature recognition on a vector to output a weight estimation value and an identity embedding vector; determining the total loss of the current semantic decoupling model, and updating the model parameters to obtain the semantic decoupling model of the next iteration round; and outputting the converged semantic decoupling model as a beef cattle weight estimation model. According to the invention, error propagation can be reduced, joint optimization of weight estimation and identity recognition can be realized, robustness is improved, and the automatic association capability of the identity data and the weight data is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method for training a beef cattle weight estimation model and a method for estimating beef cattle weight. Background Technology

[0002] In precision beef cattle livestock management, continuously monitoring the individual weight gain trend of beef cattle is a key factor in assessing production efficiency and economic benefits. Weight gain rate combines breed genetic differences and management-induced feeding efficiency, providing guidance for precision feeding and management decisions. Accurate estimation of growth rate requires simultaneous identification and weight estimation; identification ensures consistency of identity across time, while weight estimation provides specific weight values. This combination is crucial for ensuring the continuity of long-term weight trends and data-driven assessments. With the transformation of livestock farming towards digitalization and precision, non-contact monitoring technologies have become a research hotspot. Dorsal view images of cattle are widely used for biometric identification and weight estimation because they stably present body shape and surface texture while minimizing the effects of occlusion and posture changes.

[0003] Currently, existing single-task methods either perform weight estimation alone (e.g., using networks like OSNet or ResNeXt for regression) or identity recognition alone (e.g., texture feature-based matching). However, given the precise and comprehensive requirements of beef cattle livestock management, it is necessary to obtain both the predicted weight and the identity of the cattle. The above two methods cannot meet this requirement, resulting in low efficiency and a high risk of error propagation in the process of simultaneously obtaining the predicted weight and identity of cattle. Existing non-contact image analysis-based beef cattle weight estimation and identity recognition technologies, while reducing human intervention to some extent, suffer from low efficiency, high error rates, poor automatic association capabilities, and poor robustness. Summary of the Invention

[0004] In view of this, embodiments of this application provide a method for training a beef cattle weight estimation model and a method for estimating beef cattle weight, in order to eliminate or improve one or more defects existing in the prior art.

[0005] One aspect of this application provides a method for training a beef cattle weight estimation model, which includes the following steps: The semantic decoupling model is trained for at least one iteration based on each set of training data, so that the semantic decoupling model converges or the number of iterations reaches a preset threshold. Each set of training data includes a cow back image, a cow weight label, and a cow identity label. The training steps include: inputting the cow back image into the semantic decoupling model corresponding to the current iteration, so that the semantic decoupling model performs multi-scale semantic information extraction and dynamic aggregation on the cow back image to obtain a first feature vector; and performing morphological feature recognition and texture feature recognition on the first feature vector to output a weight estimate obtained through morphological feature recognition and an identity embedding vector obtained through texture feature recognition; determining the total loss of the current semantic decoupling model based on the weight estimate, the identity embedding vector, the cow weight label, and the cow identity label; and updating the parameters of the semantic decoupling model based on the total loss to obtain the semantic decoupling model corresponding to the next iteration. The converged semantic decoupling model is used as the output of the beef cattle weight estimation model.

[0006] In some embodiments of this application, before the step of performing at least one iteration of training on the semantic decoupling model based on each set of training data, the method further includes: The pre-acquired raw images of the back of beef cattle are preprocessed to obtain the images of the back of beef cattle, and multiple sets of training data are constructed. The preprocessing includes spatial transformation processing and / or illumination enhancement processing.

[0007] In some embodiments of this application, the semantic decoupling model includes: a dynamic aggregation module, a morphological feature extraction module and a texture feature extraction module respectively connected to the dynamic aggregation module, a weight estimation head, and an identity recognition head; wherein, the morphological feature extraction module and the texture feature extraction module constitute the semantic decoupling branch in the semantic decoupling model; the weight estimation head is connected to the morphological feature extraction module, the identity recognition head is connected to the texture feature extraction module, and the weight estimation head and the identity recognition head constitute a dual-task output head; The dynamic aggregation module is used to dynamically aggregate each of the beef cattle back images in the training data to obtain the first feature vector. The morphological feature extraction module is used to perform morphological feature recognition on the first feature vector to output morphological feature data obtained by the morphological feature recognition. The texture feature extraction module is used to perform texture feature recognition on the first feature vector to output texture feature data obtained by the texture feature recognition; The weight estimation head is used to estimate the weight of the morphological feature data, and output the weight estimate obtained by the weight estimation. The identity recognition head is used to perform identity recognition on the texture feature data, so as to output the identity embedding vector obtained by the identity recognition.

[0008] In some embodiments of this application, the step of determining the total loss of the current semantic decoupling model based on the weight estimate, the identity embedding vector, the beef cattle weight tag, and the beef cattle identity tag, and updating the parameters of the semantic decoupling model based on the total loss to obtain the semantic decoupling model corresponding to the next iteration round, includes: The weight estimation loss is determined based on the estimated weight value and the beef cattle weight label; the identity loss and metric learning loss are calculated based on the identity embedding vector and the beef cattle identity label. The total loss of the current semantic decoupling model is determined based on the weight estimation loss, the identity loss, and the metric learning loss. Determine the gradient of the total loss with respect to each parameter in the semantic decoupling model; based on the gradient descent optimization algorithm, update the parameters of the semantic decoupling model using each gradient to obtain the semantic decoupling model corresponding to the next iteration round.

[0009] Another aspect of this application provides a method for estimating the weight of beef cattle, which includes the following steps: Obtain an image of the back of the target beef cattle; The back image of the target beef cattle is input into the beef cattle weight estimation model so that the beef cattle weight estimation model outputs the prediction result data corresponding to the target beef cattle. The prediction result data includes the weight estimate and the identity embedding vector. The beef cattle weight estimation model is pre-trained based on the aforementioned beef cattle weight estimation model training method.

[0010] In some embodiments of this application, if there are multiple back images of the target beef cattle, the prediction result data corresponding to each back image of the target beef cattle is obtained according to the beef cattle weight estimation model. Correspondingly, the method for estimating the weight of beef cattle also includes: Based on the identity embedding vectors, the back images of each of the target beef cattle are clustered to generate preliminary identity clusters; Weight filtering is performed on each of the preliminary identity clusters based on the corresponding weight estimates within each preliminary identity cluster to obtain the target weight estimate and the corresponding target identity label.

[0011] In some embodiments of this application, the beef cattle weight estimation method performs multi-image aggregation on the back images of each target beef cattle based on the KL divergence of the back images of each target beef cattle, so as to obtain the preliminary identity cluster, the target weight estimate and the corresponding target identity label; The KL divergence of the back image of the target beef cattle is calculated according to the following formula: KL divergence, or Kullback-Leibler divergence, measures the degree of difference between two probability distributions P and Q of the same random variable X. Let KL divergence be the back image of the target beef cattle. The semantic probability distribution of body weight. The semantic probability distribution for estimating the average weight of multiple images. The number of images corresponding to the target beef cattle identification tags. For the first i Probability distribution for weight estimation of images.

[0012] In some embodiments of this application, the step of clustering the back images of each of the target beef cattle based on each of the identity embedding vectors to generate preliminary identity clusters includes: Normalize each of the identity embedding vectors to obtain corresponding normalized identity embedding vectors, and calculate the similarity of each of the normalized identity embedding vectors. Determine whether the similarity corresponding to each of the normalized identity embedding vectors exceeds a preset similarity threshold. If the similarity corresponding to each of the normalized identity embedding vectors does not exceed the preset similarity threshold, then the normalized identity embedding vectors are retained, and each of the retained normalized identity embedding vectors constitutes the preliminary identity cluster.

[0013] In some embodiments of this application, the step of performing weight filtering on each preliminary identity cluster based on the corresponding weight estimates within each preliminary identity cluster to obtain a target weight estimate and a corresponding target identity label includes: Calculate the range data for each of the preliminary identity clusters, where the range data is the difference between the maximum and minimum values ​​among the weight estimates within each preliminary identity cluster; Determine whether the range data of each preliminary identity cluster exceeds a preset weight difference threshold. If the range data of the preliminary identity cluster does not exceed the preset weight difference threshold, then retain the preliminary identity cluster as each valid cluster and calculate the average value of each weight estimate corresponding to each valid cluster. Each of the aforementioned average values ​​is used as the target weight estimate, and each of the effective clusters corresponding to each of the aforementioned average values ​​is output as the target identity label.

[0014] In some embodiments of this application, the beef cattle weight estimation method is based on the WCIC algorithm to automatically obtain the target weight estimate and the corresponding target identity tag.

[0015] A third aspect of this application provides an electronic device, including a processor and a memory; the processor executes a running program stored in the memory to implement the beef cattle weight estimation model training method or the beef cattle weight estimation method.

[0016] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the described beef cattle weight estimation model training method or beef cattle weight estimation method.

[0017] The fifth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the beef cattle weight estimation model training method or the beef cattle weight estimation method.

[0018] The method for training a beef cattle weight estimation model disclosed in this application includes the following steps: training a semantic decoupling model for at least one iteration based on each set of training data, so that the semantic decoupling model converges or the number of iterations reaches a preset threshold; wherein each set of training data includes a beef cattle back image, a beef cattle weight label, and a beef cattle identity label; wherein the training step includes: inputting the beef cattle back image into the semantic decoupling model corresponding to the current iteration, so that the semantic decoupling model performs multi-scale semantic information extraction and dynamic aggregation on the beef cattle back image. A first feature vector is obtained, and the semantic decoupling model performs morphological feature recognition and texture feature recognition on the first feature vector to output a weight estimate obtained by the morphological feature recognition and an identity embedding vector obtained by the texture feature recognition. The total loss of the current semantic decoupling model is determined based on the weight estimate, the identity embedding vector, the beef cattle weight label, and the beef cattle identity label. The parameters of the semantic decoupling model are updated based on this total loss to obtain the semantic decoupling model corresponding to the next iteration. The converged semantic decoupling model is then output as the beef cattle weight estimation model. This application uses a semantic feature decoupling model to extract morphological and texture features from beef cattle back images, obtaining the identity embedding vector and weight estimate corresponding to the beef cattle back images. By calculating the total loss and updating the parameters of the semantic decoupling model to obtain a converged semantic decoupling model, it can reduce error propagation between identity recognition and weight estimation, achieve joint optimization of weight estimation and identity recognition, improve accuracy and robustness, and enhance the automatic association capability between identity data and weight data.

[0019] Additional advantages, objectives, and features of this application will be set forth in part in the description which follows, and will in part become apparent to those skilled in the art upon review of the following description, or may be learned by practice of the application. The objectives and other advantages of this application can be realized and obtained by means of the structures specifically pointed out in the specification and drawings.

[0020] Those skilled in the art will understand that the purposes and advantages that can be achieved with this application are not limited to those specifically described above, and that the above and other purposes that this application can achieve will be more clearly understood from the following detailed description. Attached Figure Description

[0021] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, do not constitute a limitation thereof. The components in the drawings are not drawn to scale but are merely for illustrating the principles of this application. For ease of illustration and description of certain parts of this application, corresponding portions in the drawings may be enlarged, i.e., may appear larger relative to other components in an exemplary device actually manufactured according to this application. In the drawings: Figure 1 This is a schematic diagram of the first process of a method for training a beef cattle weight estimation model according to an embodiment of this application.

[0022] Figure 2 This is a schematic diagram of a semantic decoupling model in one embodiment of this application.

[0023] Figure 3 This is a schematic diagram of the first step in the method for estimating the weight of beef cattle in one embodiment of this application.

[0024] Figure 4 This is a schematic diagram of the second process of the method for estimating the weight of beef cattle in one embodiment of this application.

[0025] Figure 5 This is a schematic diagram of the second process of the beef cattle weight estimation model training method in one embodiment of this application.

[0026] Figure 6 This is a schematic diagram of the third process of the beef cattle weight estimation model training method in one embodiment of this application.

[0027] Figure 7 This is a schematic diagram of the third process of the method for estimating the weight of beef cattle in one embodiment of this application. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and their descriptions are used to explain this application, but are not intended to limit it.

[0029] It should also be noted that, in order to avoid obscuring this application with unnecessary details, only the structures and / or processing steps closely related to the solution according to this application are shown in the accompanying drawings, while other details that are not closely related to this application are omitted.

[0030] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.

[0031] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.

[0032] In the following description, embodiments of the present application will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.

[0033] It should be noted that while existing livestock weight estimation and individual identification technologies based on non-contact image analysis can reduce manual intervention to some extent, they suffer from low efficiency, error propagation, lack of automatic correlation capabilities, and poor robustness. Existing weighing trough solutions require operation on a head-by-head basis. Although non-contact image methods avoid physical contact, weight estimation and individual identification are usually performed by two independent models, resulting in a complex process and high computational costs, which reduces the system's real-time performance and overall detection efficiency, making it unsuitable for continuous large-scale monitoring. When weight estimation and individual identification are performed separately, identification errors can be transmitted to weight records, leading to data matching chaos and affecting the continuity of historical data and the accuracy of individual growth curves. Existing non-contact weight estimation models cannot automatically bind weight results to individual identities, requiring manual verification and data entry, which reduces the level of automation and limits the system's deployment at the ranch level. Single-frame images are susceptible to effects such as pose, lighting, and occlusion; weight estimation is sensitive to image scale, and re-identification is sensitive to image rotation or flipping, resulting in large prediction variance and insufficient system stability and generalization ability. In other words, existing technologies mainly involve data collection from other perspectives, such as taking photos or estimating depth images from the side (or front, or back) of cattle. While this reduces human intervention to some extent, it also results in cattle only being able to pass through specific channels, with estimation performed one by one, leading to low efficiency and essentially still requiring human intervention. In summary, existing technologies struggle to achieve an effective balance between accuracy, efficiency, and automation, limiting the widespread application of long-term continuous monitoring in smart ranches. This application innovatively proposes a method for training a beef cattle weight estimation model and a method for estimating beef cattle weight, achieving efficient, stable, and scalable intelligent monitoring without the need for weighing troughs or manual labeling. The inventors of this application first conceived of using a semantic decoupling model to extract individual identification and weight estimation features from images of beef cattle backs, reducing error propagation between the two tasks and achieving joint optimization of weight estimation and re-identification. Then, a multi-image aggregation and identity consistency constraint mechanism is employed to fuse feature information of the same target under different postures, reducing the uncertainty of single-frame prediction and improving the model's adaptability to changes in posture and lighting, thereby enhancing the accuracy and robustness of the beef cattle weight estimation method. Through a dual-task inference framework and clustering association mechanism, the matching of weight results with individual identities is automatically completed, supporting parallel monitoring of multiple beef cattle and large-scale application scenarios, achieving automatic association between identity and weight data. Compared to traditional independent models, the beef cattle weight estimation model proposed in this application can output identity and weight information in a single inference, reducing computational resource consumption and manual post-processing, thus reducing the burden of manual computation.

[0034] The following examples will provide a detailed description.

[0035] This application provides a method for training a beef cattle weight estimation model. See also... Figure 1The training method for this beef cattle weight estimation model includes the following steps: Step 100: Based on each set of training data, perform at least one iteration training step on the semantic decoupling model to ensure that the semantic decoupling model converges or the number of iterations reaches a preset threshold. Each set of training data includes a cow back image, a cow weight label, and a cow identity label. The training step includes: inputting the cow back image into the semantic decoupling model corresponding to the current iteration, so that the semantic decoupling model performs multi-scale semantic information extraction and dynamic aggregation on the cow back image to obtain a first feature vector; and performing morphological feature recognition and texture feature recognition on the first feature vector to output a weight estimate obtained through morphological feature recognition and an identity embedding vector obtained through texture feature recognition; determining the total loss of the current semantic decoupling model based on the weight estimate, the identity embedding vector, the cow weight label, and the cow identity label; and updating the parameters of the semantic decoupling model based on the total loss to obtain the semantic decoupling model corresponding to the next iteration. In step 100, the first feature vector can be a biological representation vector, which is essentially a high-dimensional vector; the morphological feature recognition refers to recognizing body shape features related to the body shape of beef cattle, which can be the outline shape, area size, and undulations of the beef cattle's back; the texture feature recognition refers to recognizing surface features related to the identity of beef cattle, which can be unique identifiers such as the color of the beef cattle's coat, spots, and patterns.

[0036] It is understood that the single iteration training process in step 100 is applicable to one or more beef cattle back images. For example, in a single iteration training process, 10,000 beef cattle back images can be input into the semantic decoupling model so that the semantic decoupling model can sequentially perform prediction processing on the 10,000 beef cattle back images respectively, and update the parameters of the semantic decoupling model according to the final total loss to obtain the semantic decoupling model corresponding to the next iteration round.

[0037] Step 200: Output the converged semantic decoupling model as a beef cattle weight estimation model.

[0038] In summary, the beef cattle weight estimation model training method provided in this application extracts morphological and texture features from the beef cattle back image through a semantic feature decoupling model, obtains the identity embedding vector and weight estimate corresponding to the beef cattle back image, and updates the parameters of the semantic decoupling model by calculating the total loss to obtain a converged semantic decoupling model. This can reduce the error propagation between identity recognition and weight estimation, achieve joint optimization of weight estimation and identity recognition, improve the accuracy and robustness of weight estimation, and enhance the automatic association capability between identity data and weight data.

[0039] To further improve the accuracy and robustness of weight estimation, this application provides a method for training a beef cattle weight estimation model. Before the step of performing at least one iteration of training on the semantic decoupling model based on each set of training data, the method further includes: Step 010: Preprocess the pre-acquired raw beef cattle back images to obtain the beef cattle back images, and construct multiple sets of training data. The preprocessing includes spatial transformation processing and / or illumination enhancement processing.

[0040] Specifically, the spatial transformation processing includes edge cropping and padding, resolution normalization, and transformation sensitivity processing. Edge cropping and padding addresses the black border issue introduced by camera viewpoint alignment by cropping image edge areas and filling them with black pixels, maintaining the original canvas size and reducing inconsistencies across cameras. Resolution normalization scales the image to 128×300 resolution, conforming to the statistical aspect ratio of the cow's back view, guiding the beef cattle weight estimation model to focus on the central semantic region. Transform sensitivity processing addresses the sensitivity of identity recognition to image flipping (due to texture feature position dependence) and weight estimation to scaling (due to morphological feature proportion dependence). Preprocessing avoids flipping, focusing primarily on scaling to ensure compatibility between weight estimation and identity recognition. The illumination enhancement processing includes color perturbation and noise simulation. Color perturbation applies random brightness, contrast, saturation, and hue adjustments to simulate different lighting conditions. Noise simulation includes Gaussian blur, grayscale conversion, and exposure reversal to improve the adaptability of the beef cattle weight estimation model in real farm environments. These preprocessing steps reduce overfitting through data augmentation, allowing the beef cattle weight estimation model to focus more on the extraction of morphological and texture features.

[0041] To further improve the accuracy and robustness of weight estimation, this application provides a method for training a beef cattle weight estimation model. (See attached document.) Figure 2The semantic decoupling model includes: a dynamic aggregation module 1, a morphological feature extraction module 21 and a texture feature extraction module 22 respectively connected to the dynamic aggregation module 1, a weight estimation head 031, and an identity recognition head 032; wherein, the morphological feature extraction module 21 and the texture feature extraction module 22 constitute the semantic decoupling branch 2 in the semantic decoupling model; the weight estimation head 031 is connected to the morphological feature extraction module 21, the identity recognition head 032 is connected to the texture feature extraction module 22, and the weight estimation head 031 and the identity recognition head 032 constitute a dual-task output head 3; The dynamic aggregation module 1 is used to dynamically aggregate each of the beef cattle back images in the training data to obtain the first feature vector. The morphological feature extraction module 21 is used to perform morphological feature recognition on the first feature vector to output morphological feature data obtained by the morphological feature recognition. The texture feature extraction module 22 is used to perform texture feature recognition on the first feature vector to output texture feature data obtained by the texture feature recognition; The weight estimation head 031 is used to estimate the weight of the morphological feature data, and output the weight estimate obtained by the weight estimation. The identity recognition head 032 is used to perform identity recognition on the texture feature data, so as to output the identity embedding vector obtained by the identity recognition.

[0042] In one or more embodiments of this application, the semantic decoupling model can be an improved OSNet (Omni-Scale Network) backbone network, which consists of the dynamic aggregation module 1, the semantic decoupling branch 2, and the dual-task output head 3. The dynamic aggregation module 1 consists of three cascaded OSBlock (Omni-Scale) branches. The OSBlock submodules (first OSBlock submodule, second OSBlock submodule, and third OSBlock submodule) are used to extract multi-scale features from the back image of the beef cattle to obtain multiple second feature vectors corresponding to the back image of the beef cattle. The third OSBlock submodule is used to dynamically aggregate the multiple second feature vectors corresponding to the back image of the beef cattle to output the first feature vector corresponding to the back image of the beef cattle obtained by dynamic aggregation. The second feature vector can be a multi-scale feature extraction vector. The semantic decoupling branch 2 is composed of a fourth OSBlock submodule connected to the third OSBlock submodule. An explicit decoupling layer is introduced into the semantic decoupling branch 2 to separate the semantic decoupling branch 2 into a morphological feature extraction module 21 and a texture feature extraction module 22. The morphological feature extraction module 21 focuses on the structural features of the cow's back, such as its contour and area, to output corresponding morphological feature data. The texture feature extraction module 22 extracts identification markers such as coat color and patterns from the cow's back to output corresponding texture feature data. The morphological feature data can serve as a reference for the weight estimation task, and the texture feature data can serve as a reference for the identity re-identification task. The weight estimation head 031 is connected to the output of the morphological feature extraction module 21 and consists of a global average pooling layer and a regression layer (such as a fully connected layer). It performs dimensionality reduction (such as global average pooling) and regression on the morphological feature data to output a scalar value, i.e., a weight estimate, in kilograms. The identity recognition head 032 is connected to the output of the texture feature extraction module 22 and consists of a global average pooling layer and a fully connected layer, outputting a high-dimensional identity embedding vector (e.g., 512-dimensional). This vector ensures that the embeddings of different back images of the same cow are close in the feature space, while the embeddings of different back images of different cows are far apart in the feature space.

[0043] To reduce error propagation between identity recognition and weight estimation, this application provides a method for training a beef cattle weight estimation model. The method involves determining the total loss of the current semantic decoupling model based on the estimated weight, the identity embedding vector, the beef cattle weight label, and the beef cattle identity label, and updating the parameters of the semantic decoupling model based on this total loss to obtain the semantic decoupling model for the next iteration. The method includes: The weight estimation loss is determined based on the estimated weight value and the beef cattle weight label; the identity loss and metric learning loss are calculated based on the identity embedding vector and the beef cattle identity label. The total loss of the current semantic decoupling model is determined based on the weight estimation loss, the identity loss, and the metric learning loss. Determine the gradient of the total loss with respect to each parameter in the semantic decoupling model; based on the gradient descent optimization algorithm, update the parameters of the semantic decoupling model using each gradient to obtain the semantic decoupling model corresponding to the next iteration round.

[0044] In one or more embodiments of this application, the total loss is a weighted sum of multiple sub-losses, which can be calculated according to the following formula: Where L_total is the total loss, L_id is the identity loss, λ1 is the weighting coefficient of the identity loss, λ2 is the weighting coefficient of the metric learning loss, L_tri is the metric learning loss, λ3 is the weighting coefficient of the weight estimation loss, and L_weight is the weight estimation loss. The identity loss can be calculated using cross-entropy loss to supervise the network in correctly classifying the identity ID of the image. The metric learning loss can be calculated using triplet loss to ensure that the image embedding of the same identity is much smaller than the image embedding of different identities, thereby enhancing the discriminative power of the embedding space. The weight estimation loss can be calculated using mean squared error loss (MSE Loss) to minimize the squared difference between the weight estimate and the true value. The weighting coefficients λ1, λ2, and λ3 are used to balance the importance of different tasks.

[0045] Understandably, after calculating the total loss, the gradient of the total loss with respect to each parameter in the semantic decoupling model is calculated using the backpropagation algorithm; the weight parameters in the semantic decoupling model are updated using a gradient descent optimization algorithm (such as Adam or SGD) to obtain the semantic decoupling model corresponding to the next iteration round; the above steps are executed iteratively until the semantic decoupling model converges on the validation set.

[0046] This application also provides a method for estimating the weight of beef cattle. See [link to relevant documentation]. Figure 3 The method for estimating the weight of beef cattle includes the following steps: Step 10: Obtain an image of the back of the target beef cattle; Step 20: Input the back image of the target beef cattle into the beef cattle weight estimation model so that the beef cattle weight estimation model outputs the prediction result data corresponding to the target beef cattle. The prediction result data includes the weight estimate and the identity embedding vector. The beef cattle weight estimation model is pre-trained based on the aforementioned beef cattle weight estimation model training method.

[0047] In one or more embodiments of this application, a back image of a target beef cattle is input into a beef cattle weight estimation model so that the beef cattle weight estimation model outputs a weight estimate and an identity embedding vector corresponding to the target beef cattle. At this time, the weight estimate and the identity embedding vector are the target weight estimate and the corresponding target identity label.

[0048] To further optimize weight estimation and identity recognition, improve accuracy and robustness, and enhance the automatic association between identity and weight data, this application provides a method for estimating the weight of beef cattle. (See also...) Figure 4 If there are multiple back images of the target beef cattle, the prediction result data corresponding to each back image of the target beef cattle will be obtained according to the beef cattle weight estimation model. Correspondingly, the method for estimating the weight of beef cattle also includes: Step 30: Perform identity clustering on the back images of each of the target beef cattle based on each of the identity embedding vectors to generate preliminary identity clusters; Step 40: Perform weight filtering on each of the preliminary identity clusters based on the corresponding weight estimates within each preliminary identity cluster to obtain the target weight estimate and the corresponding target identity label.

[0049] To further optimize weight estimation and identity recognition, improve accuracy and robustness, and enhance the automatic association between identity data and weight data, this application provides a method for estimating the weight of beef cattle. The method is based on the KL divergence of the back images of each target beef cattle, and performs multi-image aggregation on the back images of each target beef cattle to obtain the preliminary identity cluster, the target weight estimate, and the corresponding target identity label. The KL divergence of the back image of the target beef cattle is calculated according to the following formula: in, Let KL divergence be the back image of the target beef cattle. The semantic probability distribution of body weight. The semantic probability distribution for estimating the average weight of multiple images. The number of images corresponding to the target beef cattle identification tags. For the first i Probability distribution for weight estimation of images.

[0050] In one or more embodiments of this application, the above formula can theoretically guarantee the deterministic gains of multi-image aggregation. However, when the cattle's posture changes, there is occlusion, or the lighting conditions are poor, single-image prediction will produce a large variance. By aggregating multiple images of the same cattle, the cattle weight estimation model can effectively average out these random noises, making the prediction more stable.

[0051] To further optimize weight estimation and identity recognition, improve accuracy and robustness, and enhance the automatic association between identity data and weight data, this application provides a method for estimating the weight of beef cattle, wherein step 30 includes: Step 31: Normalize each of the identity embedding vectors to obtain the corresponding normalized identity embedding vectors, and calculate the similarity of each of the normalized identity embedding vectors; Step 32: Determine whether the similarity of each of the normalized identity embedding vectors exceeds a preset similarity threshold. If the similarity of each of the normalized identity embedding vectors does not exceed the preset similarity threshold, then the normalized identity embedding vectors are retained, and each of the retained normalized identity embedding vectors constitutes the preliminary identity cluster.

[0052] In one or more embodiments of this application, the preset similarity threshold can be set to any value between 0.1 and 0.2.

[0053] To further optimize weight estimation and identity recognition, improve accuracy and robustness, and enhance the automatic association between identity data and weight data, this application provides a method for estimating the weight of beef cattle, wherein step 40 includes: Step 41: Calculate the range data for each of the preliminary identity clusters, where the range data is the difference between the maximum and minimum values ​​among the weight estimates within each preliminary identity cluster; Step 42: Determine whether the range data of each preliminary identity cluster exceeds a preset weight difference threshold. If the range data of the preliminary identity cluster does not exceed the preset weight difference threshold, then retain the preliminary identity cluster as each valid cluster and calculate the average value of each weight estimate corresponding to each valid cluster. In step 42, the preset weight difference threshold can be 15 kg.

[0054] Step 43: Use each of the above average values ​​as the target weight estimate, and output each of the above average values ​​and the above effective clusters as the target identity labels.

[0055] In one or more embodiments of this application, the mean and standard deviation of the weight estimates within each preliminary identity cluster can be calculated; it can be determined whether the standard deviation of each preliminary identity cluster exceeds a preset standard deviation threshold. If the standard deviation of the preliminary identity cluster does not exceed the preset standard deviation threshold, the preliminary identity cluster is retained as a valid cluster, and the preliminary identity clusters with standard deviations exceeding the preset weight difference threshold are filtered as abnormal clusters; the average value of each weight estimate corresponding to each valid cluster is used as the target weight estimate, and each valid cluster corresponding to each average value is output as the target identity label.

[0056] To further achieve joint optimization of weight estimation and identity recognition, improve accuracy and robustness, and enhance the automatic association capability between identity data and weight data, this application provides a method for estimating the weight of beef cattle. The method is based on the Weight-Constrained Identity Clustering (WCIC) algorithm to automatically obtain the target weight estimate and the corresponding target identity tag.

[0057] In one or more embodiments of this application, the WCIC algorithm automatically completes the following steps in the beef cattle weight estimation process through two-stage clustering (steps 30 and 40): (1) performing preliminary identity clustering based on the cosine similarity of identity embedding vectors; (2) filtering out abnormal clusters using the consistency of weight estimates as a constraint; and (3) calculating the target weight estimate within the valid clusters. This process completely avoids human intervention, enabling fully automated monitoring in large-scale farm environments.

[0058] In a specific embodiment of the beef cattle weight estimation model training method and the beef cattle weight estimation method, see [link to relevant documentation]. Figure 5 , Figure 6 and Figure 7 This includes the training phase (training of the beef cattle weight estimation model) and the inference scheme (beef cattle weight estimation). The training phase aims to jointly optimize network parameters through multi-task learning, enabling the model to output identity embeddings and weight estimates. The process includes data preprocessing, network forward propagation, and loss backpropagation. System components: Input module: Collects images of the cow's back and its actual weight data; The preprocessing module aims to enhance the robustness of images to spatial and lighting variations, ensuring that the model focuses on task-related semantics. Preprocessing includes spatial transformation and illumination enhancement. Spatial transformation includes edge cropping and padding, resolution normalization, and transformation sensitivity processing. Edge cropping and padding addresses the black border issue introduced by camera viewpoint alignment by cropping image edge areas and padding with black pixels, maintaining the original canvas size and reducing inconsistencies across cameras. Resolution normalization scales the image to 128×300 resolution, conforming to the statistical aspect ratio of the cow's back view, guiding the model to focus on the central semantic region. Transform sensitivity processing re-identifies that the task is sensitive to image flipping (due to texture feature position dependence), while weight estimation is sensitive to scaling (due to morphological feature proportion dependence). Spatial transformation avoids flipping, focusing primarily on scaling to ensure task compatibility. Illumination enhancement includes color perturbation and noise simulation. Color perturbation applies random brightness, contrast, saturation, and hue adjustments to simulate different lighting conditions. Noise simulation includes Gaussian blur, grayscale conversion, and exposure reversal to improve the model's adaptability to real farm environments. These preprocessing steps reduce overfitting through data augmentation, allowing the beef cattle weight estimation model to focus more on morphological and texture semantic extraction.

[0059] The improved OSNet (Omni-Scale Network) backbone supports full-scale feature learning and can capture fine-grained texture and large-scale morphological features. It includes the backbone network, semantic decoupling branches, and task-specific output heads. The backbone network comprises the OSBlock module, the semantic decoupling branch, and dual-task output heads. The OSBlock module retains the original OSNet's Omni-Scale Block and achieves multi-scale perception through a dynamic feature aggregation mechanism, effectively fusing semantic information at different scales. The semantic decoupling branch introduces an explicit decoupling layer in Step 4, separating features into morphological and texture branches. The morphological branch focuses on structural features such as contours and area, while the texture branch extracts identity markers such as fur color and patterns. The dual-task output heads include a re-identification head and a weight estimation head. The re-identification head outputs a 256-dimensional identity embedding from texture features via a fully connected layer, using cosine distance to calculate similarity. The weight estimation head outputs weight values ​​(in kg) from morphological features via dimensionality reduction (e.g., global average pooling) and a regression layer (linear layer). Compared to the original OSNet backbone network, the improved OSNet backbone network of this application is shown in Table 1: Table 1 Correspondingly, the training process is as follows: Data loading: The input consists of a batch of images and their corresponding labels, including identity IDs (for re-identification) and true weight values ​​(for regression). Forward propagation: The image is input into a shared convolutional neural network (such as ResNet or HRNet) to extract a common high-level feature map; the semantic decoupling branch feeds the common high-level feature map into two decoupling branches; the texture semantic branch focuses on extracting surface features related to individual identity, such as coat color, spots, patterns, and other unique identifiers; the morphological semantic branch focuses on extracting features related to body shape, such as the contour shape, area, and undulations of the back; the re-identification head connects to the end of the texture semantic branch, usually consisting of a global average pooling layer and a fully connected layer, outputting a high-dimensional identity embedding vector (e.g., 512-dimensional), which should make the embeddings of beef cattle images with the same identity close in the feature space, and far apart for different identities; the weight estimation head connects to the end of the morphological semantic branch, usually consisting of a global average pooling layer and a regression layer (such as a fully connected layer), outputting a scalar value, i.e., the estimated weight (unit: kilograms).

[0060] Loss Calculation: The total loss function is a weighted sum of multiple sub-losses, expressed by the following formula: Identity loss (L_id) typically uses cross-entropy loss to supervise the network in correctly classifying the identity ID of an image; metric learning loss (L_tri) typically uses triplet loss to force the image embeddings of the same identity to be much smaller than those of different identities, thereby enhancing the discriminative power of the embedding space; weight estimation loss (L_weight) uses mean squared error loss (MSE Loss) to minimize the squared difference between the weight estimate and the true value; weighting coefficients λ1, λ2, and λ3 are used to balance the importance of different tasks; Backpropagation and optimization: After calculating the total loss, the gradient of the loss function with respect to each parameter of the network is calculated using the backpropagation algorithm; all weight parameters of the network are updated using gradient descent optimization algorithms (such as Adam, SGD); the above steps are iteratively executed until the model converges on the validation set.

[0061] During the training phase, semantic decoupling and joint loss are used to enable the network to learn task-specific and complementary feature representations.

[0062] The inference scheme, based on a pre-trained model, performs identity clustering and weight estimation on newly added images, filtering outliers through two-stage clustering (WCIC). The inference scheme process can be divided into identity clustering and weight-constrained filtering.

[0063] The system workflow of the inference scheme includes: inputting one or more images of cow backs (without real labels); using a trained network, generating identity embeddings and weight estimates for each image; calculating the cosine distance of all image embeddings and clustering image groups of the same identity based on a threshold; within each identity cluster, performing secondary clustering (such as K-means) on the weight predictions to remove outlier clusters with excessive variance; the average weight prediction within the effective clusters is used as the final weight, and the identity is identified by the cluster label.

[0064] The reasoning process specifically includes: Traverse each image in image set I i ; Image i The input is a pre-trained model M, which is typically a convolutional neural network (CNN) with an output layer designed as a dual-task head, where one head outputs an identity embedding vector. fi (Used to represent identity, typically a high-dimensional vector, such as 512-dimensional), another head outputs a weight estimate. (Scalar, unit can be kilogram); The model inference formula is expressed as: for each i ∈I, calculate: in, fi ∈R d ( d (for the embedded dimension) ∈R; The specific architecture of model M is not specified in the algorithm, but it is assumed to have been optimized through training (e.g., using triplet loss for identity embedding and mean squared error loss for weight estimation).

[0065] Calculate all identity embeddings ei The similarity matrix is ​​used to generate preliminary identity clusters using clustering algorithms (such as DBSCAN).

[0066] Collect the identity embedding vectors of all images { fi}; for each embedding vector fi Perform L2 normalization to make its norm 1. in, It is the Euclidean norm. For identity embedding vectors, For the normalized identity embedding vector, after normalization, all satisfy Similarity calculations (such as cosine similarity) can be simplified to a dot product. Calculating the k-distance graph: For each embedding vector, calculate its distance to its k-th nearest neighbor, then plot the sorted distance curves, selecting the inflection point of the curve as... .make d k(i) express The Euclidean distance from the core point to its k-th nearest neighbor (k is usually set to minPts-1) (minPts is the minimum number of neighbors required for the core point). For all images of the backs of beef cattle... i ,collect d k(i) After sorting, find the inflection point (e.g., through gradient change detection). DBSCAN is based on density clustering, and its parameters include... (Neighborhood radius) and minPts (minimum number of neighbors required for the core point). minPts is usually preset; for each point... Calculate its The number of points in the neighborhood. If the number is greater than or equal to minPts, it is marked as a core point; clusters are formed by connecting core points, and noise points do not belong to any cluster; Euclidean distance is used for distances between two points. fp , fq The distance between them is Output clustering map C That is, each image is assigned a cluster label (noise points are labeled -1); Large clusters are segmented: "Large clusters" are defined as those with a sample size exceeding a preset threshold. N Clusters of max (e.g.) N max=50, N (max is an adjustable parameter); for each cluster c If its size | c |> N If the maximum value is reached, then the weight estimate of all images within that cluster is obtained by applying the K-Means clustering algorithm. | i ∈ c K-Means divides the clusters into K Subclusters ( K It is usually set to 2, or dynamically adjusted according to the size, such as... K-Means steps include: randomly selecting K Each point is used as the initial center based on its weight value; each point is assigned to the nearest center (based on absolute difference). ); recalculate the mean centered at the current assignment point; iterate until convergence; After segmentation, update the clustering mapping. C Replace the original cluster with K Subclusters; Traversing clustering maps C Each cluster in c ; Calculate the estimated weight values ​​for all values ​​within this cluster { | i ∈ cThe range of the maximum and minimum values; if the range exceeds the threshold. T If the weight range (15 kg in the algorithm) is considered within a certain range, the cluster is discarded (considered invalid); otherwise, the arithmetic mean of the weight estimates within the cluster is calculated as the final weight estimate for that cluster. The range is calculated as follows: in, The maximum value of the estimated weight. The maximum value of the estimated weight; if Range( c If the value is greater than 15, then exclude the cluster. c Otherwise, calculate the mean, which is obtained using the following formula: Standard deviation constraints (such as standard deviation > 5 kg) can also be used, but the algorithm is based on the range; The average of the predicted weights within each cluster is used to obtain the final weight; identity is represented by the cluster center; the corrected clustering map is returned. C (Weight constraints have been applied and partitioned), where each valid cluster represents an identity; and return the set of weight estimates for each valid cluster { }

[0067] This application also provides an electronic device, which can be a server or an edge server. The electronic device may include a processor, a memory, a receiver, and a transmitter. The processor is used to execute the steps of the beef cattle weight estimation model training method or beef cattle weight estimation method mentioned in the above embodiments.

[0068] The processor can be a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.

[0069] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the beef cattle weight estimation model training method or the program instructions / modules corresponding to the beef cattle weight estimation method in the embodiments of this application. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory, thereby implementing the beef cattle weight estimation model training method or the beef cattle weight estimation method in the above method embodiments.

[0070] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0071] The one or more modules are stored in the memory, and when executed by the processor, they execute the beef cattle weight estimation model training method or the beef cattle weight estimation method in the embodiment.

[0072] In some embodiments of this application, the user equipment may include a processor, a memory, and a transceiver unit. The transceiver unit may include a receiver and a transmitter. The processor, memory, receiver, and transmitter may be connected via a bus system. The memory is used to store computer instructions, and the processor is used to execute the computer instructions stored in the memory to control the transceiver unit to send and receive signals.

[0073] As one implementation method, the functions of the receiver and transmitter in this application can be implemented by transceiver circuits or dedicated transceiver chips, and the processor can be implemented by dedicated processing chips, processing circuits or general-purpose chips.

[0074] As another implementation approach, the server provided in this application embodiment can be implemented using a general-purpose computer. That is, the program code implementing the processor, receiver, and transmitter functions is stored in memory, and the general-purpose processor implements the processor, receiver, and transmitter functions by executing the code in memory.

[0075] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the aforementioned beef cattle weight estimation model training method or beef cattle weight estimation method. The computer-readable storage medium can be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.

[0076] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the aforementioned beef cattle weight estimation model training method or beef cattle weight estimation method.

[0077] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. The programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave.

[0078] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0079] In this application, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.

[0080] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to the embodiments of this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for training a beef cattle weight estimation model, characterized in that, The training method includes: The semantic decoupling model is trained for at least one iteration based on each set of training data, so that the semantic decoupling model converges or the number of iterations reaches a preset threshold. Each set of training data includes a cow back image, a cow weight label, and a cow identity label. The training steps include: inputting the cow back image into the semantic decoupling model corresponding to the current iteration, so that the semantic decoupling model performs multi-scale semantic information extraction and dynamic aggregation on the cow back image to obtain a first feature vector; and performing morphological feature recognition and texture feature recognition on the first feature vector to output a weight estimate obtained through morphological feature recognition and an identity embedding vector obtained through texture feature recognition; determining the total loss of the current semantic decoupling model based on the weight estimate, the identity embedding vector, the cow weight label, and the cow identity label; and updating the parameters of the semantic decoupling model based on the total loss to obtain the semantic decoupling model corresponding to the next iteration. The converged semantic decoupling model is used as the output of the beef cattle weight estimation model.

2. The training method according to claim 1, characterized in that, Before the step of performing at least one iteration of training on the semantic decoupling model based on each set of training data, the method further includes: The pre-acquired raw images of the back of beef cattle are preprocessed to obtain the images of the back of beef cattle, and multiple sets of training data are constructed. The preprocessing includes spatial transformation processing and / or illumination enhancement processing.

3. The training method according to claim 1, characterized in that, The semantic decoupling model includes: a dynamic aggregation module, a morphological feature extraction module and a texture feature extraction module respectively connected to the dynamic aggregation module, a weight estimation head, and an identity recognition head; wherein, the morphological feature extraction module and the texture feature extraction module constitute the semantic decoupling branch in the semantic decoupling model; the weight estimation head is connected to the morphological feature extraction module, the identity recognition head is connected to the texture feature extraction module, and the weight estimation head and the identity recognition head constitute a dual-task output head; The dynamic aggregation module is used to dynamically aggregate each of the beef cattle back images in the training data to obtain the first feature vector. The morphological feature extraction module is used to perform morphological feature recognition on the first feature vector to output morphological feature data obtained by the morphological feature recognition. The texture feature extraction module is used to perform texture feature recognition on the first feature vector to output texture feature data obtained by the texture feature recognition; The weight estimation head is used to estimate the weight of the morphological feature data, and output the weight estimate obtained by the weight estimation. The identity recognition head is used to perform identity recognition on the texture feature data, so as to output the identity embedding vector obtained by the identity recognition.

4. The training method according to claim 1, characterized in that, The step of determining the total loss of the current semantic decoupling model based on the estimated weight, the identity embedding vector, the beef cattle weight label, and the beef cattle identity label, and updating the parameters of the semantic decoupling model based on the total loss to obtain the semantic decoupling model corresponding to the next iteration round, includes: The weight estimation loss is determined based on the estimated weight value and the beef cattle weight label; the identity loss and metric learning loss are calculated based on the identity embedding vector and the beef cattle identity label. The total loss of the current semantic decoupling model is determined based on the weight estimation loss, the identity loss, and the metric learning loss. Determine the gradient of the total loss with respect to each parameter in the semantic decoupling model; based on the gradient descent optimization algorithm, update the parameters of the semantic decoupling model using each gradient to obtain the semantic decoupling model corresponding to the next iteration round.

5. A method for estimating the weight of beef cattle, characterized in that, The method for estimating the weight of beef cattle includes: Obtain an image of the back of the target beef cattle; The back image of the target beef cattle is input into the beef cattle weight estimation model so that the beef cattle weight estimation model outputs the prediction result data corresponding to the target beef cattle. The prediction result data includes weight estimation value and identity embedding vector. The beef cattle weight estimation model is pre-trained based on the beef cattle weight estimation model training method as described in any one of claims 1 to 4.

6. The method for estimating the weight of beef cattle according to claim 5, characterized in that, If there are multiple back images of the target beef cattle, the prediction result data corresponding to each back image of the target beef cattle will be obtained according to the beef cattle weight estimation model. Correspondingly, the method for estimating the weight of beef cattle also includes: Based on the identity embedding vectors, the back images of each of the target beef cattle are clustered to generate preliminary identity clusters; Weight filtering is performed on each of the preliminary identity clusters based on the corresponding weight estimates within each preliminary identity cluster to obtain the target weight estimate and the corresponding target identity label.

7. The method for estimating the weight of beef cattle according to claim 6, characterized in that, The beef cattle weight estimation method is based on the KL divergence of the back images of each target beef cattle, and performs multi-image aggregation on the back images of each target beef cattle to obtain the preliminary identity cluster, the target weight estimate and the corresponding target identity label; The KL divergence of the back image of the target beef cattle is calculated according to the following formula: in, Let KL divergence be the back image of the target beef cattle. The semantic probability distribution of body weight. The semantic probability distribution for estimating the average weight of multiple images. The number of images corresponding to the target beef cattle identification tags. For the first i Probability distribution for weight estimation of images.

8. The method for estimating the weight of beef cattle according to claim 7, characterized in that, The step of clustering the back images of each target beef cattle based on each of the identity embedding vectors to generate preliminary identity clusters includes: Normalize each of the identity embedding vectors to obtain corresponding normalized identity embedding vectors, and calculate the similarity of each of the normalized identity embedding vectors. Determine whether the similarity corresponding to each of the normalized identity embedding vectors exceeds a preset similarity threshold. If the similarity corresponding to each of the normalized identity embedding vectors does not exceed the preset similarity threshold, then the normalized identity embedding vectors are retained, and each of the retained normalized identity embedding vectors constitutes the preliminary identity cluster.

9. The method for estimating the weight of beef cattle according to claim 7, characterized in that, The step of performing weight filtering on each of the preliminary identity clusters based on the corresponding weight estimates within each preliminary identity cluster to obtain the target weight estimate and the corresponding target identity label includes: Calculate the range data for each of the preliminary identity clusters, where the range data is the difference between the maximum and minimum values ​​among the weight estimates within each preliminary identity cluster; Determine whether the range data of each preliminary identity cluster exceeds a preset weight difference threshold. If the range data of the preliminary identity cluster does not exceed the preset weight difference threshold, then retain the preliminary identity cluster as each valid cluster and calculate the average value of each weight estimate corresponding to each valid cluster. Each of the aforementioned average values ​​is used as the target weight estimate, and each of the effective clusters corresponding to each of the aforementioned average values ​​is output as the target identity label.

10. The method for estimating the weight of beef cattle according to claim 9, characterized in that, The method for estimating the weight of beef cattle is based on the WCIC algorithm to automatically obtain the estimated weight of the target and the corresponding target identity tag.