Poultry behavior intelligent monitoring system and method

By generating a spatiotemporally encoded light field on the breeding ground and utilizing occlusion information extraction and identity persistence reconstruction modules, the problem of identity continuity in high-density poultry groups is solved, realizing continuous identity reconstruction and long-term tracking under occlusion conditions, which is suitable for high-density homogeneous poultry breeding scenarios.

CN121640587APending Publication Date: 2026-03-10ANHUI SCI & TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In high-density intensive farming scenarios, existing technologies struggle to construct stable and reliable identity descriptions for each poultry over long timescales and maintain identity continuity even under occlusion conditions. This results in poultry behavior monitoring systems being unable to accurately statistically analyze the long-term behavioral patterns of individual animals.

Method used

By generating a light distribution with spatiotemporal coding characteristics on the breeding ground, and using a coding light field generation module, an occlusion information extraction module, and an identity persistence reconstruction module, a poultry identity code stream is constructed and the identity trajectory is continuously reconstructed over a long time scale. This includes ground grid division, coding sequence generation, light field geometric calibration, occlusion information extraction and identity code decoding, trajectory splicing, and conflict resolution.

Benefits of technology

It enables the generation of a stable identification code sequence for each individual in a high-density poultry flock, significantly reducing the number of identity switching times and improving the stability and accuracy of long-term tracking. It is suitable for poultry farming scenarios where the appearance is highly homogeneous.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121640587A_ABST
    Figure CN121640587A_ABST
Patent Text Reader

Abstract

The invention discloses a poultry behavior intelligent monitoring system and method, and relates to the technical field of image processing, and the system comprises a coding light field generation module, a shielding information extraction module, and an identity continuous reconstruction module. The coding light field generation module is used for generating illumination distribution with space-time coding characteristics on a breeding ground and providing a synchronous coding index for the image processing end, and the shielding information extraction module is used for segmenting a poultry foreground area from an acquired poultry image sequence and reversely deducing shielding distribution corresponding to a ground position. And the identity continuous reconstruction module is used for constructing a poultry identity code stream based on the shielding distribution and the coding index and continuously reconstructing an identity track on a long time scale. According to the invention, the space-time coding light field is projected on the breeding ground and the shielding coding path of each poultry is inverted from the image sequence; and an individual movement track is converted into an identity code stream with an error correction capability, so that long-term identity continuous tracking is realized in a high-density environment.
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, specifically to an intelligent monitoring system and method for poultry behavior. Background Technology

[0002] In high-density intensive poultry farming scenarios, using top-view cameras for image analysis and automatic monitoring of poultry behavior has become an important direction for precision farming. Existing multi-target tracking algorithms typically maintain poultry identification by associating detection results with short-term trajectories and combining appearance features with spatial proximity relationships. Due to the high similarity in appearance among chickens and their high group density, individuals frequently occlude, cross paths, and move over large areas, leading to frequent breaks in identification markers and identity switching over long time scales. Existing systems mostly rely on local inter-frame information and manual correction, making it difficult to maintain the continuity of each chicken's identity over an entire day.

[0003] Without attaching physical tags to the chickens or disrupting their original rearing environment, how to construct a stable and reliable identity description for each individual in a high-density poultry flock based solely on image sequences, and maintain identity continuity across occlusion and field of view over a long period, has become a challenging problem for those skilled in the art. Specifically, when multiple chickens simultaneously gather in a local area, hide at the edge of their field of view, or are occluded by facilities, conventional tracking algorithms based on appearance and short-term trajectories struggle to recover the identity correspondence before and after occlusion. The lack of a technical solution that can utilize global spatiotemporal information to generate error-correcting identity code sequences for individuals prevents existing poultry behavior monitoring systems from accurately statistically analyzing the long-term behavioral patterns of individual birds. Summary of the Invention

[0004] The purpose of this invention is to provide an intelligent monitoring system and method for poultry behavior to solve the problems mentioned in the background art.

[0005] To address the aforementioned technical problems, this invention provides the following technical solution: an intelligent monitoring system for poultry behavior, comprising an coded light field generation module, an occlusion information extraction module, and an identity persistence reconstruction module. The coded light field generation module is used to generate a light distribution with spatiotemporal coding characteristics on the breeding ground and provide a synchronous coding index to the image processing end. The occlusion information extraction module is used to segment the foreground region of poultry from the acquired poultry image sequence and deduce the occlusion distribution of the corresponding ground location. The identity persistence reconstruction module is used to construct a poultry identity code stream based on the occlusion distribution and the coding index and continuously reconstruct the identity trajectory over a long time scale.

[0006] According to the above technical solution, the coded light field generation module includes a ground grid division unit, a coding sequence generation unit, a light field geometry calibration unit, and a projection light source. The ground grid division unit divides the aquaculture ground into regular grids and assigns a fixed index to each grid unit. The aquaculture ground has a ground reflection layer with predetermined reflection characteristics, which is used to generate reflection brightness corresponding to the coded brightness under the illumination of the coded light field. The coding sequence generation unit generates a binary time coding sequence with low correlation for each grid index and drives the projection light source to output brightness mode in the corresponding grid area. The light field geometry calibration unit estimates the relative position parameters of the camera and the projection light source based on the calibration board image and establishes the mapping relationship between the ground grid index and the image pixel coordinates. The controller drives the projection light source to output different brightness modes in each grid area according to the coding sequence. The occlusion information extraction module includes a foreground segmentation unit, a ground mapping unit, and an occlusion feature accumulation unit. The foreground segmentation unit performs background modeling and poultry segmentation on the input image sequence to obtain the poultry foreground mask for each frame. The ground mapping unit uses geometric mapping relationships to convert the poultry foreground mask into a ground grid-level occlusion mask. The occlusion feature accumulation unit extracts the occlusion state of each grid in time based on the ground grid-level occlusion mask and forms the basic data for subsequent decoding. The identity persistence reconstruction module includes a short-time identity code decoding unit, a trajectory splicing unit, and a conflict resolution unit. The short-time identity code decoding unit calculates a window-level identity code fragment for each poultry based on occlusion features and coding index within a given time window. The trajectory splicing unit splices local trajectories between adjacent time windows based on identity code fragments and motion constraints to generate long-time identity trajectories. When identity conflicts exist, the conflict resolution unit selects the identity allocation scheme with the lowest cost based on identity code distance, trajectory smoothness, and spatial topology consistency index.

