An automated method of measuring chicken body dimensions

CN120564229BActive Publication Date: 2026-09-11ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510708310.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2026-09-11
Estimated Expiration
2045-05-29

AI Technical Summary

Technical Problem

上述现有基于视觉的鸡体尺测量算法存在以下问题:(1)测量方式大多以侵入式为主易产生应激;(2)采集图像视角和测量指标单一,大多以测量胫长和胫围为主;(3)测量背景较为理想,都是在理想的背景条件下进行测量

Benefits of technology

[0067] The method of this invention includes, firstly, building a body size measurement platform using a multi-camera system. Secondly, constructing a high-performance model based on the improved YOLOv11n for background segmentation and object detection tasks. This model incorporates the SimRepCSP framework to reduce the number of parameters while stabilizing model accuracy. Thirdly, an SGE module is introduced at the end of the neck section to optimize feature distribution and enhance spatial information, and a C3k2-ContextGuided module is used in the detection head section to enhance multi-scale feature representation by combining local, surrounding, and global features. Finally, a body size measurement algorithm combining object detection boxes, image processing algorithms, and morphological features is designed. Experimental results show that the background segmentation and object detection model in this study outperforms other lightweight models in terms of both accuracy and model size. Measurement results for five body size parameters (tibia length, tibia circumference, chest width, chest circumference, and chest angle) show that the Pearson correlation coefficient (ρ) exceeds 0.9, and the single measurement time is significantly lower than that of manual measurement. Compared with existing body size measurement algorithms, this method has significant advantages in both measurement accuracy and the diversity of measurement indicators. In summary, the method proposed in this invention can comprehensively measure the body size of chickens in a non-invasive manner, which not only liberates labor but also provides strong support for the development of the breeding and farming industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120564229B_ABST
    Figure CN120564229B_ABST
Patent Text Reader

Abstract

This invention discloses an automated method for measuring the body size of chickens. The method includes: first, establishing a multi-camera system; second, constructing a high-performance model based on an improved YOLOv11n for both background segmentation and object detection tasks, which incorporates the SimRepCSP framework to reduce the number of parameters while stabilizing model accuracy; third, introducing an SGE module at the end of the neck region to optimize feature distribution and enhance spatial information, and using a C3k2-ContextGuided module in the detection head region to enhance multi-scale feature representation by combining local, surrounding, and global features; and finally, designing a body size measurement algorithm that combines object detection boxes, image processing algorithms, and morphological features. This invention enables comprehensive, non-invasive measurement of the body size of chickens in farms, liberating labor and providing strong support for the development of the poultry and breeding industries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of non-invasive poultry measurement technology, specifically to an automated method for measuring the body size of chickens. Background Technology

[0002] With population growth, poultry has become a major source of meat consumption, and the profitability of the poultry farming industry directly impacts poultry production. Measuring chicken body size is crucial for both poultry farming and breeding, as routine measurements are fundamental for assessing chicken health and selecting superior breeding stock. Traditional body size measurements require multiple people, are labor-intensive and inefficient, and can easily cause stress in chickens. While visual technology requires fewer personnel and is more efficient than traditional manual methods, these methods are often invasive, can easily cause stress in chickens, and offer limited measurement indicators. Therefore, designing a comprehensive and stress-free body size measurement algorithm based on visual technology is increasingly becoming a pressing need in the poultry farming industry.

[0003] Current methods for measuring chicken body size using visual technology mainly fall into two categories: traditional image processing and deep learning. In image processing, researchers have used ellipse fitting to locate chickens in a coop, followed by the Chan-Vese method to remove the head and tail. Finally, based on extracted back features, support vector regression (SVR) is used to predict back growth and weight. Researchers have also used comb morphology features combined with image segmentation and morphological features to measure the length and width of the comb. Furthermore, some researchers have used image processing techniques to measure the body size of other animals. For example, researchers have used image segmentation algorithms, Fuzzy c-means (FCM) clustering, and morphological features to measure the body size of sheep. Other researchers have used Kinect to capture images of pig backs and combined them with traditional image processing techniques to measure the pig's back body size and ultimately predict its weight. However, these body size measurement algorithms using single image processing techniques have low accuracy and require human intervention, which can easily cause stress.

[0004] Deep learning-based chicken body size measurement mainly falls into two categories. One is based on regression models to measure a single indicator. For example, researchers use ResNet networks to fuse RGB and thermal infrared images to measure chicken shank length. While this method offers high accuracy, it requires ideal backgrounds and a separate supplementary light source. It is invasive and uses a single measurement indicator. The other method is based on object detection models. This approach uses object detection models to detect key body size measurement areas and extracts measurement points based on morphological features. For instance, researchers photographed the shank of chickens hanging upside down on an experimental platform and used theYou Only Look Once v5 (YOLOv5) to detect the shank area, simultaneously measuring shank length and shank circumference based on the morphology of the chicken's neck. This method also requires ideal backgrounds and is invasive, easily triggering stress responses. Both deep learning-based body size measurement methods suffer from limited image acquisition perspectives, single measurement indicators, and stress.

