Poultry counting method based on deep learning

By optimizing the chick counting method using deep learning and multi-object tracking algorithms, the problems of low counting accuracy and slow processing speed in existing technologies are solved, enabling accurate counting and high-speed processing of high-density chicks, which is suitable for chick counting in large-scale hatcheries.

CN121505658APending Publication Date: 2026-02-10QINGDAO XINGYI ELECTRONIC EQUIP CO LTD

Patent Information

Application Number
CN202511576759.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-31
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing technologies for counting poultry chicks suffer from low accuracy, high computational load, and difficulty in meeting the real-time processing requirements of high-density production lines, especially when identifying chicks that are stuck together or side by side.

Method used

A deep learning-based chick counting method is adopted. Images are acquired and preprocessed through a hardware platform, and a chick detection system based on the YOLO architecture is used to achieve target detection, tracking and counting. Multi-target tracking algorithm and dynamic anchor box clustering algorithm are used to adapt to changes in chick morphology. Kalman filtering and improved matching strategy are combined to optimize the chick counting algorithm.

Benefits of technology

It achieves accurate counting and high-speed real-time processing of chicks in high-density scenarios, improves counting accuracy, and can accurately identify chicks that are side by side or stacked, meeting the counting needs of large-scale hatcheries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121505658A_ABST
    Figure CN121505658A_ABST
Patent Text Reader

Abstract

The invention discloses a young poultry counting method based on deep learning, and relates to the field of image processing, and the method comprises the steps: information collection and feature extraction: collecting a young poultry image through a hardware platform, and carrying out the preprocessing of the image, and obtaining a continuous color image of a target image; data annotation: carrying out label annotation on the preprocessed image, carrying out accurate target detection annotation on stacked young poultry in the image to obtain an annotated data set, and providing a high-quality data set for model training; inputting the collected real-time image into a young poultry detection system constructed based on a YOLO architecture, wherein the system is used for performing target detection, target tracking and target counting on the input image; and multi-target tracking: continuously positioning spatial positions of a plurality of targets through frame-by-frame analysis of the video sequence, and maintaining a unique identity (ID) of each target. Precise counting and high-speed real-time processing of the young poultry in a high-density scene are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a deep learning-based method for counting poultry chicks. Background Technology

[0002] In the artificial incubation and breeding industry, counting chicks is a crucial step. Farms need to count the number of chicks hatched each day and calculate the hatching rate. Many farms hatch chicks for sale, requiring precise counting. Currently, most chicks are still counted manually, which is inefficient and prone to subjective errors.

[0003] With the standardization, conglomeration, and large-scale development of the poultry industry, the daily number of chicks hatched at hatcheries is constantly increasing, and the speed at which workers manually handle them cannot meet the demand. Moreover, the cost and difficulty of recruiting workers for hatcheries are gradually increasing. Therefore, large-scale processing through automated production lines is the future trend.

[0004] The currently authorized patents CN208460053U, CN209905237U, etc., mainly have the following limitations: (1) They rely on gratings or photoelectric detection to count, which cannot accurately identify two chicks that are stuck together or side by side. The size of the chicks will affect the judgment result; (2) The model has a large amount of computation, which is difficult to meet the real-time processing requirements of high-density production lines; (3) The counting accuracy is low. Summary of the Invention

[0005] This invention provides a deep learning-based method for counting poultry chicks, which achieves accurate counting and high-speed real-time processing of poultry chicks in high-density scenarios through algorithm optimization.

[0006] According to one aspect of this disclosure, a deep learning-based method for counting poultry chicks is provided, characterized in that the method includes: S1. Information Acquisition and Feature Extraction: Images of chicks are acquired through a hardware platform, and continuous color images of the target scene are obtained through image preprocessing. S2. Data labeling: Label the preprocessed images. For stacked chicks in the images, perform accurate target detection and labeling to obtain the labeled dataset, which provides a high-quality dataset for model training. S3. Input the acquired real-time images into a poultry chick detection system built on the YOLO architecture. This system is used to perform target detection, target tracking, and target counting on the input images. Multi-target tracking: By analyzing video sequences frame by frame, the spatial location of multiple targets is continuously determined, and a unique identifier (ID) is maintained for each target.