[0007] A method for intelligent monitoring of poultry behavior includes: S1 generates a spatiotemporal encoded light field on the aquaculture ground through the encoded light field generation module and completes the geometric calibration of the camera and the ground grid so that it can be accurately mapped from the image space to the ground grid index space in the future, while recording the encoded bits corresponding to each grid unit at each moment. S2, the occlusion information extraction module is used to preprocess and segment the acquired poultry image sequence to obtain the poultry foreground mask and the corresponding ground grid-level occlusion mask in each frame, and store them in chronological order to form an occlusion time sequence. S3, within the preset window length, the short-time identity code decoding unit in the identity persistence reconstruction module combines the ground grid index covered by each poultry within the time window with the corresponding encoded bits to form a window-level identity code fragment with an error correction structure. S4, the trajectory splicing unit is used to associate trajectories between adjacent time windows based on the similarity of window-level identity code fragments and the constraints of poultry movement speed, connecting local trajectories into long-term identity trajectories, and calling the conflict resolution unit to select a unique identity allocation using a global cost function when there is an identity conflict. S5. Throughout the monitoring period, steps S2 to S4 are repeated continuously to update the identity code stream and trajectory of each poultry, and the results of continuous identity tracking are output to the behavior analysis module for statistical analysis of individual behavior indicators.

[0008] According to the above technical solution, S1 specifically refers to: S1-1. After installing the camera and projection light source, establish a coordinate system based on the ground of the main activity area of ​​the farm, along... Directional division Go, along Directional division Column, get The first regular grid cell, the... Line number Column grid cells are denoted as Each grid cell has an adjacent and aligned boundary on the ground, with no overlapping areas, so that any point on the ground belongs to only one grid cell. This ensures that subsequent statistics on ground illumination and shading have a clear spatial attribution. S1-2, For each grid cell Generate a segment of length binary time-coded sequence ,in For time indexing, The value at each time index is either 0 or 1, and the time-coded sequence at each time point... One 3D binary encoded vector The time-coded sequence of all grid cells is generated through a linear feedback shift register, which employs a pre-selected feedback polynomial and applies it to different grid cells. Different initial states are assigned to obtain different binary sequences. During the design process, the feedback polynomial and initial states are selected to ensure that the Hamming correlation between any two sequences corresponding to different grid indices at any alignment position is lower than a preset threshold. This ensures that the time coding modes of different grids are significantly different, providing sufficient redundancy for subsequent grid differentiation based on occlusion patterns; S1-3, at discrete acquisition times When acquiring images at the location, The brightness control signal used as the projection light source corresponds to the grid. At any moment ground brightness Calculate according to the following formula: ,in This refers to the high brightness value output by the projection light source. This refers to the low brightness value output by the projection light source. When the value is 1, the ground brightness at this grid point is close to ,when When the value is 0, the ground brightness at this grid point is close to Subsequently, a calibration board with a regular pattern was placed on the ground, and calibration images were acquired. The intrinsic and extrinsic parameters of the camera were calculated using the known geometric point coordinates on the calibration board and the corresponding pixel coordinates in the images, thus obtaining the ground plane coordinates of a certain ground point. Mapping to image plane coordinates homography matrix The mapping relationship is represented as ,in To map ground plane coordinates to image plane coordinates using a 3×3 homography matrix, each grid cell... Substituting the coordinates of the ground center point into the above formula, we obtain the corresponding pixel region of the grid in the image, thereby establishing a one-to-one correspondence between the grid index and the image pixel set in the system.

[0009] According to the above technical solution, S2 specifically refers to: S2-1. The acquired original image sequence Preprocessing operations are performed, including spatial denoising, white balance correction, and brightness normalization, to obtain a preprocessed image sequence. ,in and Given pixel coordinates in the image plane, using camera intrinsics... Distortion correction is performed to eliminate radial and tangential distortion, resulting in a distortion-corrected image sequence. Then, a background modeling algorithm is used to... Processing is performed, for example, using a foreground extraction method based on a Gaussian mixture model, to obtain the poultry foreground mask corresponding to each frame. In the foreground mask, pixels with a value of 1 are identified as the poultry foreground region, and pixels with a value of 0 are identified as the background region. Through the above processing, the complex original image is transformed into an image with clear separation between the foreground and background. S2-2, Using homography matrix Will Each pixel coordinate Mapping to ground plane coordinates to obtain the corresponding grid index. Map all to the same grid cell The set of pixels is denoted as For each grid cell And every frame Calculate the set in the frame Average observed brightness The average observed brightness is calculated according to the following formula. ,in For set The number of pixels in the middle, Represents a set The brightness of all pixels is summed to extract the average brightness in grid units from the complex brightness distribution at the pixel level. S2-3, Theoretical ground brightness Compared with average observed brightness Comparison, defining grid-level occlusion indicators ,when At that time, it is considered that the grid cell exist Constantly being hidden by poultry, The threshold value is 1 if it is not 1, and 0 otherwise. Pre-calibrated based on projection brightness fluctuations and ground reflection characteristics, then combined with poultry foreground masks. The foreground region is divided into multiple independent poultry regions using a connected component segmentation algorithm. For each poultry region, the set of grid indices covered by that region is counted. That is, the grid position corresponding to each poultry in each frame is recorded, thus obtaining the poultry occlusion mask in grid units.