[0005] Body size measurement based on object detection models offers a possibility for non-invasively and comprehensively measuring body size parameters in real-world contexts. However, this method requires both high-speed and high-accuracy background segmentation and object detection models. YOLO, proposed in 2015, treats object detection as a regression problem, employing a single convolutional neural network to simultaneously predict bounding boxes and probabilities across the entire image, simplifying the process and improving efficiency. YOLOv11, the latest version in the YOLO series, features significant improvements in its training architecture and methods, achieving new heights in accuracy, speed, and efficiency. It introduces Cross Stage Partial with kernelsize 2 (C3k2), Spatial Pyramid Pooling-Fast (SPPF), and Convolutional Block with Parallel Spatial Attention (C2PSA) modules, optimizing both the number of parameters and speed. It achieves better accuracy and speed than previous YOLO versions on multiple public datasets, including COCO, and also demonstrates impressive performance in object detection, object segmentation, and rotated object detection. Therefore, it is worthwhile to further explore the study of chicken body size using the latest YOLOv11 model series. The existing vision-based chicken body size measurement algorithms mentioned above have the following problems: (1) The measurement methods are mostly invasive and easily cause stress; (2) The image acquisition perspective and measurement indicators are single, and most of them are mainly for measuring tibia length and tibia circumference; (3) The measurement background is relatively ideal, and the measurement is carried out under ideal background conditions. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention proposes an automated method for measuring the size of a chicken's body.

[0007] A non-invasive method for measuring the multi-body size parameters of chickens based on a multi-view imaging system and YOLOv11n-SSC.

[0008] Includes the following steps:

[0009] 1) Build a multi-view imaging system to collect video data of chickens, extract RGB images and depth image data from three views and construct the corresponding dataset;

[0010] 2) A YOLOv11n-SSC model was constructed for background removal and key body size detection. Based on YOLOv11n, the model introduced the Simple Re-parameterization Cross Stage Partial (SimRepCSP) module to simplify the model structure and reduce the number of parameters. A Spatial Group-wise Enhancement (SGE) module was added to the end of the neck network to enhance spatial information representation. In the detection head network, the C3k2-ContextGuided (C3k2-CG) module, which integrates local, surrounding and global features, was used to achieve multi-scale feature optimization.

[0011] 3) Based on the YOLOv11n-SSC model, complex backgrounds in the video data are removed, and key body size parts of the chickens are detected;

[0012] 4) The key body parts of the chicken detected in step 3) are processed using image processing algorithms, including Gaussian filtering, threshold segmentation, and grabcut algorithm, to obtain the contour features of the key parts;

[0013] 5) Design and implement a body size measurement algorithm for chickens, measuring the chest width of chickens from the top view, the chest circumference and chest angle of chickens from the front view, and the shank length and shank circumference of chickens from the side view. The algorithm uses depth images to convert the coordinates of the measurement parts into real-world coordinates and calculates the body size parameters.

[0014] Step 1) The multi-view imaging system includes three depth cameras fixed to the top, front and side of the measurement platform, and is equipped with RFID reading and writing devices to identify the chickens. When the chickens walk into the area for image acquisition according to the set trajectory, the three depth cameras start to synchronously collect image data from three perspectives. The data acquisition time for each chicken is 300 seconds, and the data collected by each camera is named in a way that combines identity and perspective to facilitate subsequent data processing.

[0015] Step 1) Construct three datasets: one for background segmentation, one for key body size measurement region detection, and the last dataset for verifying the accuracy of the designed body size measurement algorithm.

[0016] 1) Background segmentation dataset: In order to accurately measure the size information of chickens, it is necessary to remove complex background information first. 600 RGB images from three perspectives were randomly selected as the background segmentation dataset. The ratio of training set, test set and verification set is 7:2:1. Labelme software was used for annotation.

[0017] 2) Measurement dataset of key body parts: Based on the trained background segmentation model, the next step is to detect key body parts. A total of 6680 RGB images from three perspectives were randomly selected for body part detection. After acquiring this data, the previously trained background segmentation model was used to remove background information. The annotation software used for object detection was Roboflow, with the training set, test set, and validation set divided in a ratio of 7:2:1.

[0018] 3) Body size measurement dataset: 1000 RGB images and corresponding depth images of chicken body size under ideal conditions (i.e., the back, chest and shins are relatively straight without curvature) from three perspectives were selected to test the accuracy of the body size measurement algorithm in this study.

[0019] In step 2), SimRepCSP is integrated into the backbone of the latest YOLOv11 model, reducing the number of model parameters while maintaining model accuracy. The backbone structure based on SimRepCSP includes a focal layer, multiple SimRepCSP modules, and an SPPF (Fast Spatial Pyramid Pooling) module. The YOLOv11 model integrating the SimRepCSP network structure transfers the output channels of the second, third, and fourth stages to P3, P4, and P5 of the backbone network, respectively, to promote multi-scale feature fusion and enhance the feature map representation capability of the backbone network. By reducing computational operations, optimizing parameter tuning, and minimizing memory requirements, SimRepCSP supports larger-scale batch processing of data and more efficient training, constructing a lightweight, easily deployable model without affecting performance.

[0020] In step 2), the SGE module is integrated into the Neck. It optimizes feature distribution and enhances spatial information by unifying attention across various semantic spaces and guiding local-to-global similarity. The SGE module structure originates from capsule networks. Deep learning networks need to capture specific responses during the learning process. Ideally, key locations should have strong responses while other locations should have no activation and become zero vectors. However, due to the influence of noise and similar patterns, traditional deep learning networks often struggle to obtain well-distributed feature responses. To address this issue, a proposal is made to utilize global information from the entire spatial group to enhance the learning of semantic features in key regions, but this requires ensuring that the features of the entire space are not dominated by noise. Therefore, a spatial averaging function F is used... gp The semantic vector learned by the model's feature vector set is approximated by statistical global features.

[0021]

[0022] Where g represents the global feature, F gp Let x represent the spatial average function. i represents a local feature, and m represents the number of local features.

[0023] Next, the global feature g is used to generate corresponding coefficients for each feature. These coefficients are obtained by the dot product of the global and local features, and they balance the performance of the global feature g and the local feature x. i The similarity between them.

[0024] c i =g·x i (2)