[0007] In one possible implementation, the hardware platform includes: a color camera, an LED strip light source, and an industrial computer, wherein the LED strip light source is used for supplementary lighting; Image preprocessing includes: sharpness enhancement and feature enhancement.

[0008] In one possible implementation, when acquiring images of chicks in S1, the camera acquires images at a fixed frequency. In S2, the industrial control computer recognizes each captured photo and generates pre-labeled results containing bounding boxes. Through expert review, unqualified labels are corrected or relabeled to obtain the dataset for model training. This dataset is used to train and optimize the model. The computer also labels the chicks that appear, and can accurately identify chicks that are side by side or stacked. Based on the trained model, the images are processed to perform target detection, target tracking, and target counting for the chicks, accurately counting the number of chicks. Each channel can count up to 20,000 chicks per hour.

[0009] In one possible implementation, the network structure for object detection includes: 3 convolutional layers, where the first 2 layers are 128-channel 3×3 convolutions used to extract localization features, and the last layer is a 15-channel 1×1 convolution to output the prediction result; The 15-channel design of the 1×1 convolutional layer in the detection branch is based on "number of anchor boxes × single anchor box output dimension". The specific calculation is as follows: Number of output channels = number of anchor boxes 3 × single anchor box output dimension 5. The single anchor box output dimension 5 includes 4-dimensional bounding box coordinates + 1-dimensional target confidence. Its core function is to output the bounding box position coordinates and confidence level. The output bounding box is used to determine the precise position and range of each individual chick in the image, laying the foundation for target tracking.

[0010] In one possible implementation, the system in S3 is optimized for chick tracking scenarios by expanding the input resolution to 512×512 pixels to enhance sensitivity to small targets, and by combining a dynamic anchor box clustering algorithm to automatically adapt to the morphological changes of the chicks, including: Use IoU as a distance metric when clustering; Minimize the sum of squared distances from all ground truth boxes to the nearest anchor box to obtain the set of anchor box positions.

[0011] In one possible implementation, in S3, for the scenario of stacked chicks, an environmental perception mechanism is introduced to dynamically adjust the cross-union ratio (IoU) threshold range of non-maximum suppression NMS according to the chick density, thereby alleviating the detection box overlap problem caused by the stacking of chicks. A multi-scale feature fusion path is designed to establish a bidirectional interactive link between shallow and deep features of the backbone network, thereby improving the ability to capture feather textures and motion-blurred targets.

[0012] In one possible implementation, S3 includes: chick density estimation: real-time density calculation: the number of chick targets detected in each frame of the image is counted, and the density index is calculated in combination with the spatial distribution of the detection box. The density index is quantified by dividing the number of detected targets by the image area. Dynamic IoU threshold adjustment: Threshold mapping function: The IoU threshold of nonmaximum suppression (NMS) is dynamically calculated based on the density index. A nonlinear mapping function is designed to ensure that the threshold is reduced at high density and increased at low density. Adaptive NMS execution: In the post-processing stage of object detection, the NMS algorithm is executed using a dynamically calculated IoU threshold; The final target detection result is that each frame of image is input into the detection system, and the output image contains the detection boxes, each box containing coordinates and confidence scores.