[0010] According to the above technical solution, S3 specifically refers to: S3-1, Set the time window length as follows Frame, window index is , No. The frame range covered by each time window is For each poultry The occlusion masks within this time window are accumulated chronologically, recording each poultry. The set of grid indices covered by each frame within the window reflects the sequence of ground grids traversed by the poultry within the window, and the time window length. The selection is based on the camera frame rate and the movement speed of poultry. It is necessary to ensure that the window contains enough grid switching information, while avoiding the window being too long and causing the identity change to be too slow. S3-2, For each poultry In the Construct a window-level identity code vector within a time window. Let the dimension of this vector be denoted as , among which dimension The length of the time-coded sequence in S1-2 Same, the first Dimensional components are denoted as ,in And it is an integer. ,in For grid cells In dimensions The corresponding coding component is understood as the grid in the multidimensional coding space at time t. The first Each encoded bit value This is an occlusion indicator; a value of 1 indicates that the grid is occluded by poultry at that moment. The poultry are then occluded using the formula described above. The encoded values ​​of all occluded grids passed through the entire time window are weighted and accumulated to obtain a multi-dimensional encoded vector that is strongly correlated with its motion path; S3-3, For vectors Normalization and quantization are performed to map the real number vectors to the binary code space to obtain discrete identity code fragments. Normalization involves subtracting the mean from each component and then dividing by the standard deviation. Quantization maps continuous values ​​to 0 and 1 by comparing them using dimensional thresholds. Through the design of the thresholds and normalization methods, it is possible to determine the normalization of any two different poultry. and Identity code fragments within the same time window and The Hamming distance between them is greater than the preset lower bound. This ensures that the identity code fragments of the same poultry in adjacent windows vary little, thus guaranteeing both the distinguishability between individuals and the temporal continuity of the individual's identity code, providing a foundation for subsequent identity association and error correction based on distance metrics.

[0011] According to the above technical solution, S4 specifically refers to: S4-1. After completing the calculation of the identity code segment for each time window, perform calculations for adjacent time windows. and Matching candidate trajectories belonging to the same camera's field of view, for any one originating from a window trajectory and any one from the window trajectory Calculate the distance of the identity code ,in For trajectory In the window The first in Segment of identity code For trajectory In the window The first in Segment of identity code Hamming distance is the distance between two code segments, which is the number of different bit values ​​at the same bit position. The weighting coefficients for different segments are adjusted. Emphasis is placed on code segments that are more sensitive to identity stability, thereby improving the ability to distinguish identities; S4-2. Simultaneously calculate the motion smoothing cost based on the centroid position sequence of poultry in the image plane. Let the trajectory In the window The centroid position of the last frame within is trajectory In the window The centroid position of the first frame within is ,but , representing the Euclidean distance between two points, can be calculated directly by mapping the centroid coordinates to planar coordinates in pixels, provided that the distance does not exceed the maximum speed. Window time interval The product of these factors eliminates erroneous associations that do not conform to the normal movement speed of poultry. S4-3. Constructing the global cost function The identity code distance and motion smoothing cost are combined for unified optimization across all candidate trajectories. ,in For the set of all trajectory pairs to be associated, , To balance the weighting coefficients of identity code distance and motion cost, the solution is obtained by solving the problem in the set of all trajectory pairs that satisfy the one-to-one matching constraint. The minimum association result yields the optimal trajectory association set. ,Will Each pair of trajectories is considered a continuation of the identity of the same poultry in adjacent windows. During the solution process, for cases where multiple trajectories compete for the same objective, the trajectory pairings are adjusted within a local region and the cost functions are compared. The increment, the choice that enables By adding a minimum trajectory allocation scheme as the final result, the rationality and stability of identity association are guaranteed as a whole.

[0012] According to the above technical solution, S5 specifically refers to: S5-1, Monitor each poultry throughout the entire monitoring period. Accumulate the sequence of identity code fragments across all time windows. Simultaneously, the centroid position is accumulated in each frame of the image. The above two parts of information are combined to form a description of poultry. The identity code stream and trajectory record of long-term behavior: the identity code stream records the changes in the encoding pattern of poultry in each time window, and the trajectory records the spatial location changes of poultry in the entire breeding area. Together, they constitute a complete description of the long-term behavior of poultry. S5-2. When poultry leaves the current camera's field of view for a period of time and then re-enters any camera's field of view, select the continuous sequence after its re-entry. The observed identity code fragments within a time window are used as query sequences. These query sequences are then compared window-by-window with the identity code streams of all poultry in the historical identity database. For the current poultry... and historical identity Calculate the re-identification cost function ,in For current poultry in the first A fragment of the identity code for each window. For historical identity The identity code fragment at the same window index, For different windows, the importance weighting coefficients are used. The Hamming distance between corresponding window identity code fragments is calculated for all historical identities. The identity with the lowest cost is selected as the current poultry's identity marker, thereby completing cross-field and long-term scale identity re-identification and ensuring that the identity of the same poultry remains consistent after leaving and re-entering. S5-3. After re-identification, the identity code stream and trajectory record are continuously output to the upper-level behavior analysis module. In this module, the feeding time, activity level, rest duration and frequency of abnormal behavior of each poultry are statistically analyzed based on the trajectory record throughout the entire breeding cycle. At the same time, the identity code stream is used to backtrack and correct any possible identity interruptions. When the identity is found to be discontinuous in a local time period, the optimal identity sequence can be recalculated using the identity code fragments from the previous and next windows. This allows the system to provide reliable long-term behavior data of individual animals even under high-density breeding conditions.

[0013] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: The present invention constructs a time-related ground-coded light field and uses the occlusion effect of the chicken's body on the coded light field to generate a unique identity code sequence, so that the movement path of each chicken at any time corresponds to a unique identity description, and even if severe occlusion occurs in a local area, the true identity can be recovered through code sequence error correction.

[0014] By simultaneously introducing motion velocity constraints and spatial topology constraints, this invention performs global optimization matching of candidate trajectories across the entire scene, significantly reducing the number of identity switching and improving the stability of long-term tracking. Since the identity code originates entirely from the occlusion pattern of the ground-coded light field in the image and does not depend on individual appearance differences, it is suitable for poultry farming scenarios with large groups and highly homogeneous appearances. Attached Figure Description