[0025] Where g represents the global feature, x i Indicates local features. i It can be interpreted as |g||x i |cos(θ i ),θ i It is g and x i The angle between the initial vectors indicates that a larger initial vector can obtain a larger initial feature coefficient, which is consistent with the assumption that this is true.

[0026] To prevent the coefficients from being too small in different samples, a standard normalization operation is required, which is used in similar studies.

[0027]

[0028] in Represents the normalization coefficient, ∈ represents a constant, c i μ represents the local characteristic coefficient. c Representative coefficient c j The average value, where m represents the number of local characteristic coefficients. Represents the local characteristic coefficient c j The variance, c j This represents the coefficient c. i .

[0029] To ensure that the normalized coefficients inserted into the network can represent the identity transformation, for each normalized coefficient... A pair of parameters γ and β are introduced to scale and offset the normalized values.

[0030]

[0031] γ and β are the only parameters introduced in the module. In a single SGE module, γ and β are the same as G (the number of times the convolutional feature map is divided along the channel dimension), and the values ​​are usually 32 or 64.

[0032] Finally, in order to obtain the enhanced feature vector The original feature vector x i It will generate an importance coefficient a i After scaling and passing through a sigmoid gate (σ), the feature set formed by all the enhanced features is as follows.

[0033]

[0034] Where χ is the enhanced feature vector, a i x represents the importance coefficient of the original feature generation. i σ is the original feature vector, σ is the sigmoid function gate unit, C represents the number of channels of the feature, G represents the number of groups for each feature, m is the total number of elements in the feature groups, H and W are the height and width of the feature map, and R represents the reshaping and broadcasting operation.

[0035] In step 2), the C3k2-CG module is integrated into the Neck. The C3k2-CG module consists of two modules: C3k2 and CG, meaning it includes a cascaded C3k2 module and a ContextGuided module. The C3k2 module, a new module proposed in YOLOv11, reduces computational cost and enhances feature extraction capabilities by using two smaller convolutions instead of a large one. The addition of the CG module to C3k2 further improves the model's ability to represent multi-scale features.

[0036] Step 4) Based on the back target detection box, determine the four vertices on the contour and label them A, B, C, and D counterclockwise. The selection of the upper left vertex is based on selecting the vertex closest to the upper boundary of the target detection box in the contour within the back target detection box, and the selection of other vertices (lower left vertex, lower right vertex, upper right vertex) is similar. Next, calculate the distance curve from contour segment AB to contour DC. The point where the distance curve reaches its first maximum value is marked as b1 and b2, corresponding to the chest width measurement point. This point is then mapped to the original depth map and labeled as b11 and b22. Note that due to errors in data processing when labeling the depth map measurement points, b1 and b2 need to be directly mapped to points on the depth image and then their closest points to the contour are found and labeled as b11 and b22. Finally, the coordinates of the depth image are transformed into the real world based on the intrinsic parameters obtained from the depth camera. This study uses an automatically calibrated camera, so the intrinsic parameters can be obtained directly. By solving for the coordinates of the two points b11 and b22 in the real world and taking the length of the line segment from these two points, the chest width can be represented.

[0037] b1,b2=argmax d(y) (y∈Y) (7)

[0038] Where b1 and b2 represent the points on the contour corresponding to the first maximum value of the distance curve. d(y) represents the curve of distance from contour AB to contour DC as a function of y, and arg max d(y) represents the function for obtaining the maximum value.

[0039]

[0040] Where BW represents chest width, u1 and v1, u2 and v2 represent the horizontal and vertical coordinates of two pixels on the depth image, Z1 and Z2 represent the depth value of that pixel, and f x and f y c represents the focal length along the horizontal and vertical axes, respectively. x and c y These represent the x and y coordinates of the center point of the phase plane coordinate system, respectively.

[0041] Step 4) Frontal View Body Scale Measurement (Chest Circumference and Chest Angle): First, select four vertices of the contour within the chest target detection box and label them counterclockwise with letters A, B, C, and D. The selection strategy for the four vertices is the same as for the top view. Next, calculate the distance curve from contour segment AB to contour segment DC. Observe that the point where this distance curve reaches its maximum value is the body scale measurement point corresponding to the chest circumference and chest angle, labeled T1 and T2 respectively. Map this point to the original depth map and label it T11 and T22. The processing method for the body scale measurement points on the chest image after mapping to the relevant depth map is the same as for the back. Take the midpoint of depth maps T11 and T22 and label it T33 as the chest angle vertex. Finally, based on the intrinsic parameters obtained from the depth camera, transform the coordinates of the depth images T11, T22, and T33 to the real world. The chest circumference is represented by the circumference of the circle with T11 and T22 as its diameter. T11T33T22 The size of this angle is called the thoracic angle (BA).

[0042]

[0043] Where K represents the camera's intrinsic parameter matrix, points (x1,y1,z1), (x2,y2,z2) and (x3,y3,z3) represent the original coordinates of the depth image, points (X1,Y1,Z1), (X2,Y2,Z2) and (X3,Y3,Z3) represent the real-world coordinates after transformation by the camera's intrinsic parameters, BC represents the chest circumference, and BA represents the chest angle.

[0044] Step 4) Side view body size (shin length and shin circumference) measurement: Based on the chicken foot contour obtained by the previous target detection box, extract its horizontal minimum bounding moment