[0013] In one possible implementation, the multi-target tracking algorithm includes: Detection box segmentation: For the target detection results obtained from image annotation, the detection boxes are divided into high-confidence boxes and low-confidence boxes according to the confidence level. High-confidence boxes are more reliable and are given priority for matching with existing trajectories. First match: a. Use Kalman filtering to predict the estimated position of the trajectory in the current frame based on its historical motion information; b. Perform the first matching between the high-confidence detection box and the predicted positions of all trajectories. The matching cost matrix is ​​the improved cost matrix, which integrates IoU and motion direction. c. Use the Hungarian algorithm to complete the matching. Update the successfully matched trajectories with the corresponding detection boxes, and mark the unmatched trajectories as "unmatched trajectories". The unmatched detection boxes are left for the next step. Second matching: Low-scoring detection box matching: a. Perform a second match between the low-confidence detection boxes that did not match in the first match and the trajectory that did not match in the first match, to recover the trajectory of the real target that was occluded or blurred, thereby reducing missed detections; b. The matching cost also uses an improved cost matrix; Trajectory lifecycle management: a. New trajectory: For high-confidence detection boxes that are not matched after two matching attempts, initialize them as new trajectories; b. Track Removal: For tracks that fail to match for multiple consecutive frames, determine that they have left the screen and remove them from the track list.

[0014] In one possible implementation, the improved cost matrix is ​​expressed as follows: , in: ; IoU means the area of ​​the intersection of the predicted bounding box and the ground truth bounding box divided by the area of ​​their union, where i and j represent different images; C disp W is represented as the normalized displacement distance. dir The weight represents the directional consistency weight. Based on the prior knowledge of the conveyor belt's movement direction, displacements conforming to the mainstream direction are rewarded, while displacements in the opposite direction are penalized. W vert It represents the directional consistency weight, which dynamically penalizes abnormal displacements in the vertical direction to prevent mismatches caused by bird jumping or shaking.

[0015] In one possible implementation, a "region detection + state machine" decision-making strategy is adopted. Counting is triggered by tracking the state transition of the target within the detection region. The core process is as follows: Target State Structure Design: Dynamic state information is maintained for each tracked target. The structure contains the following fields: ① Target ID, a unique identifier assigned by the tracking algorithm; ② Detection Box Coordinates, the bounding box position in the current frame; ③ Motion Trajectory, the center point sequence of the most recent N frames, used for trajectory analysis; ④ Activation State, indicating whether the target has entered the detection area; ⑤ Counting State, indicating whether the target has been counted; ⑥ Occurrence Frequency, the number of times the target appears in consecutive frames; ⑦ Lifetime, used for lifecycle management. Counting trigger logic includes: Activation condition: When the target center point first enters the predefined rectangular detection area, its activation state is marked as "true"; Counting condition: When the activated target center point moves out of the detection area and its count state is "false", the system triggers a counting operation and updates the target's count state to "true". Anti-duplicate mechanism: Each target ID triggers a count only once during its lifecycle to avoid duplicate statistics caused by trajectory fluctuations.

[0016] Compared with the prior art, the beneficial effects of the present invention are: 1. Initial matching of high-confidence detection boxes is achieved through motion prediction (Kalman filtering); 2. Confidence-stratified cascaded data association strategy. High confidence target (score ≥ 0.5): Kalman filter prediction + IoU matching. Low confidence target (0.25 ≤ score < 0.5): secondary matching to improve tracking stability.

[0017] 3. Optimize the application effect of Kalman filter in high-speed, large-size, short-time tracking scenarios. The speed of high-speed moving targets changes more drastically, and the uncertainty of the moving position increases. It is necessary to adjust the position constraint to be more relaxed and respond to position changes faster, while preventing the filter from over-relying on the predicted position, which would lead to tracking lag. 4. An improved matching strategy that integrates motion direction constraints is introduced, which considers both IoU distance and displacement direction in the matching cost, thereby improving the sensitivity of displacement direction during the matching process. Attached Figure Description

[0018] Figure 1 This diagram illustrates the multi-target detection and multi-target tracking output information processing according to an embodiment of the present disclosure.

[0019] Figure 2 A schematic diagram illustrating target detection and target tracking according to an embodiment of the present disclosure is shown.

[0020] Figure 3 A flowchart of a counting method according to an embodiment of the present disclosure is shown. Detailed Implementation

[0021] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0022] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.

[0023] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.