[0015] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a schematic diagram of the overall modular structure of the present invention. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] Please see Figure 1 The present invention provides a technical solution: an intelligent monitoring system for poultry behavior, comprising an coded light field generation module, an occlusion information extraction module, and an identity persistence reconstruction module. The coded light field generation module is used to generate a light distribution with spatiotemporal coding characteristics on the breeding ground and provide a synchronous coding index to the image processing end. The occlusion information extraction module is used to segment the poultry foreground region from the acquired poultry image sequence and deduce the occlusion distribution of the corresponding ground position. The identity persistence reconstruction module is used to construct the poultry identity code stream based on the occlusion distribution and the coding index and continuously reconstruct the identity trajectory over a long time scale. The coded light field generation module includes a ground grid division unit, a coded sequence generation unit, a light field geometry calibration unit, and a projection light source. The ground grid division unit divides the aquaculture ground into regular grids and assigns a fixed index to each grid unit. The aquaculture ground has a ground reflective layer with predetermined reflective properties, which is used to generate reflective brightness corresponding to the coded brightness under the illumination of the coded light field. The coded sequence generation unit generates a binary time-coded sequence with low correlation for each grid index and drives the projection light source to output brightness mode in the corresponding grid area. The light field geometry calibration unit estimates the relative position parameters of the camera and the projection light source based on the calibration board image and establishes the mapping relationship between the ground grid index and the image pixel coordinates. The controller drives the projection light source to output different brightness modes in each grid area according to the coded sequence. The occlusion information extraction module includes a foreground segmentation unit, a ground mapping unit, and an occlusion feature accumulation unit. The foreground segmentation unit performs background modeling and poultry segmentation on the input image sequence to obtain the poultry foreground mask for each frame. The ground mapping unit uses geometric mapping relationships to convert the poultry foreground mask into a ground grid-level occlusion mask. The occlusion feature accumulation unit extracts the occlusion state of each grid in time based on the ground grid-level occlusion mask and forms the basic data for subsequent decoding. The identity persistence reconstruction module includes a short-term identity code decoding unit, a trajectory splicing unit, and a conflict resolution unit. The short-term identity code decoding unit calculates the window-level identity code fragment for each poultry based on occlusion features and coding index within a given time window. The trajectory splicing unit splices local trajectories between adjacent time windows based on identity code fragments and motion constraints to generate long-term identity trajectories. When identity conflicts exist, the conflict resolution unit selects the identity allocation scheme with the lowest cost based on identity code distance, trajectory smoothness, and spatial topology consistency index. A method for intelligent monitoring of poultry behavior includes: S1 generates a spatiotemporal encoded light field on the aquaculture ground through the encoded light field generation module and completes the geometric calibration of the camera and the ground grid so that it can be accurately mapped from the image space to the ground grid index space in the future, while recording the encoded bits corresponding to each grid unit at each moment. S2, the occlusion information extraction module is used to preprocess and segment the acquired poultry image sequence to obtain the poultry foreground mask and the corresponding ground grid-level occlusion mask in each frame, and store them in chronological order to form an occlusion time sequence. S3, within the preset window length, the short-time identity code decoding unit in the identity persistence reconstruction module combines the ground grid index covered by each poultry within the time window with the corresponding encoded bits to form a window-level identity code fragment with an error correction structure. S4, the trajectory splicing unit is used to associate trajectories between adjacent time windows based on the similarity of window-level identity code fragments and the constraints of poultry movement speed, connecting local trajectories into long-term identity trajectories, and calling the conflict resolution unit to select a unique identity allocation using a global cost function when there is an identity conflict. S5. Repeat steps S2 to S4 throughout the entire monitoring period to continuously update the identity code stream and trajectory of each poultry, and output the results of continuous identity tracking to the behavior analysis module for statistical analysis of individual behavior indicators. S1 specifically refers to: S1-1. After installing the camera and projection light source, establish a coordinate system based on the ground of the main activity area of ​​the farm, along... Directional division Go, along Directional division Column, get The first regular grid cell, the... Line number Column grid cells are denoted as Each grid cell has an adjacent and aligned boundary on the ground, with no overlapping areas, so that any point on the ground belongs to only one grid cell. This ensures that subsequent statistics on ground illumination and shading have a clear spatial attribution. S1-2, For each grid cell Generate a segment of length binary time-coded sequence ,in For time indexing, The value at each time index is either 0 or 1, and the time-coded sequence at each time point... One 3D binary encoded vector The time-coded sequence of all grid cells is generated through a linear feedback shift register, which employs a pre-selected feedback polynomial and applies it to different grid cells. Different initial states are assigned to obtain different binary sequences. During the design process, the feedback polynomial and initial states are selected to ensure that the Hamming correlation between any two sequences corresponding to different grid indices at any alignment position is lower than a preset threshold. This ensures that the time coding modes of different grids are significantly different, providing sufficient redundancy for subsequent grid differentiation based on occlusion patterns; The principle behind this invention is to first divide the breeding ground into a regular grid, and then assign each grid a time-coded sequence with low Hamming correlation. This is equivalent to laying an invisible time QR code on the ground. Knowing the current time and grid index, the theoretical brightness state at that location can be calculated. This step transforms the originally uniform and monotonous ground into a continuously flashing coded light field on the time axis, laying the groundwork for subsequent reverse decoding of individual paths using occlusion behavior. Compared to traditional methods of directly finding features on poultry, this approach transfers identity information to the ground light field, allowing poultry to write their identity through movement and occlusion. This reversal in carrier selection makes identity encoding no longer dependent on individual appearance, making it particularly suitable for high-density homogeneous groups.