[32] and mark its vertices as A1, B1, C1, and D1 counterclockwise. Then, according to the obtained horizontal minimum bounding moment, mark the four vertices of the contour as A, B, C, and D counterclockwise. The selection of the upper left vertex is to select the vertex closest to the upper boundary of the horizontal bounding moment among the vertices of the contour, and select the vertex closest to the left border of the horizontal bounding moment. The selection of other vertices (lower left vertex, upper right vertex, lower right vertex) is similar. Obtain the distance curve from the contour DC to the horizontal minimum bounding moment border D1C1. When the curve reaches the first minimum value, the vertex is the body size measurement point J3 for the shin length. Secondly, the body size measurement point for the shin circumference is to divide the upper and lower parts of the horizontal minimum bounding moment. Observation of the shin images collected on site shows that the dividing line of the upper and lower parts of the horizontal minimum bounding moment into the interval ratio of 5:7 to 7:5 can be used as the dividing line for obtaining the body size measurement point for the shin circumference. This study uses a 5:7 time division line to obtain body scale measurement points for tibial circumference. This line intersects the middle of the tibial region on both sides, J1 and J2 respectively. Simultaneously, the tibial length is vertically mapped from J3 to the lower boundary point of the horizontal circumscribed moment, labeled J4. Finally, J1, J2, J3, and J4 are mapped to the depth map. The tibial body scale measurement points are mapped to the original depth map using the same method as the top view, with optimized vertices labeled J11, J22, J33, and J44 respectively. Finally, based on the acquired camera intrinsic parameters, the coordinates of the corresponding points on the depth image are transformed to the real world. The tibial length is represented by the distance from J33 to J44, and the tibial circumference is represented by the circumference of the circle with these two points as diameters, corresponding to the transformed coordinates J11 and J22.

[0045]

[0046] Where SL represents tibia length, SC represents tibia circumference, (x J11 ,y J11 ), (x J22 ,y J22 ),(x J33 ,y J33 ), (x J44 ,y J44 ) represent the pixel coordinates of four points in the depth image. Z J11 Z J22 Z J33 Z J44 , representing the pixel values ​​of the corresponding points in the depth image, f x and f y c represents the focal length along the horizontal and vertical axes, respectively. x and c y These represent the x and y coordinates of the center point of the phase plane coordinate system, respectively.

[0047] Further optimization reveals that a non-invasive method for measuring the multi-body size parameters of chickens based on a multi-view imaging system and YOLOv11n-SSC is crucial for constructing a high-precision background segmentation and target detection framework, which mainly includes the following steps:

[0048] To address the challenges of comprehensively measuring chicken body size in daily poultry farming, and the fact that existing methods are mostly invasive and offer limited measurement metrics, this study designs a non-invasive method for measuring multiple chicken body size parameters based on a multi-view imaging system. This method consists of several steps: First, RGB and depth maps from three perspectives are extracted from video data acquired by the multi-view imaging system. Second, a background removal and key body size detection model based on YOLOv11n-SSC is used, which is an improvement upon the latest YOLOv11n framework. This model improves upon the latest YOLOv11n framework by introducing the SimRepCSP module into the backbone network to simplify and integrate CSP and RepConv, significantly reducing the number of parameters and improving inference speed. Third, an SGE module is added to the neck network terminal, using global average pooling, grouped convolution, and adaptive activation functions to optimize feature distribution and enhance spatial information, improving detail capture and detection capabilities in complex environments. Finally, in the head network, the existing C3k2 module is replaced with a fusion-type C3k2-CG module, which enhances multi-scale feature representation by combining local, surrounding, and global features. The synergistic effect of the three modules enables YOLOv11n-SSC to achieve excellent performance in background removal and key feature detection. The only difference between the two models lies in the final head task and output. Finally, a body size measurement algorithm based on body size key feature detection boxes, morphological features, and image processing techniques is presented.

[0049] Based on the SimRepCSP backbone structure, SimRepCSP is integrated into the backbone of the latest YOLOv11 model, reducing the number of model parameters while maintaining model accuracy. The SimRepCSP-based backbone structure includes a focal layer, multiple SimRepCSP modules, and an SPPF (Fast Spatial Pyramid Pooling) module. The YOLOv11 model integrating the SimRepCSP network structure transfers the output channels of the second, third, and fourth stages to P3, P4, and P5 of the backbone network, respectively, to promote multi-scale feature fusion and enhance the feature map representation capability of the backbone network. SimRepCSP supports larger-scale batch processing and more efficient training by reducing computational operations, optimizing parameter tuning, and minimizing memory requirements, resulting in a lightweight, easily deployable model without compromising performance.

[0050] Neck, based on the SGE module, optimizes feature distribution and enhances spatial information by unifying attention across various semantic spaces and guiding local-to-global similarity. The SGE module structure originates from capsule networks, and deep learning networks need to capture specific responses during the learning process. Ideally, key locations should have strong responses while other locations should have zero activation. However, due to noise and similarity patterns, traditional deep learning networks often struggle to obtain well-distributed feature responses. To address this issue, this paper proposes leveraging global information from the entire spatial group to enhance the learning of semantic features in key regions, provided that the features across the entire space are not dominated by noise. Therefore, a spatial averaging function F is used... gp The semantic vector learned by the model's feature vector set is approximated by statistical global features.

[0051]

[0052] Where g represents the global feature, F gp Let x represent the spatial average function. i represents a local feature, and m represents the number of local features.

[0053] Next, the global feature g is used to generate corresponding coefficients for each feature. These coefficients are obtained by the dot product of the global and local features, and they balance the performance of the global feature g and the local feature x. i The similarity between them.

[0054] c i =g·x i (2)

[0055] Where g represents the global feature, x i Indicates local features. i It can be interpreted as |g||x i |cos(θ i ),θ i It is g and x i The angle between the initial vectors indicates that a larger initial vector can obtain a larger initial feature coefficient, which is consistent with the assumption that this is true.

[0056] To prevent the coefficients from being too small in different samples, a standard normalization operation is required, which is used in similar studies.