[0024] A non-destructive, high-speed counting method for 1-day-old poultry chicks based on deep learning. The entire device mainly consists of a conveyor line and frame, a color camera, an LED strip light source, a camera bracket, an industrial control computer, and a display screen. The frame has feet at the bottom, allowing for height adjustment to adapt to the height of the entire production line.

[0025] LED strip light sources are mounted on both sides above the conveyor channel to provide sufficient brightness for the chicks passing through.

[0026] A large number of chicks are placed on the front conveyor line and allowed to pass through. A camera takes pictures at a fixed frequency and transmits the pictures to an industrial control computer.

[0027] The industrial control computer analyzes each image and uses target tracking to ensure that a chick has the same ID number in different photos, guaranteeing that a chick is only recorded once when it passes through the camera's shooting area. Figure 1 As shown; The accuracy of the counting depends on the recognition accuracy of the target detection algorithm and the tracking accuracy of the multi-target tracking algorithm.

[0028] In this embodiment, the optimized target detection model accurately identified two stacked chicks, precisely counting both chicks. Further improvements to the target detection model can enable the identification of chicks in various poses or partially occluded states.

[0029] This embodiment solves the problem of misidentification of interference sources in target detection algorithms. Whether it is eggshells or feces, it will not misidentify adult chicks. This embodiment addresses the low fault tolerance of target detection algorithms that rely solely on counting within two frames before and after the detection line for line crossing counting. It upgrades to region detection counting. After obtaining target tracking information, it checks if `track_id` (the ID of the trajectory) is in the active list or the counted list. If the query result is negative (meaning the target is appearing for the first time), a new structure object is created to store the target information. If the query result is positive (meaning the target already exists in a structure object), the structure object needs to be updated. Additionally, a global variable is defined to store the current total count information. The count increments by 1 when the target's count status stored in the structure changes from false to true.

[0030] The "trajectory ID" is a unique identification number assigned by the system to each chick that passes through the camera's area. The purpose of this ID is to answer a core question: Is the chicken I see in different photos the same one as the one in the previous photo?

[0031] ① During the target detection stage, when each photo (each frame) is taken, the target detection algorithm will identify all the chicks in the photo and draw a detection box for each chick. At this time, each detection box is independent. The system only knows that there is a chicken here, but does not know which one it corresponds to in the previous photo.

[0032] ② In the target tracking stage, the core task is correlation. It is necessary to match the detection box in the current frame with the trajectory that already exists in the previous frame.

[0033] ③ Regarding the track ID (track_id): When a new chick is first identified and confirmed by the system, the system creates a new track for it and assigns a unique, unchanging ID. This ID is the track ID.

[0034] ④The significance of ID: ID is crucial in ensuring that no chicks are counted too much or too little during counting. Each chick with an ID is counted only once.

[0035] A deep learning-based method for counting poultry chicks, the method comprising: S1. Information Acquisition and Feature Extraction: Images of chicks are acquired through a hardware platform, and continuous color images of the target scene are obtained through image preprocessing. S2. Data labeling: Label the preprocessed images. For stacked chicks in the images, perform accurate target detection and labeling to obtain the labeled dataset, which provides a high-quality dataset for model training. First, a small seed dataset is manually labeled by professional annotators. This dataset is then used to train an initial model for detecting and recognizing chicks. Subsequently, this initial model performs inference and prediction on a large number of unlabeled images, automatically generating pre-labeled results containing bounding boxes. These pre-labeled results are not used directly but are submitted to an expert review process: annotation experts verify each model prediction result; qualified labels are adopted, while unqualified labels are corrected or relabeled on-site. The approved labeled data is incorporated into the training set for training the next generation model, as it typically possesses superior predictive capabilities due to its richer and higher-quality data.

[0036] The "human-machine collaborative iterative annotation paradigm" has constructed a large-scale, high-quality dataset of annotated images of one-day-old poultry chicks. The core of this process lies in combining expert knowledge with model prediction capabilities to form a self-optimizing closed-loop system, which significantly improves annotation efficiency and data quality.