[0018] S1-3, at discrete acquisition times When acquiring images at the location, The brightness control signal used as the projection light source corresponds to the grid. At any moment ground brightness Calculate according to the following formula: ,in This refers to the high brightness value output by the projection light source. This refers to the low brightness value output by the projection light source. When the value is 1, the ground brightness at this grid point is close to ,when When the value is 0, the ground brightness at this grid point is close to Subsequently, a calibration board with a regular pattern was placed on the ground, and calibration images were acquired. The intrinsic and extrinsic parameters of the camera were calculated using the known geometric point coordinates on the calibration board and the corresponding pixel coordinates in the images, thus obtaining the ground plane coordinates of a certain ground point. Mapping to image plane coordinates homography matrix The mapping relationship is represented as ,in To map ground plane coordinates to image plane coordinates using a 3×3 homography matrix, each grid cell... Substituting the coordinates of the ground center point into the above formula, we obtain the corresponding pixel region of the grid in the image, thereby establishing a one-to-one correspondence between the grid index and the image pixel set in the system. S2 specifically refers to: S2-1. The acquired original image sequence Preprocessing operations are performed, including spatial denoising, white balance correction, and brightness normalization, to obtain a preprocessed image sequence. ,in and Given pixel coordinates in the image plane, using camera intrinsics... Distortion correction is performed to eliminate radial and tangential distortion, resulting in a distortion-corrected image sequence. Then, a background modeling algorithm is used to... Processing is performed, for example, using a foreground extraction method based on a Gaussian mixture model, to obtain the poultry foreground mask corresponding to each frame. In the foreground mask, pixels with a value of 1 are identified as the poultry foreground region, and pixels with a value of 0 are identified as the background region. Through the above processing, the complex original image is transformed into an image with clear separation between the foreground and background. S2-2, Using homography matrix Will Each pixel coordinate Mapping to ground plane coordinates to obtain the corresponding grid index. Map all to the same grid cell The set of pixels is denoted as For each grid cell And every frame Calculate the set in the frame Average observed brightness The average observed brightness is calculated according to the following formula. ,in For set The number of pixels in the middle, Represents a set The brightness of all pixels is summed to extract the average brightness in grid units from the complex brightness distribution at the pixel level. S2-3, Theoretical ground brightness Compared with average observed brightness Comparison, defining grid-level occlusion indicators ,when At that time, it is considered that the grid cell exist Constantly being hidden by poultry, The threshold value is 1 if it is not 1, and 0 otherwise. Pre-calibrated based on projection brightness fluctuations and ground reflection characteristics, then combined with poultry foreground masks. The foreground region is divided into multiple independent poultry regions using a connected component segmentation algorithm. For each poultry region, the set of grid indices covered by that region is counted. That is, the grid position corresponding to each poultry in each frame is recorded, thus obtaining the poultry occlusion mask in grid units. The theoretical brightness given by the coded light field is compared with the average brightness of the preprocessed image at the grid scale. Whether the difference exceeds a threshold determines if the grid is occluded by poultry at the current moment. Combined with a foreground mask, these occluded grids are then assigned to specific poultry. This step in the overall scheme rigorously quantifies the previously blurred question of which area of ​​the ground is occluded into a grid-level binary occlusion sequence, providing each poultry with a time-varying ground occlusion trajectory. Unlike traditional methods that only extract local features from image edges and textures, this approach actively compares theoretical and measured brightness, tightly binding projection coding and actual occlusion together. It refines noisy grayscale variations into structured occlusion signals, transforming brightness deviations, usually considered interference, into a carrier of identity coding.

[0019] S3 specifically refers to: S3-1, Set the time window length as follows Frame, window index is , No. The frame range covered by each time window is For each poultry The occlusion masks within this time window are accumulated chronologically, recording each poultry. The set of grid indices covered by each frame within the window reflects the sequence of ground grids traversed by the poultry within the window, and the time window length. The selection is based on the camera frame rate and the movement speed of poultry. It is necessary to ensure that the window contains enough grid switching information, while avoiding the window being too long and causing the identity change to be too slow. S3-2, For each poultry In the Construct a window-level identity code vector within a time window. Let the dimension of this vector be denoted as , among which dimension The length of the time-coded sequence in S1-2 Same, the first Dimensional components are denoted as ,in And it is an integer. ,in For grid cells In dimensions The corresponding coding component is understood as the grid in the multidimensional coding space at time t. The first Each encoded bit value This is an occlusion indicator; a value of 1 indicates that the grid is occluded by poultry at that moment. The poultry are then occluded using the formula described above. The encoded values ​​of all occluded grids passed through the entire time window are weighted and accumulated to obtain a multi-dimensional encoded vector that is strongly correlated with its motion path; S3-3, For vectors Normalization and quantization are performed to map the real number vectors to the binary code space to obtain discrete identity code fragments. Normalization involves subtracting the mean from each component and then dividing by the standard deviation. Quantization maps continuous values ​​to 0 and 1 by comparing them using dimensional thresholds. Through the design of the thresholds and normalization methods, it is possible to determine the normalization of any two different poultry. and Identity code fragments within the same time window and The Hamming distance between them is greater than the preset lower bound. At the same time, it ensures that the change range of the identification code segment of the same poultry in adjacent windows is small, thus ensuring both the distinguishability between individuals and the continuity of the identification code of a single individual over time, providing a foundation for subsequent identification association and error correction based on distance metric; The process involves accumulating all occlusion grids and their encoded sequences traversed by each poultry within a time window to form a high-dimensional vector. This vector is then normalized and quantized to map into a discrete identity code fragment. This identity code fragment exhibits characteristics similar to error-correcting codes: the code fragments of different individuals have large intervals in Hamming space, while the code fragments of the same individual show little variation across windows. This step in the overall scheme compresses continuous movement and occlusion behaviors into short, high-information-density code fragment sequences, providing a solid foundation for subsequent global identity association. Compared to traditional methods that perform fuzzy similarity comparisons in feature space, this invention designs behavioral paths as codewords with clear spacing and redundancy, transforming the identity problem from similarity to codeword consistency, and converting complex spatiotemporal trajectories into a binary codestream that is easy to optimize through combinatorial analysis.