[0057]

[0058] in Represents the normalization coefficient, ∈ represents a constant, c i μ represents the local characteristic coefficient. c Representative coefficient c j The average value, where m represents the number of local characteristic coefficients. Represents the local characteristic coefficient c j The variance, c j This represents the coefficient c. i .

[0059] To ensure that the normalized coefficients inserted into the network can represent the identity transformation, for each normalized coefficient... A pair of parameters γ and β are introduced to scale and offset the normalized values.

[0060]

[0061] γ and β are the only parameters introduced in the module. In a single SGE module, γ and β are the same as G (the number of times the convolutional feature map is divided along the channel dimension), and the values ​​are usually 32 or 64.

[0062] Finally, in order to obtain the enhanced feature vector The original feature vector x i It will generate an importance coefficient a i After scaling and passing through a sigmoid gate (σ), the feature set formed by all the enhanced features is as follows.

[0063]

[0064] Where x i Let a be the original feature vector. i The original feature generation is represented by the importance coefficient, σ is the sigmoid function gate unit, C represents the number of feature channels, G represents the number of groups for each feature, m is the total number of elements in the feature groups, H and W are the height and width of the feature map, and R represents the reshaping and broadcasting operations.

[0065] Neck is based on the C3k2-CG module, which consists of two modules: C3k2 and CG. The C3k2 module, a new module proposed in YOLOv11, reduces computational cost and enhances feature extraction capabilities by using two smaller convolutions instead of one large convolution. The CG module further enhances the model's multi-scale feature representation capabilities by adding the CG module to C3k2. The CG module fully utilizes local, surrounding, and global contextual information. This module consists of a local feature extractor f... loc , surrounding context extractor f sur Joint feature extractor f joi and global context extractor f glo Composition. The CG module mainly consists of two steps. The first step is to use f respectively. loc and f sur To learn local and surrounding contextual information. In the model, floc A 3x3 convolutional layer is instantiated to learn features from 8 neighboring feature vectors. sur It is instantiated as a 3×3 dilated / attracted convolutional layer because dilated / attracted convolutions have a relatively large receptive field, allowing them to efficiently learn the surrounding context. joi The function is from f loc and f sur The joint features are obtained from the output of f, so f joi The design is as a stitching layer, followed by batch normalization (BN) and parameterized ReLU (PReLU) operations. The second step uses f... glo Global context information is extracted to improve the extracted joint features. Influenced by the SENet structure, global context is used as a weighted vector to refine joint features at the channel level, emphasizing useful components and suppressing useless ones. In the model, f glo It is instantiated as a global average pooling layer, followed by a multilayer perceptron to further extract global contextual information. Finally, a scale layer is used to reweight the joint features using global contextual information. It is important to note that f... glo The optimization operation is adaptively adjusted for the input image because the extracted global context information is generated from the input image.

[0066] Compared with the prior art, the present invention has the following advantages:

[0067] The method of this invention includes, firstly, building a body size measurement platform using a multi-camera system. Secondly, constructing a high-performance model based on the improved YOLOv11n for background segmentation and object detection tasks. This model incorporates the SimRepCSP framework to reduce the number of parameters while stabilizing model accuracy. Thirdly, an SGE module is introduced at the end of the neck section to optimize feature distribution and enhance spatial information, and a C3k2-ContextGuided module is used in the detection head section to enhance multi-scale feature representation by combining local, surrounding, and global features. Finally, a body size measurement algorithm combining object detection boxes, image processing algorithms, and morphological features is designed. Experimental results show that the background segmentation and object detection model in this study outperforms other lightweight models in terms of both accuracy and model size. Measurement results for five body size parameters (tibia length, tibia circumference, chest width, chest circumference, and chest angle) show that the Pearson correlation coefficient (ρ) exceeds 0.9, and the single measurement time is significantly lower than that of manual measurement. Compared with existing body size measurement algorithms, this method has significant advantages in both measurement accuracy and the diversity of measurement indicators. In summary, the method proposed in this invention can comprehensively measure the body size of chickens in a non-invasive manner, which not only liberates labor but also provides strong support for the development of the breeding and farming industry. Attached Figure Description

[0068] Figure 1 This is a diagram of the overall framework of the YOLOv11n-SSC model in a specific embodiment of the present invention;

[0069] Figure 2 This is a diagram of the SimRepCSP network structure in a specific embodiment of the present invention;

[0070] Figure 3 This is the SGE module structure in a specific embodiment of the present invention;

[0071] Figure 4 This is a flowchart of the C3k2-CG module in a specific embodiment of the present invention;

[0072] Figure 5 This is a schematic diagram of the body size measurement algorithm in a specific embodiment of the present invention;

[0073] Figure 6 This is a specific measurement example diagram of the present invention. Detailed Implementation

[0074] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0075] The YOLOv11n-SSC background culling and critical volumetric region detection model of the present invention is based on the latest series of YOLOv11n frameworks and is improved therefrom. Its structure is as follows: Figure 1 As shown, this model improves upon the latest YOLOv11n framework by introducing the SimRepCSP module into the backbone network to simplify and integrate CSP and RepConv, significantly reducing the number of parameters and improving inference speed. Secondly, an SGE module is added to the neck network, optimizing feature distribution and enhancing spatial information through global average pooling, grouped convolution, and adaptive activation functions, thus improving detail capture and detection capabilities in complex environments. Finally, in the head network, the existing C3k2 module is replaced with a fusion-type C3k2-CG module, which enhances multi-scale feature representation by combining local, surrounding, and global features. The synergistic effect of these three modules enables YOLOv11n-SSC to achieve excellent performance in background removal and key feature detection; the only difference between the two models lies in the final head task and output. Finally, a body size measurement algorithm based on body size key feature detection boxes, morphological features, and image processing techniques is presented.