[0037] This process is repeated iteratively, with the model being retrained in each round using a larger dataset reviewed by experts from the previous round. This continuously improves prediction accuracy while the required human intervention decreases with each iteration. After several iterations, a high-performance recognition model and a large-scale labeled dataset that has undergone expert-level quality verification are finally obtained.

[0038] S3. Input the acquired real-time images into a poultry chick detection system built on the YOLO architecture (this system is based on an improved YOLOv5 network and optimized for poultry chick tracking and counting, and poultry chick stacking scenarios). This system is used to perform target detection, target tracking and target counting on the input images. Multi-target tracking: By analyzing video sequences frame by frame, the spatial location of multiple targets is continuously determined, and a unique identifier (ID) is maintained for each target.

[0039] In one possible implementation, the hardware platform includes: a color camera, an LED strip light source, and an industrial computer, wherein the LED strip light source is used for supplementary lighting; Image preprocessing includes: sharpness enhancement and feature enhancement.

[0040] In one possible implementation, when acquiring images of chicks in S1, the camera acquires images at a fixed frequency. In S2, the industrial control computer recognizes each captured photo and generates pre-labeled results containing bounding boxes. Through expert review, unqualified labels are corrected or relabeled to obtain the dataset for model training. This dataset is used to train and optimize the model. The computer also labels the chicks that appear, and can accurately identify chicks that are side by side or stacked. Based on the trained model, the images are processed to perform target detection, target tracking, and target counting for the chicks, accurately counting the number of chicks. Each channel can count up to 20,000 chicks per hour.

[0041] In one possible implementation, the network structure for object detection includes: 3 convolutional layers, where the first 2 layers are 128-channel 3×3 convolutions used to extract localization features, and the last layer is a 15-channel 1×1 convolution to output the prediction result; The 15-channel design of the 1×1 convolutional layer in the detection branch is based on "number of anchor boxes × single anchor box output dimension". The specific calculation is as follows: Number of output channels = number of anchor boxes 3 × single anchor box output dimension 5. The single anchor box output dimension 5 includes 4-dimensional bounding box coordinates + 1-dimensional target confidence. Its core function is to output the bounding box position coordinates and confidence level. The output bounding box is used to determine the precise position and range of each individual chick in the image, laying the foundation for target tracking.

[0042] In one possible implementation, the system in S3 is optimized for chick tracking scenarios by expanding the input resolution to 512×512 pixels to enhance sensitivity to small targets, and by combining a dynamic anchor box clustering algorithm to automatically adapt to the morphological changes of the chicks, including: Use IoU as a distance metric when clustering; Minimize the sum of squared distances from all ground truth boxes to the nearest anchor box to obtain the set of anchor box positions.

[0043] In one possible implementation, in S3, for the scenario of stacked chicks, an environmental perception mechanism is introduced to dynamically adjust the cross-union ratio (IoU) threshold range of non-maximum suppression NMS according to the chick density, thereby alleviating the detection box overlap problem caused by the stacking of chicks. A multi-scale feature fusion path is designed to establish a bidirectional interactive link between shallow and deep features of the backbone network, thereby improving the ability to capture feather textures and motion-blurred targets.

[0044] In one possible implementation, S3 includes: chick density estimation: real-time density calculation: the number of chick targets detected in each frame of the image is counted, and the density index is calculated in combination with the spatial distribution of the detection box. The density index is quantified by dividing the number of detected targets by the image area. Dynamic IoU Threshold Adjustment: Threshold Mapping Function: The IoU threshold of Non-Maximum Suppression (NMS) is dynamically calculated based on the density index. A nonlinear mapping function is designed to ensure that the threshold is lowered at high density to more aggressively suppress overlapping boxes, and the threshold is raised at low density to retain more detection boxes. Adaptive NMS execution: In the post-processing stage of target detection, the NMS algorithm is executed using a dynamically calculated IoU threshold; this effectively reduces the merging of detection boxes for stacked chicks and avoids misclassifying multiple individuals as a single target; The final target detection result is that each frame of image is input into the detection system, and the output image contains the detection boxes, each box containing coordinates and confidence scores.