[0020] S4 specifically refers to: S4-1. After completing the calculation of the identity code segment for each time window, perform calculations for adjacent time windows. and Matching candidate trajectories belonging to the same camera's field of view, for any one originating from a window trajectory and any one from the window trajectory Calculate the distance of the identity code ,in For trajectory In the window The first in Segment of identity code For trajectory In the window The first in Segment of identity code Hamming distance is the distance between two code segments, which is the number of different bit values ​​at the same bit position. The weighting coefficients for different segments are adjusted. Emphasis is placed on code segments that are more sensitive to identity stability, thereby improving the ability to distinguish identities; S4-2. Simultaneously calculate the motion smoothing cost based on the centroid position sequence of poultry in the image plane. Let the trajectory In the window The centroid position of the last frame within is trajectory In the window The centroid position of the first frame within is ,but , representing the Euclidean distance between two points, can be calculated directly by mapping the centroid coordinates to planar coordinates in pixels, provided that the distance does not exceed the maximum speed. Window time interval The product of these factors eliminates erroneous associations that do not conform to the normal movement speed of poultry. S4-3. Constructing the global cost function The identity code distance and motion smoothing cost are combined for unified optimization across all candidate trajectories. ,in For the set of all trajectory pairs to be associated, , To balance the weighting coefficients of identity code distance and motion cost, the solution is obtained by solving the problem in the set of all trajectory pairs that satisfy the one-to-one matching constraint. The minimum association result yields the optimal trajectory association set. ,Will Each pair of trajectories is considered a continuation of the identity of the same poultry in adjacent windows. During the solution process, for cases where multiple trajectories compete for the same objective, the trajectory pairings are adjusted within a local region and the cost functions are compared. The increment, the choice that enables The minimum trajectory allocation scheme is added as the final result, thereby ensuring the rationality and stability of identity association as a whole; A global cost function is constructed that simultaneously considers identity code distance and motion cost. Under the premise of satisfying the one-to-one matching constraint, the trajectory pairing set with the minimum cost is solved globally, and local conflicts are adjusted according to the principle of minimizing cost increment. This step plays the role of overall scheduling in the scheme, concatenating local identity code fragments within each time window into a long-term trajectory, and making a global decision when conflicts occur. Compared with traditional local greedy matching, this approach introduces the strong constraint of identity code into the global optimization framework, which takes into account both motion continuity and codeword consistency. The multi-target tracking result is treated as a combinatorial optimization problem, and a cost function with identity redundancy is used to correct errors globally, automatically pulling short-term chaos back to the correct track.

[0021] S5 specifically refers to: S5-1, Monitor each poultry throughout the entire monitoring period. Accumulate the sequence of identity code fragments across all time windows. Simultaneously, the centroid position is accumulated in each frame of the image. The above two parts of information are combined to form a description of poultry. The identity code stream and trajectory record of long-term behavior: the identity code stream records the changes in the encoding pattern of poultry in each time window, and the trajectory records the spatial location changes of poultry in the entire breeding area. Together, they constitute a complete description of the long-term behavior of poultry. S5-2. When poultry leaves the current camera's field of view for a period of time and then re-enters any camera's field of view, select the continuous sequence after its re-entry. The observed identity code fragments within a time window are used as query sequences. These query sequences are then compared window-by-window with the identity code streams of all poultry in the historical identity database. For the current poultry... and historical identity Calculate the re-identification cost function ,in For current poultry in the first A fragment of the identity code for each window. For historical identity The identity code fragment at the same window index, For different windows, the importance weighting coefficients are used. The Hamming distance between corresponding window identity code fragments is calculated for all historical identities. The identity with the lowest cost is selected as the current poultry's identity marker, thereby completing cross-field and long-term scale identity re-identification and ensuring that the identity of the same poultry remains consistent after leaving and re-entering. S5-3. After re-identification, the identity code stream and trajectory record are continuously output to the upper-level behavior analysis module. In this module, the feeding time, activity level, rest duration and frequency of abnormal behavior of each poultry are statistically analyzed based on the trajectory record throughout the entire breeding cycle. At the same time, the identity code stream is used to backtrack and correct any possible identity interruptions. When the identity is found to be discontinuous in a local time period, the optimal identity sequence can be recalculated using the identity code fragments from the previous and next windows. This allows the system to provide reliable long-term behavior data of individual animals even under high-density breeding conditions.

[0022] This method utilizes the accumulated identity code stream of each poultry over a long period as a persistent identity fingerprint. When a poultry re-enters the field of vision, the identity code fragment within the most recent time window is used as a query. This fragment is compared window-by-window with the code stream in the historical identity database. By solving the re-identification cost function, the historical identity with the smallest distance is selected. This step plays a crucial role in the overall scheme by remembering who has left and who has returned, truly extending identity persistence to scenarios across fields of view and long time periods, allowing the behavioral statistics of a single individual to span the entire breeding cycle. Compared to traditional re-identification methods that rely on appearance, this re-identification relies on the historical identity code accumulated from the previously encoded light field and occlusion path. It transforms ordinary walking and occlusion behaviors into long-term retrievable identity credentials, enabling the stable differentiation of details such as the same chicken returning even among individuals with completely similar appearances.

[0023] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0024] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A poultry behavior intelligence monitoring system characterized by: The application comprises an encoding light field generation module, an occlusion information extraction module, and an identity persistence reconstruction module. The encoding light field generation module is used to generate a light distribution with space-time encoding characteristics on a breeding ground and provide a synchronous encoding index to an image processing end. The occlusion information extraction module is used to segment a poultry foreground area from a collected poultry image sequence and deduce an occlusion distribution of a corresponding ground position. The identity persistence reconstruction module is used to construct a poultry identity code stream based on the occlusion distribution and the encoding index and continuously reconstruct an identity track on a long time scale.