[0076] The backbone is based on SimRepCSP, an integrated standard convolutional module consisting of three convolutional modules, one RepConv module, and one concatenation module. The SimRepCSP module structure is as follows: Figure 2As shown. Each module contains a batch normalization layer and applies the SiLU activation function. The module input is the output of the previous module. The first convolutional module in this module uses a 3x3 kernel with a stride of 1. The output of this module is twice the input, thus increasing the number of filters in the module. The second convolutional module uses a 1x1 kernel with a stride of 1. The output of this module is halved before being passed to subsequent modules. The third module is RepConv, which, similar to YOLOv7, can efficiently utilize parameters to improve model performance. Its output is concatenated with the output of the second convolutional module in the contact module and then passed to the last convolutional module. The structure of the last convolutional module in the module is similar to that of the second convolutional module, but the number of inputs and outputs remains the same. By default, our module parameter settings are the same as those in the PyTorch framework, which ensures compatibility and consistency with the existing framework and facilitates its implementation and use. This invention integrates SimRepCSP into the latest YOLOv11 model backbone, reducing the number of model parameters while maintaining model accuracy. The SimRepCSP-based backbone structure comprises a focal layer, multiple SimRepCSP modules, and an SPPF (Fast Spatial Pyramid Pooling) module. YOLOv11 models integrating the SimRepCSP network structure transfer the output channels of the second, third, and fourth stages to P3, P4, and P5 of the backbone network, respectively, to promote multi-scale feature fusion and enhance the feature map representation capabilities of the backbone network. SimRepCSP supports larger-scale batch processing and more efficient training by reducing computational operations, optimizing parameter tuning, and minimizing memory requirements, resulting in a lightweight, easily deployable model without compromising performance. Overall, SimRepCSP further improves the efficiency and performance of YOLOv11 models by optimizing network architecture, reducing computational and memory costs, and enhancing feature extraction.

[0077] Neck, based on the SGE module, optimizes feature distribution and enhances spatial information by unifying attention across various semantic spaces and guiding local-to-global similarity. The SGE module structure originates from capsule networks, and its structure is as follows: Figure 3 As shown. Deep learning networks need to capture specific responses during the learning process. Ideally, key locations should have strong responses while other locations should have no activation and become zero vectors. However, due to the influence of noise and similar patterns, traditional deep learning networks often struggle to obtain well-distributed feature responses. To address this issue, a proposal is made to leverage global information from the entire spatial group to enhance the learning of semantic features in key regions, but this requires ensuring that the features of the entire space are not dominated by noise. Therefore, a spatial averaging function F is used... gp The semantic vector learned by the model's feature vector set is approximated by statistical global features.

[0078]

[0079] Where g represents the global feature, F gp Let x represent the spatial average function. i represents a local feature, and m represents the number of local features.

[0080] Next, the global feature g is used to generate corresponding coefficients for each feature. These coefficients are obtained by the dot product of the global and local features, and they balance the performance of the global feature g and the local feature x. i The similarity between them.

[0081] c i =g·x i (2)

[0082] Where g represents the global feature, x i Indicates local features. i It can be interpreted as |g||x i |cos(θ i ),θ i It is g and x i The angle between the initial vectors indicates that a larger initial vector can obtain a larger initial feature coefficient, which is consistent with the assumption that this is true.

[0083] To prevent the coefficients from being too small in different samples, a standard normalization operation is required, which is used in similar studies.

[0084]

[0085] in Represents the normalization coefficient, ∈ represents a constant, c i μ represents the local characteristic coefficient. c Representative coefficient c j The average value, where m represents the number of local characteristic coefficients. Represents the local characteristic coefficient c j The variance, c j This represents the coefficient c. i .

[0086] To ensure that the normalized coefficients inserted into the network can represent the identity transformation, for each normalized coefficient... A pair of parameters γ and β are introduced to scale and offset the normalized values.

[0087]

[0088] γ and β are the only parameters introduced in the module. In a single SGE module, γ and β are the same as G (the number of times the convolutional feature map is divided along the channel dimension), and the values ​​are usually 32 or 64.

[0089] Finally, in order to obtain the enhanced feature vector The original feature vector x i It will generate an importance coefficient a i After scaling and passing through a sigmoid gate (σ), the feature set formed by all the enhanced features is as follows.

[0090]

[0091] Where x i Let a be the original feature vector. i The original feature generation is represented by the importance coefficient, σ is the sigmoid function gate unit, C represents the number of feature channels, G represents the number of groups for each feature, m is the total number of elements in the feature groups, H and W are the height and width of the feature map, and R represents the reshaping and broadcasting operations.