[0045] In one possible implementation, the multi-target tracking algorithm includes: Detection box segmentation: For the target detection results obtained from image annotation, the detection boxes are divided into high-confidence boxes and low-confidence boxes according to the confidence level. High-confidence boxes are more reliable and are given priority for matching with existing trajectories. First match: a. Use Kalman filtering to predict the estimated position of the trajectory in the current frame based on its historical motion information; b. Perform the first matching between the high-confidence detection box and the predicted positions of all trajectories. The matching cost matrix is ​​the improved cost matrix, which integrates IoU and motion direction. c. Use the Hungarian algorithm to complete the matching. Update the successfully matched trajectories with the corresponding detection boxes, and mark the unmatched trajectories as "unmatched trajectories". The unmatched detection boxes are left for the next step. Second matching: Low-scoring detection box matching: a. Perform a second match between the low-confidence detection boxes that did not match in the first match and the trajectory that did not match in the first match, to recover the trajectory of the real target that was occluded or blurred, thereby reducing missed detections; b. The matching cost also uses an improved cost matrix; Trajectory lifecycle management: a. New trajectory: For high-confidence detection boxes that are not matched after two matching attempts, initialize them as new trajectories; b. Track Removal: For tracks that fail to match for multiple consecutive frames (e.g., 8 frames), it is determined that the track has left the screen and it is removed from the track list.

[0046] This improved algorithm, through a two-matching strategy and an innovative cost function, significantly enhances robustness in high-density, heavily occluded scenarios while maintaining high tracking accuracy. The goal is to ensure that each chick has only one ID, preventing over-counting.

[0047] In one possible implementation, the improved cost matrix is ​​expressed as follows: , in: ; IoU means the area of ​​the intersection of the predicted bounding box and the ground truth bounding box divided by the area of ​​their union, where i and j represent different images; C disp W is represented as the normalized displacement distance. dir The weight represents the directional consistency weight. Based on the prior knowledge of the conveyor belt's movement direction, displacements conforming to the mainstream direction are rewarded, while displacements in the opposite direction are penalized. W vert It represents the directional consistency weight, which dynamically penalizes abnormal displacements in the vertical direction to prevent mismatches caused by bird jumping or shaking.

[0048] In one possible implementation, a "region detection + state machine" decision-making strategy is adopted. Counting is triggered by tracking the state transition of the target within the detection region. The core process is as follows: Target State Structure Design: Dynamic state information is maintained for each tracked target. The structure contains the following fields: ① Target ID, a unique identifier assigned by the tracking algorithm; ② Detection Box Coordinates, the bounding box position in the current frame; ③ Motion Trajectory, the center point sequence of the most recent N frames, used for trajectory analysis; ④ Activation State, indicating whether the target has entered the detection area; ⑤ Counting State, indicating whether the target has been counted; ⑥ Occurrence Frequency, the number of times the target appears in consecutive frames; ⑦ Lifetime, used for lifecycle management. Counting trigger logic includes: Activation condition: When the target center point first enters the predefined rectangular detection area, its activation state is marked as "true"; Counting condition: When the activated target center point moves out of the detection area and its count state is "false", the system triggers a counting operation and updates the target's count state to "true". Anti-duplicate mechanism: Each target ID triggers a count only once during its lifecycle to avoid duplicate statistics caused by trajectory fluctuations.

[0049] Figure 1 The data shows the confidence level, chick identification ID, box ID, frames per second, and the number of chicks counted (20). Figure 2 The data includes statistics, detection area, target motion trajectory, target detection anchor box, and target tracking anchor box.

[0050] This technology offers the following advantages over current target tracking algorithms, addressing the existing problems: 1. The problem of dynamic handling of target occlusion is solved by using motion prediction (Kalman filtering) to complete the initial matching of high-confidence detection boxes, achieving 100% target tracking and ensuring that the tracked target is not lost; 2. Engineering bottlenecks in algorithm efficiency: Adopt lightweight models to reduce model processing time; This technology enables accurate counting of chicks at high speeds, with a single channel processing capacity of up to 1.5w / h. Standard equipment is equipped with 4 channels to meet the needs of large-scale hatcheries.