2. The poultry behavior intelligent monitoring system according to claim 1, characterized in that: The encoding light field generation module comprises a ground grid division unit, an encoding sequence generation unit, a light field geometry calibration unit, and a projection light source. The ground grid division unit divides the breeding ground into regular grids and assigns a fixed index to each grid unit. The breeding ground has a ground reflection layer with a predetermined reflection characteristic, which is used to generate a reflection brightness corresponding to the encoding brightness under the irradiation of the encoding light field. The encoding sequence generation unit generates a binary time encoding sequence with low correlation for each grid index and drives the projection light source to output a brightness pattern in the corresponding grid area. The light field geometry calibration unit estimates the relative position parameters of the camera and the projection light source based on a calibration board image and establishes a mapping relationship between the ground grid index and the image pixel coordinates. The controller drives the projection light source to output different light and dark patterns in each grid area according to the encoding sequence. The occlusion information extraction module comprises a foreground segmentation unit, a ground mapping unit, and an occlusion feature accumulation unit. The foreground segmentation unit performs background modeling and poultry segmentation on the input image sequence to obtain a poultry foreground mask for each frame. The ground mapping unit converts the poultry foreground mask into a ground grid level occlusion mask using the geometric mapping relationship. The occlusion feature accumulation unit extracts the occlusion state of each grid over time based on the ground grid level occlusion mask and forms the basis data for subsequent decoding. The identity persistence reconstruction module comprises a short-time identity code decoding unit, a track splicing unit, and a conflict resolution unit. The short-time identity code decoding unit calculates the window level identity code segment of each poultry within a given time window based on the occlusion feature and the encoding index. The track splicing unit splices the local track to generate a long-time identity track based on the identity code segment and the motion constraint between adjacent time windows. The conflict resolution unit selects the identity assignment scheme with the minimum cost based on the identity code distance, the track smoothness, and the spatial topological consistency index when there is an identity conflict.

3. A method of intelligent monitoring of poultry behavior from a system according to claim 2, characterized by: The application comprises the following steps: S1. Generate a space-time encoding light field on a breeding ground by the encoding light field generation module and complete the geometric calibration of the camera and the ground grid, so as to accurately map from the image space to the ground grid index space subsequently, and record the corresponding encoding bits of each grid unit at each time; S2. Preprocess and segment the foreground of the poultry image sequence obtained by the occlusion information extraction module to obtain the poultry foreground mask in each frame and the corresponding ground grid level occlusion mask, and store them in time sequence to form an occlusion time sequence. S3, combining the ground grid index covered by each poultry in the time window with the corresponding encoding bits to form a window-level identity code segment with error correction structure by using a short-time identity code decoding unit in the identity persistence reconstruction module within a preset window length; S4, connecting local trajectories into long-time identity trajectories by using a trajectory splicing unit according to the similarity of window-level identity code segments and the speed constraint of poultry movement between adjacent time windows, and calling a conflict resolution unit to select a unique identity allocation by using a global cost function when there is an identity conflict; S5, continuously repeating steps S2 to S4 in the whole monitoring period to continuously update the identity code stream and trajectory of each poultry, and outputting the identity persistence tracking result to a behavior analysis module for statistical individual behavior indicators.

4. The poultry behavior intelligent monitoring method according to claim 3, characterized in that: The S1 is specifically: S1-1. After installing the camera and projection light source, establish a coordinate system based on the ground of the main activity area of ​​the farm, along... Directional division Go, along Directional division Column, get The first regular grid cell, the... Line number Column grid cells are denoted as Each grid cell has an adjacent and aligned boundary on the ground, with no overlapping areas, so that any point on the ground belongs to only one grid cell. This ensures that subsequent statistics on ground illumination and shading have a clear spatial attribution. S1-2, for each grid cell generating a binary time encoding sequence of length wherein is a time index, the value at each time index is any one of 0 and 1, and the time encoding sequence at each time instant corresponds to a dimensional binary encoding vector all grid time encoding sequences are generated by a linear feedback shift register with a pre-selected feedback polynomial and different initial states are assigned to different grid cells so as to obtain different binary sequences, in the design process, by selecting the feedback polynomial and the initial state, the Hamming correlation of the sequences corresponding to any two different grid indexes at any alignment position is lower than a pre-set threshold , so that the time encoding patterns of different grids are obviously different, providing sufficient redundancy for subsequent distinguishing of grids according to the occlusion pattern.​ S1-3, at discrete acquisition times When acquiring images at the location, The brightness control signal used as the projection light source corresponds to the grid. At any moment ground brightness Calculate according to the following formula: ,in This refers to the high brightness value output by the projection light source. This refers to the low brightness value output by the projection light source, when When the value is 1, the ground brightness at this grid point is close to ,when When the value is 0, the ground brightness at this grid point is close to Subsequently, a calibration board with a regular pattern was placed on the ground, and calibration images were acquired. The intrinsic and extrinsic parameters of the camera were calculated using the known geometric point coordinates on the calibration board and the corresponding pixel coordinates in the images, thus obtaining the ground plane coordinates of a certain ground point. Mapping to image plane coordinates homography matrix The mapping relationship is represented as ,in To map ground plane coordinates to image plane coordinates using a 3×3 homography matrix, each grid cell... Substituting the coordinates of the ground center point into the above formula, we obtain the corresponding pixel region of the grid in the image, thereby establishing a one-to-one correspondence between the grid index and the image pixel set in the system.

5. The poultry behavior intelligent monitoring method according to claim 4, characterized in that: The S2 is specifically: S2-1, the original image sequence collected is pre-processed The pre-processing operation is performed, including spatial denoising processing, white balance correction and brightness normalization, to obtain the image sequence after pre-processing , wherein and is the pixel coordinate in the image plane, and the radial distortion and tangential distortion are eliminated by using the camera internal parameter to perform distortion correction on , to obtain the image sequence after distortion correction Then, the background modeling algorithm is used to process , for example, the foreground extraction method based on Gaussian mixture model, to obtain the poultry foreground mask corresponding to each frame In the foreground mask, the pixel with the pixel value of 1 indicates the pixel that is determined as the poultry foreground region, and the pixel with the pixel value of 0 indicates the pixel that is determined as the background region, and through the above processing, the complex original image is converted into the image with clear separation between the foreground and the background. S2-2, Using homography matrix Will Each pixel coordinate Mapping to ground plane coordinates to obtain the corresponding grid index. Map all to the same grid cell The set of pixels is denoted as For each grid cell And every frame Calculate the set in the frame Average observed brightness The average observed brightness is calculated according to the following formula. ,in For set The number of pixels in the middle, Represents a set The brightness of all pixels is summed to extract the average brightness in grid units from the complex brightness distribution at the pixel level. S2-3, Theoretical ground brightness Compared with average observed brightness Comparison, defining grid-level occlusion indicators ,when At that time, it is considered that the grid cell exist Constantly being hidden by poultry, The threshold value is 1 if it is not 1, and 0 otherwise. Pre-calibrated based on projection brightness fluctuations and ground reflection characteristics, then combined with poultry foreground masks. The foreground region is divided into multiple independent poultry regions using a connected component segmentation algorithm. For each poultry region, the set of grid indices covered by that region is counted. That is, the grid position corresponding to each poultry in each frame is recorded, thus obtaining the poultry occlusion mask in grid units.

