Method, device and electronic device for predicting the weight of poultry breast muscle
By combining image augmentation networks, segmentation networks, and machine learning models, the efficiency and accuracy issues of poultry breast muscle weight measurement were solved, enabling rapid and automated prediction of live poultry breast muscle weight.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA AGRI UNIV
- Filing Date
- 2026-01-09
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies for measuring the weight of poultry pectoral muscles suffer from low efficiency, inability to achieve live measurement and automated batch measurement, and other problems. Traditional methods such as direct weighing are cumbersome and time-consuming, body size measurement has low accuracy, and ultrasonic measurement is greatly affected by external factors.
An image enhancement network is used to enhance digital X-ray images, and an image segmentation network is used to segment the pectoral muscle region. Geometric features are extracted and input into a machine learning model for prediction, enabling rapid and automated prediction of poultry pectoral muscle weight.
It enables rapid and automated prediction of the breast muscle weight of live poultry, reduces interference from external factors, and improves the accuracy and efficiency of measurement. It is applicable to poultry of different individuals and breeds.
Smart Images

Figure CN122173789A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of biological breeding and artificial intelligence technology, and in particular to a method, device and electronic device for predicting the weight of poultry pectoral muscles. Background Technology
[0002] In poultry breeding and quality control, the weight of poultry breast muscles is a key performance indicator. Currently, obtaining the weight of poultry breast muscles mainly relies on direct weighing, body size measurement estimation, and ultrasound measurement. Direct weighing involves directly weighing the breast muscles using a balance or electronic scale after slaughter and processing. While intuitive, this method is destructive, cannot continuously monitor live animals, and is cumbersome, time-consuming, and inefficient, making it difficult to apply to large-scale, live animal growth monitoring and breeding selection. Body size measurement estimation involves measuring body length, chest circumference, chest width, and chest angle, and using a regression equation to estimate breast muscle weight. While this method allows for live measurement, its accuracy is low and it is easily affected by individual differences, breed differences, and feeding environment, resulting in poor model universality. Ultrasound measurement utilizes the propagation characteristics of ultrasound waves in muscle tissue to measure parameters such as breast muscle thickness, thereby estimating weight. However, ultrasound image quality is easily affected by factors such as body position, respiration, and feathers, leading to unstable measurement accuracy. Meanwhile, establishing an accurate model of the relationship between ultrasound parameters and weight is complex, requires a large amount of experimental data, and has limited model versatility.
[0003] In recent years, image analysis technology has provided new solutions to the aforementioned problems. Currently, image analysis techniques applied to poultry pectoral muscle analysis mainly involve acquiring images of the pectoral muscles using image acquisition equipment, and then applying a series of image processing algorithms, such as edge detection, thresholding, and feature extraction, to quantitatively analyze the shape, size, and other features of the pectoral muscles. However, although these image processing algorithms can achieve automated analysis and processing of pectoral muscle region features, their operation is complex and their analysis efficiency is low. Summary of the Invention
[0004] This invention provides a method, device, and electronic device for predicting the weight of poultry breast muscles, addressing the shortcomings of existing technologies that rely on manual segmentation and weighing to obtain poultry breast muscle weight, resulting in low efficiency and the inability to achieve automated batch measurement. This invention enables rapid and automated prediction of poultry breast muscle weight. The technical solution proposed by this invention is as follows: In a first aspect, the present invention provides a method for predicting the weight of poultry pectoral muscles, comprising: An image enhancement network is used to enhance digital X-ray images of poultry, resulting in enhanced digital X-ray images. The enhanced digital X-ray image was segmented into poultry pectoral muscle regions using an image segmentation network to obtain poultry pectoral muscle region information. Based on the information about the poultry pectoral muscle region, the geometric features of the poultry pectoral muscle region are extracted; The geometric features are input into a trained machine learning model, which outputs a prediction of the weight of the poultry's pectoral muscles.
[0005] Optionally, the step of using an image enhancement network to enhance the digital X-ray images of poultry to obtain enhanced digital X-ray images includes: The digitized X-ray images are input into an image enhancement model based on generative adversarial networks; The generator in the image enhancement model performs a mapping transformation on the digital X-ray image and outputs the enhanced digital X-ray image.
[0006] Optionally, the image enhancement model is trained through the following process: Obtain a training dataset, which contains real image pairs consisting of a first digital X-ray image and a second digital X-ray image; The generator and discriminator are trained by alternately executing a discriminator training phase and a generator training phase; wherein, in the discriminator training phase, the parameters of the generator are fixed and the parameters of the discriminator are updated; in the generator training phase, the parameters of the discriminator are fixed and the parameters of the generator are updated. After training, the generator in the image enhancement model is obtained.
[0007] Optionally, updating the parameters of the discriminator includes: The first digitized X-ray image from the real image pair is input into the generator to obtain the generated image; The real image pair and the generated image pair consisting of the generated image and the first digital X-ray image are respectively input into the discriminator to obtain the corresponding discrimination results; The adversarial loss is calculated based on the discriminator's discrimination results for the real image pairs and the discrimination results for the generated image pairs, and the parameters of the discriminator are updated based on the adversarial loss; Update the parameters of the generator, including: The first digitized X-ray image from the real image pair is input into the generator to obtain the generated image; The real image pair and the generated image pair consisting of the generated image and the first digital X-ray image are respectively input into the discriminator to obtain the corresponding discrimination results; Based on the discriminator's discrimination results for the real image pairs and the discrimination results for the generated image pairs, the adversarial loss is determined; The difference loss is determined based on the pixel-level difference between the generated image and the second digitized X-ray image. The generator's total loss is determined based on the adversarial loss and the difference loss, and the generator's parameters are updated based on the total generator loss.
[0008] Optionally, the image segmentation network includes an encoder path and a decoder path; The encoder path contains multiple sequentially connected encoding blocks, each encoding block containing a multi-scale feature extraction and compression excitation module; except for the first encoding block, the remaining encoding blocks also contain downsampling layers, which are placed before the multi-scale feature extraction and compression excitation modules; the decoder path contains multiple sequentially connected decoding blocks, each decoding block containing an upsampling layer. The image segmentation network also includes multiple convolutional block attention modules that correspond one-to-one with the coding blocks; The step of segmenting the enhanced digital X-ray image into the poultry pectoral muscle region using an image segmentation network to obtain poultry pectoral muscle region information includes: The enhanced digital X-ray image is input into the encoder path; In the first coding block, the multi-scale feature extraction compression excitation module enhances the enhanced digital X-ray image to generate a first enhanced feature map; In subsequent coding blocks, the downsampling layer first downsamples the output features of the previous coding block, and the multi-scale feature extraction and compression excitation module then enhances the downsampled features to generate the enhanced feature map of the current coding block. The enhanced feature map generated by each coding block is provided as input to the next coding block and simultaneously transmitted to the corresponding convolutional block attention module; The feature map finally output by the encoder path is input into the decoder path; for each decoding block, the upsampling layer of the decoding block upsamples the input features, and then concatenates them with the enhanced feature map from the corresponding encoding block in the channel dimension to form a fused feature map. The convolutional block attention module weights the fused feature map in terms of spatial and channel dimensions and outputs the refined feature map of the decoding block. The refined feature map output from the end of the decoder path is passed through a prediction layer to generate a poultry pectoral muscle region segmentation mask as the poultry pectoral muscle region information.
[0009] Optionally, the geometric features include at least one of area, perimeter, minimum circumscribed rectangle, circumscribed circle radius, circumscribed ellipse major axis, and circumscribed ellipse minor axis.
[0010] Secondly, the present invention also provides a poultry pectoral muscle weight prediction device, comprising the following modules: The enhancement processing module is used to enhance the digital X-ray images of poultry using an image enhancement network to obtain enhanced digital X-ray images; The image segmentation module is used to segment the poultry pectoral muscle region of the enhanced digital X-ray image using an image segmentation network to obtain poultry pectoral muscle region information. The feature extraction module is used to extract the geometric features of the poultry pectoral muscle region based on the poultry pectoral muscle region information; The weight prediction module is used to input the geometric features into a trained machine learning model and output the predicted weight of poultry breast muscles.
[0011] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the poultry pectoral muscle weight prediction method as described in the first aspect above.
[0012] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the poultry pectoral muscle weight prediction method as described in the first aspect above.
[0013] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the poultry pectoral muscle weight prediction method as described in the first aspect above.
[0014] Based on the above technical solution, the beneficial effects of the present invention compared with the prior art are as follows: This invention provides a method, device, and electronic equipment for predicting poultry breast muscle weight. Utilizing digital X-ray imaging, it eliminates the need for animal slaughter, allowing operation on live poultry. It enables automated batch image processing for batch prediction of poultry breast muscle weight, overcoming the limitations of direct weighing methods in terms of live measurement and automated batch measurement. Based on digital X-ray imaging, this invention accurately acquires information about the poultry breast muscle region through image enhancement and segmentation, extracting geometric features to input into a machine learning model for weight prediction. This reduces interference from external factors and improves prediction accuracy. By employing a series of automated processing steps, including image enhancement networks, image segmentation networks, and machine learning models, it reduces manual intervention and complex operations, achieving rapid and automated prediction of poultry breast muscle weight and improving detection efficiency.
[0015] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.
[0016] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the poultry pectoral muscle weight prediction method provided by the present invention.
[0019] Figure 2 This is a schematic diagram of the image enhancement network provided by the present invention.
[0020] Figure 3 This is a schematic diagram of the image segmentation network provided by the present invention.
[0021] Figure 4 This is a schematic diagram of the structure of the multi-scale feature extraction and compression excitation module provided by the present invention.
[0022] Figure 5 This is a schematic diagram of the structure of the convolutional block attention module provided by the present invention.
[0023] Figure 6 This is a schematic diagram of the channel attention module provided by the present invention.
[0024] Figure 7 This is a schematic diagram of the spatial attention module provided by the present invention.
[0025] Figure 8 This is a schematic diagram of the poultry pectoral muscle weight prediction device provided by the present invention.
[0026] Figure 9 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0028] Compared to traditional image processing methods, deep learning technology utilizes models based on convolutional neural networks to automatically extract pectoral muscle features through learning from a large number of pectoral muscle images. This allows for the capture of deep-level feature information within the pectoral muscle images, enabling accurate quantification of the pectoral muscle region. This invention proposes a method, device, and electronic device for predicting the weight of poultry pectoral muscles. This method combines deep learning and machine learning to determine the weight of pectoral muscles in live poultry, effectively overcoming the limitations of traditional measurement methods and avoiding the drawbacks of traditional slaughtering and segmentation methods. It achieves accurate prediction of the pectoral muscle region and provides richer and more accurate data support for dynamic monitoring of growth and development and the breeding of superior breeds.
[0029] It should be noted that the poultry breast muscle weight prediction method provided by this invention has universal applicability. It is not only applicable to chickens but can also be widely applied to estimating the live breast meat weight of other poultry such as ducks, geese, turkeys, and quails. Simply by acquiring corresponding digital X-ray images of the target poultry and constructing a dataset containing the target species' true weight labels, and fine-tuning the image segmentation model and weight prediction model, efficient and non-destructive prediction of the breast meat weight of that species can be quickly adapted and achieved.
[0030] Reference Figure 1 As shown, the method for predicting poultry pectoral muscle weight includes the following: S110. Use an image enhancement network to enhance the digital X-ray images of poultry to obtain enhanced digital X-ray images.
[0031] First, the acquired raw digital X-ray images are preprocessed. First, noise reduction is performed using filtering algorithms such as median filtering and Gaussian filtering to remove random noise and smooth the image. Simultaneously, to address uneven illumination, histogram equalization is used to adjust the grayscale distribution and enhance contrast, making the difference between the poultry's pectoral muscle area and the background more pronounced.
[0032] Next, the preprocessed digitized X-ray image is input into the selected image enhancement network. This network is built using deep learning algorithms, such as image enhancement models based on generative adversarial networks (GANs) or improved image enhancement networks based on deep residual networks (ResNet). Taking a ResNet-based network as an example, the network structure contains multiple residual blocks. The input to the first residual block is the preprocessed digitized X-ray image. Each residual block receives an input feature map. This input feature map performs two operations simultaneously: First, it sequentially passes through multiple convolutional layers within the current residual block (e.g., two 3×3 convolutional layers, each followed by batch normalization and ReLU activation). These convolutional layers perform nonlinear transformations and feature extraction, outputting a feature map. Second, this input feature map is directly passed to the output of the current residual block via skip connections. At the end of the current residual block, the feature map output by the convolutional layers is element-wise added to the original input feature map passed through the skip connections. Finally, it is passed through a ReLU activation function to become the output feature map of the current residual block. The output feature map becomes the input feature map for the next residual block in the network structure. Skip connections can directly pass the input information to subsequent layers, solving the gradient vanishing problem that may occur during the training of deep networks, and enabling the network to learn deeper feature representations.
[0033] During the network training phase, a large dataset of labeled digitized X-ray images of poultry is prepared, with one portion used as the training set and the other as the validation set. The training images are input into the network, and the network parameters are continuously adjusted using the backpropagation algorithm, constantly reducing the error between the network's output image and the labeled high-quality real images. During training, a loss function, such as the mean squared error loss function, is used to measure the difference between the output image and the real image. This function calculates the average of the squared differences in grayscale values of corresponding pixels in the output and real images; a smaller loss value indicates that the output image is closer to the real image. Simultaneously, optimization algorithms such as stochastic gradient descent or its improved versions are used to update the network parameters, accelerating the network's convergence process.
[0034] After multiple rounds of training, the network is considered complete when its performance on the validation set stabilizes and meets the requirements. At this point, the digital X-ray images of poultry to be enhanced are input into the trained network. The network processes the input images based on the learned feature mapping relationships and outputs enhanced digital X-ray images. In the enhanced images, the features of the poultry's pectoral muscle region are more prominent, noise and interference are effectively suppressed, and image quality is significantly improved, providing high-quality input for subsequent image segmentation and feature extraction steps.
[0035] S120. Use an image segmentation network to segment the poultry pectoral muscle region of the enhanced digital X-ray image to obtain poultry pectoral muscle region information.
[0036] The enhanced digital X-ray image is input into an image segmentation network. Image segmentation networks can employ U-Net, Mask Region-based Convolutional Neural Network (MaskR-CNN), or similar technologies. These networks learn from large amounts of labeled image data and can automatically identify different objects and regions within the image. When processing digital X-ray images of poultry, the image segmentation network classifies each pixel in the image to determine whether it belongs to the poultry's pectoral muscle region. After processing and calculation by the network, a binary segmentation result is output, where white areas represent the poultry's pectoral muscle region, and black areas represent the background and other non-poultry pectoral muscle regions. This provides information about the poultry's pectoral muscle region, including its boundary coordinates and area. The image segmentation network can accurately separate the poultry's pectoral muscle region from the enhanced digital X-ray image. In the output binary segmentation result, white areas represent the poultry's pectoral muscle region, and black areas represent the background and other non-poultry pectoral muscle regions. In this way, the specific location, shape, and outline of poultry pectoral muscles can be accurately obtained. The positioning error of the poultry pectoral muscle boundary coordinates is extremely small, and the area calculation results are also highly accurate, providing a precise target area for subsequent feature extraction and improving the accuracy of the entire prediction process.
[0037] S130. Based on the information of the poultry pectoral muscle region, extract the geometric features of the poultry pectoral muscle region.
[0038] Based on the poultry pectoral muscle region information obtained in step S120, image processing and feature extraction algorithms are used to calculate the geometric features of the poultry pectoral muscle region. Specifically, OpenCV methods can be used to extract the geometric features of the pectoral muscle region. Geometric features include, but are not limited to, area, perimeter, aspect ratio, rectangularity, circumcircle radius, and the lengths of the major and minor axes of the circumcircle ellipse. The geometric features extracted based on the poultry pectoral muscle region information can comprehensively and accurately describe the characteristics of the poultry pectoral muscle region in terms of shape and structure. These features are closely correlated with the weight of the poultry pectoral muscles, providing high-quality and valuable input information for subsequent machine learning models. This helps the model more accurately establish the mapping relationship between geometric features and the weight of the poultry pectoral muscles, thereby improving the accuracy of the prediction results.
[0039] S140. Input the geometric features into the trained machine learning model and output the predicted result of the poultry pectoral muscle weight.
[0040] Before making predictions, a large amount of labeled data containing the slaughter weight of poultry breast muscles is needed to train the machine learning model. Machine learning models can employ support vector machines, random forests, neural networks, etc. During training, the geometric features of the sample data are used as input, and the corresponding slaughter weight of poultry breast muscles is used as output. The model parameters are continuously adjusted so that the model can learn the intrinsic relationship between geometric features and poultry breast muscle weight.
[0041] After new digital X-ray images of poultry are processed through the previous three steps, the geometric features of the poultry's pectoral muscle region are obtained. These geometric features are then input into a pre-trained machine learning model. The model calculates and analyzes the input features based on the learned patterns, ultimately outputting a predicted weight of the poultry's pectoral muscle.
[0042] This invention, based on digital X-ray imaging, accurately obtains information about the pectoral muscle region of poultry through image enhancement and segmentation, and extracts geometric features to input into a machine learning model for weight prediction. This reduces interference from external factors and improves prediction accuracy. This invention does not rely on regression equations based on specific body size indicators, but rather on the geometric features of the poultry pectoral muscle region and a machine learning model, exhibiting better adaptability and universality for poultry of different individuals, breeds, and rearing environments.
[0043] In ultrasonic measurement, the quality of ultrasound images is easily affected by factors such as body position, respiration, and feathers, leading to unstable measurement accuracy. Furthermore, establishing a precise model relating ultrasound parameters to weight using ultrasonic measurement is complex, requires extensive experimental data, and has limited model versatility. Digital X-ray imaging, on the other hand, is relatively stable and less affected by these factors. Using image enhancement networks can further improve image quality, ensuring accurate segmentation of the poultry pectoral muscle region and extraction of geometric features, thereby improving the accuracy of weight prediction. This invention extracts geometric features of the poultry pectoral muscle region and inputs them into a machine learning model to predict weight. Compared to ultrasonic measurement, the model establishment process is simpler and improves the model's versatility to some extent. This invention utilizes a series of automated processing steps, including image enhancement networks, image segmentation networks, and machine learning models, reducing manual intervention and complex operations, achieving rapid and automated prediction of poultry pectoral muscle weight, and improving detection efficiency.
[0044] In an optional embodiment, the above-described step S110, which uses an image enhancement network to enhance digital X-ray images of poultry to obtain enhanced digital X-ray images, includes: S1101. The digital X-ray imaging image is input into an image enhancement model based on a generative adversarial network; the generator in the image enhancement model performs a mapping transformation on the digital X-ray imaging image and outputs the enhanced digital X-ray imaging image.
[0045] The acquired raw digital X-ray images of poultry undergo preprocessing. Preprocessing operations include size normalization and pixel normalization. Pixel normalization involves scaling the images to a fixed resolution (e.g., 256). 256 pixels or 512 The image is preprocessed (512 pixels) to obtain a size-normalized image, ensuring it matches the input layer size of the image enhancement model. The pixel values of the size-normalized image are normalized from the original grayscale levels to a specific numerical range (e.g., [-1,1] or [0,1]), conforming to the numerical distribution requirements for model training. After preprocessing, the preprocessed digitized X-ray image is used as input data and fed into the generative adversarial network-based image enhancement model.
[0046] The image enhancement model is a generative adversarial network (GAN) that has been trained and is in the inference phase. At this stage, only the generator within the network is used. The preprocessed digitized X-ray image is input to the generator. The generator, acting as a complex nonlinear transformation function, performs deep mapping transformations on the input image through multiple convolutions, upsampling, and downsampling operations. After layer-by-layer processing by the generator, a new, enhanced digitized X-ray image is finally obtained at the output, which will be directly used as input data for the region segmentation network. This image has the same size as the input image but its intrinsic quality is improved.
[0047] Raw digital X-ray images may be affected by equipment noise, environmental interference, and other factors, resulting in numerous noisy points. This invention utilizes a Generative Adversarial Network (GAN)-based image enhancement model, which automatically identifies and suppresses this noise through adversarial learning between the generator and discriminator, making the enhanced image smoother and clearer. X-ray images often suffer from insufficient contrast, making it difficult to distinguish different tissues and structures. GAN models can learn the contrast distribution of real, high-quality images to enhance the contrast of input images. In the enhanced image, the contrast between the poultry pectoral muscle region and surrounding tissues is significantly improved, making the boundaries of the poultry pectoral muscle clearer, facilitating subsequent image segmentation and feature extraction. During image acquisition, image details may be lost due to equipment resolution limitations, motion blur, etc. This invention uses a GAN-based image enhancement model to recover lost details by leveraging its powerful feature learning and generation capabilities. The improved quality of the enhanced digital X-ray image makes the boundaries between the poultry pectoral muscle region and the background and other tissues clearer, which is beneficial for subsequent image segmentation tasks.
[0048] In an optional embodiment, the image enhancement model is trained through the following process: S210. Obtain a training dataset, wherein the training dataset contains real image pairs consisting of a first digital X-ray image and a second digital X-ray image.
[0049] Multiple images of poultry were taken using digital X-ray imaging equipment. To increase data diversity, images were collected from poultry at different growth stages. For each poultry, two digital X-ray images were acquired, designated as the first and second digital X-ray images, and these were combined into a real image pair. The first digital X-ray image served as the input image to the generator, i.e., the source image to be enhanced. The second digital X-ray image was the target image that the generator needed to learn from, i.e., a high-quality reference image. This second image significantly outperformed the first digital X-ray image in visual quality, specifically exhibiting higher contrast, clearer details, and lower noise levels.
[0050] S220. The generator and discriminator are trained by alternately executing the discriminator training phase and the generator training phase; wherein, in the discriminator training phase, the parameters of the generator are fixed and the parameters of the discriminator are updated; in the generator training phase, the parameters of the discriminator are fixed and the parameters of the generator are updated.
[0051] Before training begins, the parameters of the generator and discriminator are initialized. Random initialization can be used, assigning random weights and biases to each neuron in the generator and discriminator.
[0052] During the discriminator training phase, the generator's parameters are kept unchanged, and only the discriminator's parameters are updated. This is to focus on improving the discriminator's ability to distinguish between real and generated images. The second digitized X-ray image from the real image pair (i.e., the real image) and the image generated by the generator are simultaneously input into the discriminator. The real image is used as a positive sample, and the generated image as a negative sample. The discriminator aims to distinguish between real and generated images as accurately as possible; therefore, its loss function is the binary cross-entropy loss function. This loss function calculates the difference between the discriminator's judgment of the real and generated images and the real labels (real image label is 1, generated image label is 0). The smaller the loss value, the more accurate the discriminator's judgment. Based on the calculated loss function value, the gradient of the discriminator parameters is calculated using the backpropagation algorithm, and the discriminator's parameters are updated using an optimization algorithm, enabling the discriminator to more accurately distinguish between real and generated images in the next judgment. Optimization algorithms can include stochastic gradient descent (SGD) and its variant Adam, etc.
[0053] During the generator training phase, the discriminator's parameters are kept unchanged, and only the generator's parameters are updated. This is to ensure the generator focuses on producing more realistic images to deceive the discriminator. The first digitized X-ray image from the real image pair is input into the generator, which performs a mapping transformation and outputs the enhanced image (i.e., the generated image). The generator's loss function consists of two parts. One part is the deception loss, which measures the probability that the generator-generated image will be judged as a real image by the discriminator, and this probability should be as high as possible. The other part is the content loss, which measures the difference in content between the generated image and the second digitized X-ray image from the real image pair. For example, the mean squared error loss function can be used to calculate the pixel-level difference between the two. By comprehensively considering these two losses, the generator can not only generate realistic images but also ensure that the content of the generated images is similar to that of the real images. Based on the calculated loss function values, the gradient of the generator parameters is calculated using the backpropagation algorithm, and the generator parameters are updated using an optimization algorithm, so that the generator can generate more realistic images that better match the content of the real images in the next generation.
[0054] The discriminator and generator training phases are repeated, with the parameters of the discriminator and generator being updated alternately. In each iteration, the discriminator and generator continuously learn and improve; the discriminator strives to distinguish between real and generated images, while the generator strives to generate more realistic images to deceive the discriminator. As the number of iterations increases, the performance of the generator and discriminator gradually improves, eventually reaching a dynamic equilibrium.
[0055] S230. After training is completed, the generator in the image enhancement model is obtained.
[0056] After multiple rounds of alternating training, the training process ends when the model's performance on the validation set stabilizes and meets the requirements. At this point, the trained generator has the ability to map the input first digital X-ray image into a high-quality enhanced image. This generator is the core of the image enhancement model and can be used to enhance new digital X-ray images of poultry.
[0057] This invention trains the generator and discriminator alternately. The generator learns the feature distribution and mapping relationships of real images, thus generating enhanced images similar to real images. During training, using diverse training datasets, including images of poultry at different growth stages, enables the generator to learn a wider range of image features and mapping relationships. Therefore, the trained image enhancement model has strong generalization ability and can stably output high-quality enhanced images in practical applications. Because the alternating training method allows the generator and discriminator to continuously optimize in adversarial scenarios, the generator learns how to cope with various complex situations and interferences.
[0058] In an optional embodiment, updating the parameters of the discriminator as described in S220 above includes: S2201. Input the first digital X-ray image from the real image pair into the generator to obtain a generated image; input the real image pair and the generated image pair composed of the generated image and the first digital X-ray image into the discriminator to obtain corresponding discrimination results; calculate the adversarial loss based on the discrimination results of the discriminator on the real image pair and the discrimination results on the generated image pair, and update the parameters of the discriminator based on the adversarial loss.
[0059] Specifically, a real image pair (x, y) is selected from the training dataset, which includes a first digital X-ray image x and a second digital X-ray image y (the target image). The first digital X-ray image x is input into the generator to obtain the corresponding generated image G(x). The real image pair (x, y) is input into the discriminator D to obtain a first discrimination result D(x, y), which represents the confidence level of the discriminator in considering the image pair as a real image pair. The generated image pair (x, G(x)) consisting of the generated image G(x) and the first digital X-ray image x is input into the discriminator D to obtain a second discrimination result D(x, G(x)), which represents the confidence level of the discriminator D in considering the image pair as a real image pair.
[0060] Calculate the adversarial loss based on the first discrimination result D(x,y) and the second discrimination result D(x,G(x)). The design of this loss function enables the discriminator to better distinguish between real image pairs and generated image pairs. Based on the discriminative loss, the discriminator's parameters θ are updated using the backpropagation algorithm. D This enhances the discriminator's ability to identify different targets.
[0061] The first term is the discriminant loss of D for real samples, i.e., real image pairs (x, y), and the second term is the discriminant loss of D for fake samples, i.e., generated image pairs (x, G(x)). D(x, y) represents the probability that the discriminator judges the first digital X-ray image x and the second digital X-ray image y as a real pair; G(x) is the generated image, i.e., the fake image y generated by the generator based on x. fake . It is the mathematical expectation of all real image pairs (x, y) in the training dataset. It is the mathematical expectation of all x in the training dataset. The goal of the discriminator D is to maximize this adversarial loss.
[0062] After inputting the first digitized X-ray image x into the generator G, refer to Figure 2As shown, firstly, an initial feature map containing information such as image edges is extracted through the first ResNet convolutional layer. Figure 1 On one hand, the input is used as the input to the max pooling layer; on the other hand, it is directly passed to the corresponding ResNet convolutional layer through skip connections. After multiple rounds of progressive feature enhancement by ResNet convolutional layers, the output of the current ResNet convolutional layer is simultaneously input to the max pooling layer for downsampling, resulting in an abstract feature map that is size-compressed and retains the core information of the lesion, and is passed to the corresponding ResNet convolutional layer in the upsampling stage through skip connections. After entering the upsampling stage, the abstract feature map is first input to the upsampling layer to restore its size, and then enters the first ResNet convolutional layer of this stage, while the ResNet convolutional layer corresponding to the previous downsampling stage is passed directly to the corresponding ResNet convolutional layer. Features passed through skip connections are fused with the output of the current ResNet convolutional layer. The fused features are then further restored to their original size by an upsampling layer before entering the next ResNet convolutional layer. In the cyclical process of upsampling layer-ResNet convolutional layer-feature fusion-upsampling layer, the cross-layer features brought by skip connections are continuously fused, refining the features and gradually restoring the complete size of the image, ultimately forming a high-resolution refined feature map. Finally, the refined feature map is adjusted for the number of channels by a Conv1×1 convolutional layer, and then the pixel values are mapped to the [-1,1] interval by the Tanh activation function to obtain the generated image G(x) that matches the x format.
[0063] The discriminator D outputs Real and Fake, representing its judgment of the input image. When the input is a real image pair (x, y), the discriminator should output Real. When the input is a generated image pair (x, G(x)), the discriminator should output Fake.
[0064] Updating the parameters of the generator as described in S220 above includes: S2202: Input the first digital X-ray image from the real image pair into the generator to obtain a generated image; input the real image pair and the generated image pair composed of the generated image and the first digital X-ray image into the discriminator to obtain corresponding discrimination results; determine the adversarial loss based on the discrimination results of the discriminator on the real image pair and the generated image pair; determine the difference loss based on the pixel-level difference between the generated image and the second digital X-ray image; determine the generator total loss based on the adversarial loss and the difference loss, and update the generator parameters based on the generator total loss.
[0065] Specifically, a real image pair (x, y) is selected from the training dataset, and a first digital X-ray image x is obtained. The first digital X-ray image x is input into the generator G to obtain the corresponding generated image G(x). The real image pair (x, y) is input into the discriminator to obtain a first discrimination result D(x, y); the generated image pair (x, G(x)) consisting of the generated image G(x) and the first digital X-ray image x is input into the discriminator D to obtain a second discrimination result D(x, G(x)). Using the above adversarial loss calculation formula, the adversarial loss is determined based on the first discrimination result D(x, y) and the second discrimination result D(x, G(x)). This loss prompts the generator to produce realistic images that can fool the discriminator. The goal of the generator G is to minimize this adversarial loss.
[0066] The pixel-level difference between the generated image and the second digital X-ray image in the real image pair is calculated, and a difference loss is determined based on this difference. This loss ensures that the generated image is consistent with the target image in terms of content.
[0067] In the formula, This is the difference loss. To make the generated image closer to the target image at the pixel level, this loss calculates the expectation of the absolute difference between the pixel values of the generated image G(x) and the second digitized X-ray image y, penalizing the generated result for content deviation. This loss ensures that the generated image maintains pixel-level consistency with the target image in terms of content, preserving important structural information. It is the L1 norm. This indicates the calculation of the pixel value difference between the second digitized X-ray image and the generated image at each pixel location. This represents the sum of the absolute differences in pixel values between the generated image G(x) and the second digitized X-ray image y. It is the mathematical expectation of all real image pairs (x, y) in the training dataset, representing the calculation of... The average value.
[0068] Combining the adversarial loss and difference loss, the generator's total loss is determined. The generator's parameters are then updated using backpropagation to improve the image generation quality. (Generator Total Loss) It is a weighted sum of adversarial loss and difference loss: Here, λ is a hyperparameter that balances the two losses. Setting it to 100 emphasizes pixel-level similarity, and the discriminator's loss is only the adversarial loss.
[0069] This invention trains the generator and discriminator alternately. The generator learns the feature distribution and mapping relationships of real, high-quality images, thus generating enhanced images similar to the real images. During training, using diverse training datasets, including images of poultry at different growth stages, enables the generator to learn a wider range of image features and mapping relationships. Therefore, the trained image enhancement model has strong generalization ability and can stably output high-quality enhanced images in practical applications. Because the alternating training method allows the generator and discriminator to continuously optimize in adversarial scenarios, the generator learns how to cope with various complex situations and interferences, improving the model's applicability in complex scenes.
[0070] In an optional embodiment, this method employs an improved U-Net architecture, which achieves pixel-level accurate segmentation by introducing multi-scale feature extraction and attention mechanisms. The image segmentation network includes an encoder path and a decoder path; Reference Figure 3 As shown, the encoder path contains multiple sequentially connected encoding blocks, each encoding block containing a Multi-scale Squeeze-and-Stimulation Extraction (MSSE) module; except for the first encoding block, the remaining encoding blocks also contain downsampling layers, placed before the multi-scale feature extraction and compression excitation module; the decoder path contains multiple sequentially connected decoding blocks, each decoding block containing an upsampling layer. The image segmentation network also includes multiple Convolutional Block Attention Modules (CBAMs) that correspond one-to-one with the coding blocks. The above-described S120 method of using an image segmentation network to segment the enhanced digital X-ray image into the poultry pectoral muscle region to obtain poultry pectoral muscle region information includes: S1201. The enhanced digital X-ray image is input into the encoder path; in the first coding block, the multi-scale feature extraction and compression excitation module enhances the enhanced digital X-ray image to generate a first enhanced feature map; in subsequent coding blocks, the downsampling layer first downsamples the output features of the previous coding block, and the multi-scale feature extraction and compression excitation module then enhances the downsampled features to generate the enhanced feature map of the current coding block; the enhanced feature map generated by each coding block is provided to the next coding block as input and simultaneously transmitted to the corresponding convolutional block attention module.
[0071] The enhanced digital X-ray image output from step S110 is used as input to the encoder path. The enhanced digital X-ray image directly enters the first coding block. The multi-scale feature extraction and compression excitation module within this coding block enhances the features of the enhanced digital X-ray image, capturing shallow features (such as edges) of the poultry pectoral muscle region, and outputs the first enhanced feature map. This first feature map is simultaneously passed to the first corresponding convolutional block attention module and used as input to the second coding block. Starting from the second coding block, each coding block first compresses the spatial dimension of the feature map output from the previous coding block through a downsampling layer, expanding the receptive field. The downsampled feature map is then fed into the multi-scale feature extraction and compression excitation module of that coding block for deeper, multi-scale feature enhancement and fusion. The enhanced feature map of the current coding block is output. This feature map is passed to the next coding block as input and simultaneously passed to the corresponding convolutional block attention module. The downsampling layer can be a convolutional or pooling layer with a stride of 2. Through the encoder path, the input enhanced digital X-ray image is progressively transformed into a series of enhanced feature maps with rich semantic information but decreasing resolution.
[0072] S1202. Input the feature map finally output by the encoder path into the decoder path; for each decoding block, the upsampling layer of the decoding block upsamples the input features, and then concatenates them with the enhanced feature map from the corresponding encoding block in the channel dimension to form a fused feature map. The convolutional block attention module weights the fused feature map in terms of spatial and channel dimensions and outputs the refined feature map of the decoding block.
[0073] The feature map with the most semantic information, output from the end of the encoder path, is used as the starting input and fed into the decoder path. For each decoding block in the decoder path, the following operations are performed sequentially: The upsampling layer of this decoding block upsamples the input feature map to obtain a preliminary feature map with improved resolution. This preliminary upsampled feature map is then concatenated with the enhanced feature map from the corresponding encoding block via skip connections, along the channel dimension, to obtain a fused feature map. This fused feature map is then weighted spatially and along the channel dimension by the attention module of the convolutional block, suppressing background noise unrelated to the poultry pectoral muscle region and enhancing the features of the poultry pectoral muscle contour and tissue, making the fusion process more targeted. Convolution and other operations are performed on the fused feature map to output a refined feature map for this decoding block. This feature map will serve as the input for the next decoding block. Through the decoder path, the spatial resolution of the feature map is gradually restored, while incorporating detailed features from the encoder path, achieving precise localization.
[0074] S1203. The refined feature map output from the end of the decoder path is passed through a prediction layer to generate a poultry pectoral muscle region segmentation mask as the poultry pectoral muscle region information.
[0075] The refined feature map, output from the decoder path and with its resolution restored to be close to that of the original input image (i.e., the enhanced digital X-ray image mentioned above), is input into a prediction layer. The prediction layer is a 1... A convolutional layer followed by a sigmoid activation function. This prediction layer calculates a value between 0 and 1 for each pixel, representing the probability that the pixel belongs to the poultry pectoral muscle region. By setting a threshold (e.g., 0.5), the probability is... Figure 2 The image is then binarized to generate a segmentation mask for the poultry breast muscle region with the same size as the input image. This binary mask is the final output of step S120, which is the poultry breast muscle region information, where white areas (value 1) represent poultry breast muscles and black areas (value 0) represent the background.
[0076] This invention utilizes a multi-scale feature extraction and compression excitation module within the coding block to extract image features at different scales, enabling the network to capture information about objects and structures of varying sizes within an image. In poultry pectoral muscle region segmentation, the shape and size of the pectoral muscles may differ; multi-scale feature extraction better adapts to these variations, improving segmentation accuracy. The compression excitation mechanism, through adaptive weight adjustment of feature channels, enhances the expressive power of important feature channels and suppresses the influence of redundant feature channels. In poultry pectoral muscle region segmentation, different feature channels may correspond to different image features, such as edges. Through compression excitation, the network can automatically learn which feature channels are more important for poultry pectoral muscle region segmentation, thereby allocating higher weights to important feature channels, improving the effectiveness and discriminative power of key features, and further enhancing segmentation performance.
[0077] Downsampling layers in the encoder path reduce the spatial size of feature maps, expanding the receptive field and enabling the network to capture a wider range of image information, thus aiding in understanding the overall semantic structure of the image. Upsampling layers in the decoder path restore low-resolution feature maps to high resolution, fusing them with features from corresponding levels in the encoder path to generate more refined segmentation results. This downsampling-upsampling structure allows the network to extract and utilize feature information at different levels, balancing global semantic information with local details, thereby improving segmentation accuracy and robustness.
[0078] In poultry breast muscle region segmentation, the attention mechanism allows the network to focus more on the features of the poultry breast muscle region, reducing interference from irrelevant information such as background, thereby improving the accuracy and efficiency of segmentation. Through the comprehensive application of the above-mentioned techniques, this image segmentation network can more accurately extract feature information of the poultry breast muscle region and generate a more precise segmentation mask.
[0079] The Multi-scale Squeeze-and-Stimulation Extraction (MSSE) module is a core component of the encoder path, and its structure is as follows: Figure 4 As shown, its structure is based on a multi-branch parallel dilated convolution design, used to extract and fuse feature information from different receptive fields. The specific workflow of this module is as follows: The input feature map enters two paths simultaneously. One path is the main compression path, which uses Conv1×1+BN / ReLU operations to achieve channel compression and non-linear activation. Conv1×1 represents a 1×1 convolution, which linearly transforms the channel dimension of the input feature map. Its main function is to reduce channel dimension, reduce computational complexity, and enable cross-channel information exchange and combination. Batch Normalization (BN) normalizes the convolution output to obtain a batch-normalized feature map. Rectified Linear Unit (ReLU) performs non-linear activation on the batch-normalized feature map, introducing a non-linear transformation to enhance the model's expressive power. This path ultimately generates the initial compressed feature map (denoted as F). init ).
[0080] Another path is the multi-scale branch path, which includes four parallel branches. The input feature map enters the multi-branch parallel processing. Each branch extracts multi-scale features using Conv3×3+BN / ReLU with different dilation rates (rate=1 / 3 / 5 / 7). Specifically, Conv3×3 (3×3 convolution): a 3×3 convolution kernel is used to perform sliding window calculation on the input feature map to extract local spatial features. Different dilation rates allow the convolution kernel to have different receptive fields (the receptive field is smallest when rate=1 and largest when rate=7) while keeping the number of parameters constant, thus capturing contextual information at different scales. BN and ReLU play the same roles as in the main compression path, used for batch normalization and nonlinear transformation, respectively.
[0081] The output feature maps of each branch are fused step by step through an addition operation (⊕) to form a hybrid multi-scale feature map F. multi F multi Input the Squeeze Excitation (SE) module, which performs compression and excitation operations sequentially.
[0082] The squeezing operation process is as follows: The input F... multiPerform a global average pooling operation. This operation compresses the entire spatial dimension (H×W) of each channel into a single scalar value, ultimately resulting in a one-dimensional channel statistics vector (or global descriptor). This vector aggregates global contextual information for each feature channel.
[0083] The activation operation refers to the following process: the channel statistical vector obtained from the compression operation is taken as input and passed through a gating mechanism consisting of two fully connected layers. The first fully connected layer performs dimensionality reduction and uses the ReLU activation function; the second fully connected layer restores the original number of channels and uses the Sigmoid activation function. The output of this gating mechanism is a new vector with the same dimension as the input vector but with values between 0 and 1, namely the channel weight vector. Each value in this weight vector represents the importance of the corresponding feature channel. Subsequently, this channel weight vector is passed to the input F of the multi-scale branch path. multi By multiplying each channel, the original feature map is weighted, highlighting important channels and suppressing secondary channels.
[0084] The SE module ultimately outputs the calibrated feature map F. SE The F output by the SE module SE Compared with the initial feature compression result F init The feature maps are fused using an additive operation to form the final output multi-scale enhanced feature map F. out =F SE +F init This information is then passed to subsequent network layers, namely the downsampling layer of the next coding block and the corresponding convolutional block attention module.
[0085] The processing flow of the Convolutional Block Attention Module (CBAM) is as follows: Figure 5 As shown, this module processes the input features sequentially. Specifically, the convolutional block attention module receives the input feature map, which first enters the channel attention module (Channel Attention Module), referring to... Figure 6 As shown, the channel attention module performs max pooling and average pooling operations on the input feature map. The two pooling results are then fed into a shared multilayer perceptron (SLP) for processing. The two outputs of the SLP are fused to generate a channel attention weight map. The channel attention weights are multiplied by the input feature map to obtain the refined channel features. These refined channel features then enter the spatial attention module, as described above. Figure 7As shown, the spatial attention module performs max pooling and average pooling operations on the channel refined features respectively, and concatenates the results along the channel dimension to obtain the concatenated result. Based on the concatenated result, a spatial attention weight map is generated through a convolutional layer. The spatial attention weights are multiplied by the channel refined features to finally output the refined feature map.
[0086] In an optional embodiment, the present invention quantifies and extracts geometric features characterizing the size, shape, and spatial distribution of poultry pectoral muscles from a binarized segmentation mask, providing numerical input for subsequent weight regression prediction. These geometric features include at least one of area, perimeter, minimum bounding rectangle, circumcircle radius, major axis of the circumcircle ellipse, and minor axis of the circumcircle ellipse. In practical applications, at least one or more combinations of these features can be selected based on prediction accuracy and efficiency requirements.
[0087] The `findContours` function in OpenCV is used to detect the outermost contour pattern and compress the contour algorithm to detect the outer contour of the poultry breast muscle region, generating its corresponding filling mask for subsequent pixel-level calculations. The area of the poultry breast muscle region is obtained by counting the total number of pixels with a value of 1 in the segmentation mask. The perimeter is calculated using the `arcLength` function, which describes the boundary length of the poultry breast muscle region. The `minAreaRect` function in OpenCV is used to find the smallest bounding rectangle that completely encloses the poultry breast muscle region. The width and height of this rectangle are obtained as features. The smallest bounding rectangle describes the approximate spatial extent and orientation of the poultry breast muscle region. The `minEnclosingCircle` function in OpenCV is used to find the smallest bounding circle that completely encloses the poultry breast muscle region, and its radius is obtained. The bounding circle radius provides another measure of the region's coverage and is sensitive to the region's convexity. Finally, the `fitEllipse` function in OpenCV is used to fit an circumscribed ellipse with the same second-order central moment as the poultry breast muscle region. The two axes of this ellipse are the lengths of its major and minor axes. The major and minor axes of the circumscribed ellipse better describe the overall shape and orientation of irregularly shaped poultry pectoral muscle regions. The major axis reflects the scale in the main direction of extension of the region, while the minor axis reflects the scale in the direction perpendicular to it. One or more of the selected geometric feature values are combined into a feature vector, which serves as the input to the subsequent machine learning model.
[0088] The geometric features selected in this invention have an intuitive and interpretable correlation with the actual physical volume and weight of poultry pectoral muscles, providing effective and non-redundant input for machine learning models. All these geometric features are rapidly calculated using mature image processing algorithms based on binary masks, resulting in low computational complexity. This overcomes the time-consuming and labor-intensive drawbacks of traditional weighing methods and meets the efficiency requirements of online, batch processing. Compared to directly using raw pixels, geometric features represent a higher level of abstraction. They are insensitive to slight image deformation, translation, or rotation; as long as the pectoral muscle region is accurately segmented, their feature values can be stably calculated. Different geometric features describe region attributes from different perspectives. Area and circumscribed circle radius primarily reflect size, while perimeter and major-minor axis ratios contain shape information. Their combination provides a richer description for the model, enabling it to learn the complex mapping relationship between weight and shape of poultry of different sizes, thereby improving prediction accuracy, especially for individuals with unique shapes. This method is based on non-contact image measurement, completely eliminating the reliance on slaughtering and segmentation, making continuous and dynamic growth monitoring and weight prediction of live poultry possible.
[0089] This embodiment uses a gradient boosting decision tree model as an example to illustrate how to automatically predict the weight of poultry breast muscles based on geometric features. The input to the gradient boosting decision tree model is a six-dimensional geometric feature vector, specifically including: area, perimeter, minimum bounding rectangle parameter, circumscribed circle radius, major axis of the circumscribed ellipse, and minor axis of the circumscribed ellipse. The area refers to the total number of pixels in the poultry breast muscle region mask; the perimeter refers to the total length of the poultry breast muscle region outline; the minimum bounding rectangle parameter refers to the lengths of the long and short sides of the rectangle; and the circumscribed circle radius refers to the radius of the smallest circle completely enclosing the poultry breast muscle region. The model output is a continuous scalar value, i.e., the predicted weight of the poultry breast muscles, typically in grams.
[0090] The model training process is as follows: First, data preparation and preprocessing are performed. A large-scale sample set is collected, and for each sample, a digital X-ray image of the poultry breast muscle is simultaneously acquired (for extracting the six geometric features mentioned above), and the slaughter weight of the poultry breast muscle is measured using a precision electronic scale. Before inputting the six geometric features into the model, Z-score standardization is performed, which involves subtracting the mean from the value of each feature and then dividing by the standard deviation, transforming it into a distribution with a mean of 0 and a standard deviation of 1. This operation accelerates model convergence and improves performance. The processed dataset is then randomly divided proportionally into training, validation, and test sets.
[0091] Next, model training and tuning are performed. The model is initialized as a simple decision tree containing only a root node. In each iteration: Calculate the predicted values y of the current model for all samples in the training set. pred With slaughter value ytrue The negative gradient between the two. For example, when using mean squared error loss, the negative gradient is the predicted residual y. true y pred Based on the prediction residuals of the current model, a new decision tree is trained with the goal of fitting these residuals to the greatest extent possible. The newly trained decision tree is then added to the model, and its predictions are scaled with a small learning rate and added to the predictions of all the previous trees, thereby updating and optimizing the overall model's predictions.
[0092] After each iteration, the model performance is evaluated using a validation set, such as by calculating the root mean square error (RMSE). When the validation set error no longer decreases significantly over multiple iterations, an early stopping mechanism is triggered to terminate training and prevent overfitting. Simultaneously, the validation set is used to optimize key hyperparameters (such as maximum tree depth, learning rate, and subsampling ratio).
[0093] Finally, the model is evaluated and applied. After training, the model's final performance is evaluated on a test set that was never used in training to ensure its generalization ability. The trained model is then deployed to the prediction system. In practical applications, the model can instantly output the predicted value of poultry pectoral muscle weight simply by inputting six geometric features extracted from the digitized X-ray images of new samples.
[0094] This invention utilizes a gradient boosting decision tree model to automatically capture the complex nonlinear relationships and interactions between area, perimeter, shape parameters, and weight, thereby achieving high-precision and stable prediction of poultry breast muscle weight. The model is insensitive to the dimensions and distribution of input features and effectively handles collinearity issues between features, maintaining good predictive performance across different breeds and growth stages of poultry. The model's inference process involves only one forward computation, making it extremely fast and enabling online, real-time weight estimation of live poultry.
[0095] This invention utilizes deep learning and machine learning methods to predict chest muscle weight in vivo, enabling continuous monitoring of the chest muscles in vivo.
[0096] This invention improves data acquisition and analysis efficiency by utilizing imaging equipment to acquire digital X-ray images. Combined with deep learning image enhancement and segmentation networks, and OpenCV feature extraction, it automates and streamlines the entire process from image acquisition to feature extraction, significantly reducing data processing time. Compared to traditional methods, it can process large amounts of sample data in a short time, improving overall work efficiency. Furthermore, this technology overcomes the limitations of traditional methods that cause damage to poultry, enabling the measurement of pectoral muscle weight in live animals. This feature is of great significance for poultry breeding, allowing for continuous monitoring of pectoral muscle development during poultry growth, facilitating precise selection of superior breeds, and accelerating the breeding process.
[0097] The poultry breast muscle weight prediction device provided by the present invention is described below. The poultry breast muscle weight prediction device described below can be referred to in correspondence with the poultry breast muscle weight prediction method described above.
[0098] The poultry pectoral muscle weight prediction device provided by this invention refers to... Figure 8 As shown, it includes: The enhancement processing module 310 is used to enhance the digital X-ray images of poultry using an image enhancement network to obtain enhanced digital X-ray images. Image segmentation module 320 is used to segment the pectoral muscle region of the enhanced digital X-ray image using an image segmentation network to obtain pectoral muscle region information; The feature extraction module 330 is used to extract the geometric features of the pectoral muscle region based on the pectoral muscle region information; The weight prediction module 340 is used to input the geometric features into a trained machine learning model and output the predicted weight of the poultry's pectoral muscles.
[0099] Figure 9 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 9 As shown, the electronic device may include a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute the poultry pectoral muscle weight prediction method.
[0100] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0101] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the poultry pectoral muscle weight prediction method provided by the above methods.
[0102] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the poultry pectoral muscle weight prediction method provided by the above methods.
[0103] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0104] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting the weight of poultry pectoral muscles, characterized in that, include: An image enhancement network is used to enhance digital X-ray images of poultry, resulting in enhanced digital X-ray images. The enhanced digital X-ray image was segmented into poultry pectoral muscle regions using an image segmentation network to obtain poultry pectoral muscle region information. Based on the information about the poultry pectoral muscle region, the geometric features of the poultry pectoral muscle region are extracted; The geometric features are input into a trained machine learning model, which outputs a prediction of the weight of the poultry's pectoral muscles.
2. The method for predicting poultry pectoral muscle weight according to claim 1, characterized in that, The process of using an image enhancement network to enhance digital X-ray images of poultry to obtain enhanced digital X-ray images includes: The digitized X-ray images are input into an image enhancement model based on generative adversarial networks; The generator in the image enhancement model performs a mapping transformation on the digital X-ray image and outputs the enhanced digital X-ray image.
3. The method for predicting poultry pectoral muscle weight according to claim 1, characterized in that, The image enhancement model is trained through the following process: Obtain a training dataset, which contains real image pairs consisting of a first digital X-ray image and a second digital X-ray image; The generator and discriminator are trained by alternately executing a discriminator training phase and a generator training phase; wherein, in the discriminator training phase, the parameters of the generator are fixed and the parameters of the discriminator are updated; in the generator training phase, the parameters of the discriminator are fixed and the parameters of the generator are updated. After training, the generator in the image enhancement model is obtained.
4. The method for predicting poultry pectoral muscle weight according to claim 3, characterized in that, Updating the parameters of the discriminator includes: The first digitized X-ray image from the real image pair is input into the generator to obtain the generated image; The real image pair and the generated image pair consisting of the generated image and the first digital X-ray image are respectively input into the discriminator to obtain the corresponding discrimination results; The adversarial loss is calculated based on the discriminator's discrimination results for the real image pairs and the discrimination results for the generated image pairs, and the parameters of the discriminator are updated based on the adversarial loss; Update the parameters of the generator, including: The first digitized X-ray image from the real image pair is input into the generator to obtain the generated image; The real image pair and the generated image pair consisting of the generated image and the first digital X-ray image are respectively input into the discriminator to obtain the corresponding discrimination results; Based on the discriminator's discrimination results for the real image pairs and the discrimination results for the generated image pairs, the adversarial loss is determined; The difference loss is determined based on the pixel-level difference between the generated image and the second digitized X-ray image. The generator's total loss is determined based on the adversarial loss and the difference loss, and the generator's parameters are updated based on the total generator loss.
5. The method for predicting poultry pectoral muscle weight according to claim 1, characterized in that, The image segmentation network includes an encoder path and a decoder path; The encoder path contains multiple sequentially connected encoding blocks, each encoding block containing a multi-scale feature extraction and compression excitation module; except for the first encoding block, the remaining encoding blocks also contain downsampling layers, which are placed before the multi-scale feature extraction and compression excitation modules; the decoder path contains multiple sequentially connected decoding blocks, each decoding block containing an upsampling layer. The image segmentation network also includes multiple convolutional block attention modules that correspond one-to-one with the coding blocks; The step of segmenting the enhanced digital X-ray image into the poultry pectoral muscle region using an image segmentation network to obtain poultry pectoral muscle region information includes: The enhanced digital X-ray image is input into the encoder path; In the first coding block, the multi-scale feature extraction compression excitation module enhances the enhanced digital X-ray image to generate a first enhanced feature map; In subsequent coding blocks, the downsampling layer first downsamples the output features of the previous coding block, and the multi-scale feature extraction and compression excitation module then enhances the downsampled features to generate the enhanced feature map of the current coding block. The enhanced feature map generated by each coding block is provided as input to the next coding block and simultaneously transmitted to the corresponding convolutional block attention module; The feature map finally output by the encoder path is input into the decoder path; for each decoding block, the upsampling layer of the decoding block upsamples the input features, and then concatenates them with the enhanced feature map from the corresponding encoding block in the channel dimension to form a fused feature map. The convolutional block attention module weights the fused feature map in terms of spatial and channel dimensions and outputs the refined feature map of the decoding block. The refined feature map output from the end of the decoder path is passed through a prediction layer to generate a poultry pectoral muscle region segmentation mask as the poultry pectoral muscle region information.
6. The method for predicting poultry pectoral muscle weight according to claim 1, characterized in that, The geometric features include at least one of the following: area, perimeter, minimum circumscribed rectangle, circumscribed circle radius, circumscribed ellipse major axis, and circumscribed ellipse minor axis.
7. A poultry pectoral muscle weight prediction device, characterized in that, include: The enhancement processing module is used to enhance the digital X-ray images of poultry using an image enhancement network to obtain enhanced digital X-ray images; The image segmentation module is used to segment the poultry pectoral muscle region of the enhanced digital X-ray image using an image segmentation network to obtain poultry pectoral muscle region information. The feature extraction module is used to extract the geometric features of the poultry pectoral muscle region based on the poultry pectoral muscle region information; The weight prediction module is used to input the geometric features into a trained machine learning model and output the predicted weight of poultry breast muscles.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the poultry pectoral muscle weight prediction method as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the poultry pectoral muscle weight prediction method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the poultry pectoral muscle weight prediction method as described in any one of claims 1 to 6.