[0092] The head is based on the C3k2-CG module, which consists of two modules: C3k2 and CG. The module flow diagram is as follows: Figure 4 As shown. The C3k2 module, a new module proposed in YOLOv11, reduces computational cost and enhances feature extraction capabilities by using two smaller convolutions instead of a large one. We added the CG module to C3k2 to further improve the model's multi-scale feature representation ability. The CG module relies on the contextual information of the human visual system to understand the scene. For example, if a human tries to identify a yellow area, focusing solely on the yellow area makes identification difficult. If the red area is defined as the surrounding context of the yellow area, acquiring information about its surroundings while focusing on the yellow area makes it easier to identify the target region. Humans expand the scene captured by their visual system to include global contextual information (purple area) and the yellow area and its surrounding context (red area), resulting in higher confidence in identifying the yellow area. Therefore, both surrounding and global contextual information improve the accuracy of object recognition. Based on this, the CG module was introduced to fully utilize local, surrounding, and global contextual information. This module consists of a local feature extractor f... loc , surrounding context extractor f sur Joint feature extractor f joi and global context extractor f glo Composition. The CG module mainly consists of two steps. The first step is to use f respectively. loc and f sur To learn local and surrounding contextual information. In the model, f locA 3x3 convolutional layer is instantiated to learn features from 8 neighboring feature vectors. sur It is instantiated as a 3×3 dilated / attracted convolutional layer because dilated / attracted convolutions have a relatively large receptive field, allowing them to efficiently learn the surrounding context. joi The function is from f loc and f sur The joint features are obtained from the output of f, so f joi The design is as a stitching layer, followed by batch normalization (BN) and parameterized ReLU (PReLU) operations. The second step uses f... glo Global context information is extracted to improve the extracted joint features. Influenced by the SENet structure, global context is used as a weighted vector to refine joint features at the channel level, emphasizing useful components and suppressing useless ones. In the model, f glo The joint features are instantiated as a global average pooling layer, followed by a multilayer perceptron to further extract global contextual information. Finally, a scaling layer is applied to reweight the joint features using global contextual information. It is important to note that f... glo The optimization operations are adaptively adjusted for the input image because the extracted global context information is generated from the input image. Furthermore, the CG module also employs residual learning, which helps the model learn highly complex features and improves gradient backpropagation during training.

[0093] Top-view body size measurement (chest width): Based on the back target detection box, determine the four vertices on the contour and label them A, B, C, and D counterclockwise. The selection of the upper left vertex is based on the vertex closest to the upper boundary of the target detection box in the contour within the back target detection box, choosing the vertex closest to the left boundary of the target detection box. The selection of other vertices (lower left vertex, lower right vertex, upper right vertex) is similar. Next, calculate the distance curve from contour segment AB to contour DC. The point where the distance curve reaches its first maximum value is marked as the body size measurement point corresponding to the chest width, labeled as b1 and b2 respectively. This point is then mapped to the original depth map and labeled as b11 and b22. It should be noted that due to the error in data processing when labeling the body size measurement points in the depth map, b1 and b2 need to be directly mapped to points on the depth image and then their closest points to the contour are found and labeled as b11 and b22. Finally, the coordinates of the depth image are transformed into the real world based on the intrinsic parameters obtained from the depth camera. This study uses an automatically calibrated camera, so the intrinsic parameters can be directly obtained. The chest width is represented by solving for the coordinates of points b11 and b22 in the real world and using these two points as the length of a line segment. The body measurement results are as follows: Figure 5 As shown.

[0094] b1,b2=argmax d(y) (y∈Y) (7)

[0095] Where b1 and b2 represent the points on the contour corresponding to the first maximum value of the distance curve. d(y) represents the curve of distance from contour AB to contour DC as a function of y, and arg max d(y) represents the function for obtaining the maximum value.

[0096]

[0097] Where BW represents chest width, u1 and v1, u2 and v2 represent the horizontal and vertical coordinates of two pixels on the depth image, Z1 and Z2 represent the depth value of that pixel, and f x and f y c represents the focal length along the horizontal and vertical axes, respectively. x and c y These represent the x and y coordinates of the center point of the phase plane coordinate system, respectively.

[0098] Body size measurement from a frontal view (chest circumference and chest angle): First, select four vertices of the contour within the chest target detection box and label them counterclockwise with letters A, B, C, and D. The selection strategy for these four vertices is the same as for top view. Next, calculate the distance curve from contour segment AB to contour segment DC. Observe that the point where this distance curve reaches its maximum value is the body size measurement point corresponding to the chest circumference and chest angle, labeled T1 and T2 respectively. Map this point to the original depth map and label it T11 and T22. The processing method for the body size measurement points on the chest image after mapping to the relevant depth map is the same as for the back. Take the midpoint of depth maps T11 and T22 and label it T33 as the chest angle vertex. Finally, based on the intrinsic parameters obtained from the depth camera, transform the coordinates of the depth images T11, T22, and T33 to the real world. The chest circumference is represented by the circumference of the circle with T11 and T22 as its diameter. T11T33T22 The size is called the thoracic angle (BA), and the body size measurement results are as follows: Figure 5 As shown.

[0099]

[0100] Where K represents the camera's intrinsic parameter matrix, points (x1,y1,z1), (x2,y2,z2) and (x3,y3,z3) represent the original coordinates of the depth image, points (X1,Y1,Z1), (X2,Y2,Z2) and (X3,Y3,Z3) represent the real-world coordinates after transformation by the camera's intrinsic parameters, BC represents the chest circumference, and BA represents the chest angle.

[0101] Side-view body size (shin length and shin circumference) measurement: Based on the chicken foot contour obtained by the previous target detection box, its horizontal minimum bounding moment

[32] is extracted and its vertices are marked counterclockwise as A1, B1, C1, D1. Then, according to the obtained horizontal minimum bounding moment, the four vertices of the contour are marked counterclockwise as A, B, C, D. The selection of the upper left vertex is to select the vertex closest to the upper boundary of the horizontal bounding moment among the vertices of the contour, and the selection of other vertices (lower left vertex, upper right vertex, lower right vertex) is similar. Obtain the distance curve from the contour DC to the horizontal minimum bounding moment border D1C1. When the curve reaches the first minimum value, the vertex is the body size measurement point J3 of the shin length. Secondly, the body size measurement point of the shin circumference is to divide the upper and lower parts of the horizontal minimum bounding moment. Observation of the shin images collected on site shows that the dividing line of the upper and lower parts of the horizontal minimum bounding moment into the interval ratio of 5:7 to 7:5 can be used as the dividing line for obtaining the body size measurement point of the shin circumference. This study uses a 5:7 time division line to obtain body measurement points for tibial circumference. This line intersects the middle of the tibial region on both sides, J1 and J2 respectively. Simultaneously, the tibial length is vertically mapped from J3 to the lower boundary point of the horizontal circumscribed moment, labeled J4. Finally, J1, J2, J3, and J4 are mapped to the depth map. The processing method for mapping the tibial body measurement points to the original depth map is the same as for the top view. After vertex optimization, they are labeled J11, J22, J33, and J44 respectively. Finally, based on the acquired camera intrinsic parameters, the coordinates of the corresponding points on the depth image are transformed to the real world. The distance from J33 to J44 represents the tibial length, and the circumference is represented by the circumference of the circle with these two points as diameters. The body measurement process is as follows: Figure 5 As shown, the measurement results are as follows: Figure 6 As shown.