[0051] The optimized algorithm described above enables a high-density, non-destructive, high-speed counting method for 1-day-old chicks.

[0052] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A deep learning-based method for counting poultry chicks, characterized in that, The method includes: S1. Information Acquisition and Feature Extraction: Images of chicks are acquired through a hardware platform, and continuous color images of the target scene are obtained through image preprocessing. S2. Data labeling: Label the preprocessed images. For stacked chicks in the images, perform accurate target detection and labeling to obtain the labeled dataset, which provides a high-quality dataset for model training. S3. Input the acquired real-time images into a poultry chick detection system built on the YOLO architecture. This system is used to perform target detection, target tracking, and target counting on the input images. Multi-target tracking: By analyzing video sequences frame by frame, the spatial location of multiple targets is continuously determined, and a unique identifier (ID) is maintained for each target.

2. The deep learning-based chick counting method according to claim 1, characterized in that, The hardware platform includes: a color camera, an LED strip light source, and an industrial computer. The LED strip light source is used for supplementary lighting. Image preprocessing includes: sharpness enhancement and feature enhancement.

3. The deep learning-based chick counting method according to claim 1, characterized in that, When acquiring images of chicks in S1, the camera acquires images at a fixed frequency; In S2, the industrial control computer recognizes each captured photo and generates pre-labeled results containing bounding boxes. Through expert review, unqualified labels are corrected or relabeled to obtain the dataset for model training. This dataset is used to train and optimize the model. The computer also labels the chicks that appear, and can accurately identify chicks that are side by side or stacked. Based on the trained model, the images are processed to perform target detection, target tracking, and target counting for the chicks, accurately counting the number of chicks. Each channel can count up to 20,000 chicks per hour.

4. The deep learning-based method for counting poultry chicks according to claim 1, characterized in that, The network structure for object detection includes three convolutional layers: the first two layers are 128-channel 3×3 convolutions used to extract localization features, and the last layer is a 15-channel 1×1 convolution to output the prediction results. The 15-channel design of the 1×1 convolutional layer in the detection branch is based on "number of anchor boxes × single anchor box output dimension". The specific calculation is as follows: Number of output channels = number of anchor boxes 3 × single anchor box output dimension 5. The single anchor box output dimension 5 includes 4-dimensional bounding box coordinates + 1-dimensional target confidence. Its core function is to output the bounding box position coordinates and confidence level. The output bounding box is used to determine the precise position and range of each individual chick in the image, laying the foundation for target tracking.

5. The deep learning-based method for counting poultry chicks according to claim 1, characterized in that, The system in S3, optimized for chick tracking scenarios, enhances sensitivity to small targets by expanding the input resolution to 512×512 pixels and automatically adapts to morphological changes in chicks using a dynamic anchor box clustering algorithm, including: Use IoU as a distance metric when clustering; Minimize the sum of squared distances from all ground truth boxes to the nearest anchor box to obtain the set of anchor box positions.

6. The deep learning-based method for counting poultry chicks according to claim 1, characterized in that, In S3, for the scenario of stacked chicks, an environmental perception mechanism is introduced to dynamically adjust the crossover ratio (IoU) threshold range of non-maximum suppression NMS according to the density of the chick flock, thereby alleviating the problem of overlapping detection boxes caused by the stacking of chick flocks. A multi-scale feature fusion path is designed to establish a bidirectional interactive link between shallow and deep features of the backbone network, thereby improving the ability to capture feather textures and motion-blurred targets.