6. The poultry behavior intelligent monitoring method according to claim 5, characterized in that: The S3 is specifically: S3-1, Set the time window length as follows Frame, window index is , No. The frame range covered by each time window is For each poultry The occlusion masks within this time window are accumulated chronologically, recording each poultry. The set of grid indices covered by each frame within the window reflects the sequence of ground grids traversed by the poultry within the window, and the time window length. The selection is based on the camera frame rate and the movement speed of poultry. It is necessary to ensure that the window contains enough grid switching information, while avoiding the window being too long and causing the identity change to be too slow. S3-2, for each poultry constructing a window-level identity code vector within the first time window , let the dimension of the vector be , where the dimension is the same as the length of the time encoding sequence in S1-2 , and the th component be , where and is an integer, , where is the grid cell at time , the corresponding encoding component in dimension is understood as the th encoding bit value carried by the grid at time , and is the occlusion indicator, taking value 1 if the grid is occluded by the poultry at the time, the encoding values of all the occluded grids passed by the poultry within the whole time window are accumulated with weights, obtaining a multi-dimensional encoding vector strongly related to the motion path of the poultry; S3-3, to the vector The real number vector is mapped to the binary code space by normalization and quantization to obtain the discrete identity code segment Normalization is to subtract the mean value of each dimension component and then divide by the standard deviation, and quantization is to map continuous values to 0 and 1 by comparing with the threshold value by dimension, through the design of threshold value and normalization method, the Hamming distance between the identity code segments of any two different poultry and in the same time window and is greater than the preset lower limit , while ensuring that the change range of the identity code segment of the same poultry in adjacent windows is small, thereby ensuring the distinguishability between individuals and the continuity of the identity code of a single individual in time, providing a basis for subsequent identity association and error correction based on distance measurement.

7. The method of claim 6, wherein: The S4 is specifically: S4-1. After completing the calculation of the identity code segment for each time window, perform calculations for adjacent time windows. and Matching candidate trajectories belonging to the same camera's field of view, for any one originating from a window trajectory and any one from the window trajectory Calculate the distance of the identity code ,in For trajectory In the window The first in Segment of identity code For trajectory In the window The first in Segment of identity code Hamming distance is the distance between two code segments, which is the number of different bit values ​​at the same bit position. The weighting coefficients for different segments are adjusted. Emphasis is placed on code segments that are more sensitive to identity stability, thereby improving the ability to distinguish identities; S4-2. Simultaneously calculate the motion smoothing cost based on the centroid position sequence of poultry in the image plane. Let the trajectory In the window The centroid position of the last frame within is trajectory In the window The centroid position of the first frame within is ,but , representing the Euclidean distance between two points, can be calculated directly by mapping the centroid coordinates to planar coordinates in pixels, provided that the distance does not exceed the maximum speed. Window time interval The product of these factors eliminates erroneous associations that do not conform to the normal movement speed of poultry. S4-3, constructing global cost function combining the identity code distance and motion smoothness cost together for unified optimization among all candidate trajectories, wherein is the set of all to-be-associated trajectory pairs, is the weight coefficient for balancing the influence of identity code distance and motion cost, the optimal trajectory association set is obtained by solving the association result that makes minimum in all trajectory pairs satisfying one-to-one matching constraint each pair of trajectories in is regarded as the identity continuation of the same poultry in adjacent windows, in the solving process, for the case where multiple trajectories exist and simultaneously compete for the same target, by adjusting the trajectory pairing in the local area and comparing the increment of the cost function , the trajectory allocation scheme that can make increase minimum is selected as the final result, thereby ensuring the rationality and stability of identity association as a whole.​ 8. The method of claim 7, wherein: The S5 is specifically: S5-1, accumulating the identity code fragment sequence of each poultry in each time window accumulating the identity code fragment sequence of each poultry in each time window simultaneously accumulating the centroid position in each frame of image combining the above two parts of information to form the identity code stream and trajectory record describing the long-term behavior of the poultry the identity code stream records the encoding mode change of the poultry in each time window, and the trajectory record records the spatial position change trajectory of the poultry in the whole breeding area, which together constitute a complete description of the long-term behavior of the poultry S5-2, when the poultry enters any camera field of view again after leaving the current camera field of view for a period of time, the identity code fragments observed in the continuous time window after reentry are selected as a query sequence, the query sequence is compared with the identity code streams of all poultry in the historical identity library in a window-by-window manner, and the re-identification cost function is calculated for the current poultry and the historical identity , wherein is the identity code fragment of the current poultry in the i-th window, is the identity code fragment of the historical identity at the same window index, is the importance weight coefficient of different windows, is the Hamming distance between the identity code fragments of the corresponding windows, and is calculated for all historical identities, and the identity with the minimum cost is selected as the identity marker of the current poultry, so that the identity re-identification across the field of view and the long time scale is completed, and it is ensured that the identity of the same poultry remains consistent after leaving and re-entering.​​​​ S5-3, continuously outputting the identity code stream and trajectory record after completing re-identification to an upper behavior analysis module, calculating the feeding time, activity level, resting time and abnormal behavior frequency of each poultry in the whole breeding cycle in the module, and simultaneously performing backtracking and error correction on possible identity interruption according to the identity code stream, so that when discovering that the identity is discontinuous in a local time period, the optimal identity sequence can be recalculated by using the identity code segments of the front and rear windows, so that the system can still provide reliable long-term behavior data of a single individual under high-density breeding conditions.