[0102]

[0103] Where SL represents tibia length, SC represents tibia circumference, (x J11 ,y J11 ), (x J22 ,y J22 ),(x J33 ,y J33 ), (x J44 ,y J44 ) represent the pixel coordinates of four points in the depth image. Z J11 Z J22 Z J33 Z J44 , representing the pixel values ​​of the corresponding points in the depth image, f x and f y c represents the focal length along the horizontal and vertical axes, respectively. x and c y These represent the x and y coordinates of the center point of the phase plane coordinate system, respectively.

Claims

1. An automated method for measuring the size of a chicken's body, characterized in that, Includes the following steps: 1) Build a multi-view imaging system to collect chicken video data, extract RGB images from three perspectives from the chicken video data, and construct an RGB image dataset; 2) Construct a YOLOv11n-SSC model for background removal and key body size detection. The YOLOv11n-SSC model is based on YOLOv11n and introduces the Simple Re-parameterization Cross Stage Partial module. The backbone structure based on SimRepCSP includes a focal layer, multiple SimRepCSP modules and an SPPF module. A Spatial Group-wise Enhance module is added at the end of the neck network. The C3k2-ContextGuided module, which integrates local, surrounding and global features, is used in the detection head network. The C3k2-ContextGuided module that integrates local, surrounding, and global features includes: a C3k2 module and a ContextGuided module connected in series; 3) The YOLOv11n-SSC model was trained using an RGB image dataset. After training, the YOLOv11n-SSC model was used to remove complex backgrounds from the RGB images to be detected and to detect key body size parts of chickens. 4) Using the key body size parts of the chicken detected in step 3), image processing algorithms are applied to process the key body size parts to obtain their contour features; 5) Design and implement a chicken body size measurement algorithm. Measure the chicken's chest width from a top view, chest circumference and breast angle from a frontal view, and shank length and shank circumference from a side view. Use depth images to convert the coordinates of the measurement areas into real-world coordinates and calculate the body size parameters. Based on the contour features of key areas, determine the key areas. If the key area is the chicken's back, calculate the chicken's chest width using the depth image associated with the RGB image to be detected; if the key area is the chicken's chest, calculate the chicken's chest circumference and breast angle using the depth image associated with the RGB image to be detected; if the key area is the chicken's shank, calculate the chicken's shank length and shank circumference using the depth image associated with the RGB image to be detected. Finally, obtain the chicken's true body size parameters.

2. The automated measurement method for chicken body size according to claim 1, characterized in that, In step 4), image processing algorithms are used for processing, specifically including: Gaussian filtering, threshold segmentation, and the Grabcut algorithm.

3. The automated measurement method for chicken body size according to claim 1, characterized in that, In step 5), if the key area is the chicken's back, the chicken's chest width is calculated by combining the depth image related to the RGB image to be detected. Specifically, this includes: (8) Where BW represents chest width, u1 and v 1、 u2 and v2 represent the horizontal and vertical coordinates of two pixels in the depth image, respectively, Z1 and Z2 represent the depth values ​​of the two pixels, and f x and f y c represents the focal length of the camera along the horizontal and vertical axes, respectively. x and c y These represent the x and y coordinates of the center point of the phase plane coordinate system, respectively.

4. The automated measurement method for chicken body size according to claim 1, characterized in that, In step 5), if the key area is the chicken's chest, the chicken's chest circumference and chest angle are calculated by combining the depth image related to the RGB image to be detected. Specifically, this includes: , (9) (10) (11) Where K represents the camera's intrinsic parameter matrix, points (x1, y1, z1), (x2, y2, z2) and (x3, y3, z3) represent the original coordinates of the depth image, points (X1, Y1, Z1), (X2, Y2, Z2) and (X3, Y3, Z3) represent the real-world coordinates after transformation by the camera's intrinsic parameters, BC represents the chest circumference, and BA represents the chest angle.

5. The automated measurement method for chicken body size according to claim 1, characterized in that, In step 5), if the key area is the chicken's shank, the shank length and shank circumference are calculated by combining the depth image associated with the RGB image to be detected. Specifically, this includes: (12) (13) Where SL represents tibia length, SC represents tibia circumference, (x J11 ,y J11 ), (x J22 ,y J22 ), (x J33 ,y J33 ), (x J44 ,y J44 The numbers ) represent the pixel coordinates of four points in the depth image, Z and Z. J11 Z J22 Z J33 Z J44 f represents the depth value of the corresponding point in the depth image. x and f y c represents the focal length of the camera along the horizontal and vertical axes, respectively. x and c y These represent the x and y coordinates of the center point of the phase plane coordinate system, respectively.

Citation Information

Patent Citations

  • Livestock body size measuring method and device, electronic equipment and storage medium

    CN117670974A

  • Non-contact livestock body size measuring method and electronic equipment

    CN118196175A