7. The deep learning-based method for counting poultry chicks according to claim 6, characterized in that, S3 includes: Chick density estimation: Real-time density calculation: The number of chick targets detected in each frame of the image is counted, and the density index is calculated in combination with the spatial distribution of the detection box. The density index is quantified by dividing the number of detected targets by the image area. Dynamic IoU threshold adjustment: Threshold mapping function: The IoU threshold of nonmaximum suppression (NMS) is dynamically calculated based on the density index. A nonlinear mapping function is designed to ensure that the threshold is reduced at high density and increased at low density. Adaptive NMS execution: In the post-processing stage of object detection, the NMS algorithm is executed using a dynamically calculated IoU threshold; The final target detection result is that each frame of image is input into the detection system, and the output image contains the detection boxes, each box containing coordinates and confidence scores.

8. The deep learning-based method for counting poultry chicks according to claim 3, characterized in that, Multi-target tracking algorithms, including: Detection box segmentation: For the target detection results obtained from image annotation, the detection boxes are divided into high-confidence boxes and low-confidence boxes according to the confidence level. High-confidence boxes are more reliable and are given priority for matching with existing trajectories. First match: a. Use Kalman filtering to predict the estimated position of the trajectory in the current frame based on its historical motion information; b. Perform the first matching between the high-confidence detection box and the predicted positions of all trajectories. The matching cost matrix is ​​the improved cost matrix, which integrates IoU and motion direction. c. Use the Hungarian algorithm to complete the matching. Update the successfully matched trajectories with the corresponding detection boxes, and mark the unmatched trajectories as "unmatched trajectories". The unmatched detection boxes are left for the next step. Second matching: Low-scoring detection box matching: a. Perform a second match between the low-confidence detection boxes that did not match in the first match and the trajectory that did not match in the first match, to recover the trajectory of the real target that was occluded or blurred, thereby reducing missed detections; b. The matching cost also uses an improved cost matrix; Trajectory lifecycle management: a. New trajectory: For high-confidence detection boxes that are not matched after two matching attempts, initialize them as new trajectories; b. Track Removal: For tracks that fail to match for multiple consecutive frames, determine that they have left the screen and remove them from the track list.

9. The deep learning-based method for counting poultry chicks according to claim 1, characterized in that, The improved cost matrix is ​​expressed as follows: , in: ; IoU means the area of ​​the intersection of the predicted bounding box and the ground truth bounding box divided by the area of ​​their union, where i and j represent different images; C disp W is represented as the normalized displacement distance. dir The weight represents the directional consistency weight. Based on the prior knowledge of the conveyor belt's movement direction, displacements conforming to the mainstream direction are rewarded, while displacements in the opposite direction are penalized. W vert It represents the directional consistency weight, which dynamically penalizes abnormal displacements in the vertical direction to prevent mismatches caused by bird jumping or shaking.

10. The deep learning-based method for counting poultry chicks according to claim 3, characterized in that, The "region detection + state machine" decision-making strategy is adopted. Counting is triggered by tracking the state transition of the target within the detection region. The core process is as follows: Target State Structure Design: Dynamic state information is maintained for each tracked target. The structure contains the following fields: ① Target ID, a unique identifier assigned by the tracking algorithm; ② Detection Box Coordinates, the bounding box position in the current frame; ③ Motion Trajectory, the center point sequence of the most recent N frames, used for trajectory analysis; ④ Activation State, indicating whether the target has entered the detection area; ⑤ Counting State, indicating whether the target has been counted; ⑥ Occurrence Frequency, the number of times the target appears in consecutive frames; ⑦ Lifetime, used for lifecycle management. Counting trigger logic includes: Activation condition: When the target center point first enters the predefined rectangular detection area, its activation state is marked as "true"; Counting condition: When the center point of an activated target moves out of the detection area and its counting status is "false", the system triggers a counting operation and updates the counting status of the target to "true". Anti-duplicate mechanism: Each target ID triggers a count only once during its lifecycle to avoid duplicate statistics caused by trajectory fluctuations.

Citation Information

Patent Citations

  • Male and female chick automatic counting operation panel

    CN208460053U

  • Baby chick counter

    CN209905237U

Cited By

  • A high-speed egg recognition and counting method, system, device and storage medium

    CN122435605A