Simulated regulatory labeled landes goose counting span measurement method, system and application

By generating a goose flock scene through simulation control, and automatically generating labels using a six-item scene randomization control mechanism and a camera projection model, a simulation dataset is constructed. This solves the problem of automated statistics for goose flocks, realizes automated span measurement of goose flocks, and solves the problems of high manual labor intensity and large statistical errors in existing technologies.

CN122391341APending Publication Date: 2026-07-14WEST ANHUI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WEST ANHUI UNIV
Filing Date
2026-06-17
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing technologies for goose flock counting suffer from high manual labor intensity, large statistical errors, low efficiency, and difficulty in achieving real-time monitoring and intelligent management. Furthermore, the lack of high-quality visual detection datasets for goose flocks makes it difficult to train detection models.

Method used

By generating a flock of geese through simulation and control, and automatically generating annotations using a six-item scene randomization control mechanism and a camera projection model, a simulation training dataset is constructed. Combined with a visual tracking algorithm, target detection and counting are performed to achieve automated span measurement.

Benefits of technology

It reduces the cost of data collection and labeling, improves the accuracy and generalization ability of data, realizes the automated detection and accurate numbering of goose flocks, solves the problem of automated span measurement methods, adapts to the statistical needs of large-scale farms, meets the statistical needs of complex environments, solves the statistical problems existing in the existing technology, and realizes the automated span measurement of goose flocks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391341A_ABST
    Figure CN122391341A_ABST
Patent Text Reader

Abstract

The application discloses a span measurement method and system for labeling and counting Landes geese in simulation regulation, and application, relates to the span measurement field, and the application generates a simulation goose group scene consistent with the appearance characteristics of Landes geese, and generates large-scale and diversified training image data by using a scene randomization mechanism; subsequently, a high-consistency target detection label is obtained by an automatic labeling method, and a simulation training data set is constructed; on the basis, a visual detection model is trained, and is applied to a real goose group video scene; finally, in combination with a target tracking and over-the-line counting method, automatic detection and quantity statistics of the goose group are realized; compared with a traditional mode of relying on manual collection and manual labeling, the data acquisition and labeling cost can be significantly reduced, the training data scale and consistency are improved, goose group image data is generated in batches, and detection labeling is automatically generated, so that the training data is rapidly constructed, and the real data collection cost and manual labeling cost are greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of span measurement, and more specifically, it relates to a method, system and application for span measurement of labeled Landes geese with simulation control. Background Technology

[0002] With the rapid development of smart farming technology, the use of computer vision technology for automatic identification and counting of poultry has become an important research direction in modern animal husbandry. In traditional goose farming, the counting of goose flocks usually relies on manual inspection. This method is not only labor-intensive, but also prone to statistical errors in large-scale farming environments, making it difficult to achieve real-time monitoring and intelligent management. At the same time, manual counting is inefficient and cannot meet the needs of modern smart farming for automated and information-based management. Therefore, how to use computer vision technology to achieve automatic detection and counting of goose flocks has become an important research problem in the field of smart farming. In recent years, with the development of deep learning technology, object detection algorithms based on convolutional neural networks have made significant progress in the field of agricultural vision. For example, the YOLO series of object detection algorithms have been widely used in agricultural monitoring, animal detection, and intelligent breeding scenarios due to their advantages such as fast detection speed and strong real-time performance. However, several technical challenges still exist in the task of goose detection and counting. First, training deep learning models typically requires a large amount of high-quality labeled data; however, in actual goose farming scenarios, collecting large-scale training data is costly; the goose farming environment is complex, and geese have a wide range of activity, so collecting stable and clear video data requires long-term deployment of monitoring equipment; at the same time, in dense goose flocks, geese are prone to occlusion, which increases the difficulty of data collection; therefore, obtaining a large amount of high-quality goose flock image data has become an important limiting factor for training visual detection algorithms. Secondly, manual data annotation is costly. In the process of building traditional datasets, it is necessary to manually annotate the bounding boxes of each goose in the image frame by frame. When there are a large number of geese, the annotation workload is huge, which not only takes a lot of time, but is also easily affected by human factors, resulting in errors in the annotation results. In addition, manual annotation is not stable and may vary greatly between different annotators, thus affecting the quality of training data. Third, in real-world farming environments, geese are often densely distributed; multiple geese can easily obscure each other during their activities, making it difficult for target detection algorithms to accurately identify the location of each goose; at the same time, the geese in the flock look similar and have little difference in size, which further increases the difficulty of detection; in addition, changes in lighting, ground texture, and background interference in the farming environment can also affect visual detection algorithms. Fourth, currently available poultry visual datasets mainly focus on broiler or laying hen scenarios, while there are few datasets for goose farming environments, especially for the Landes goose, an introduced breed; this to some extent limits the research and application of related visual detection technologies in the field of goose farming. Summary of the Invention

[0003] To address the problems in related technologies, this invention proposes a simulation-controlled span measurement method, system, and application for counting Landes geese, in order to overcome the aforementioned technical problems existing in the current related technologies.

[0004] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: This invention provides a span measurement method for simulated and controlled Landes goose counting, comprising the following steps: S1. Conduct morphological feature analysis and generate goose targets in batches in the simulation environment, adjust parameters to construct different distribution goose flock scenarios; introduce six scenario randomization control mechanisms to generate multiple types of goose flock sample images accordingly. The six scene randomization control mechanisms are randomization of goose flock size, randomization of goose flock spatial distribution, randomization of camera height and shooting angle, randomization of light intensity and light direction, randomization of target occlusion degree, and randomization of scene background parameters. S2. Based on the camera projection model and the corresponding mapping formula, the three-dimensional coordinates of the simulated goose target are mapped to the two-dimensional image plane to obtain the projection coordinates. Based on this, the target detection box annotation information is calculated and generated. Then, the sample images and annotation information in S1 are integrated to form the final simulation training dataset. S3. The visual detection model is trained using the final simulation training dataset and deployed. Video is collected frame by frame to generate goose detection boxes. The center point of the bottom edge of the detection box is used as the target location point. Then, a unique identifier is assigned to each goose in combination with the target tracking method. S4. Based on S3, set counting lines in the image and measure the span of the target location point; The target location point is set at the 1st t Position in the frame for: ; in, , These represent the target location points at the [number]th position. t The x and y coordinates of the position within the frame; Set the vertical coordinate position of the counting line as The target location point is at the th t The span of a frame is: .

[0005] This invention effectively reduces the cost of collecting data on wild goose flocks by combining simulation-based database construction with visual tracking span measurement. By adjusting parameters to construct differentiated goose flock distribution scenarios and employing a six-scenario randomization control mechanism, it can flexibly generate simulated samples with varying density, posture, and environment, enriching the scenario dimensions of the dataset and avoiding the shortcomings of single-scenario and scarce samples in real-world collection. This enhances the generalization ability of the dataset and helps the detection model adapt to complex field environments. Automatic annotation is generated using camera projection, eliminating manual plotting and ensuring annotation accuracy. After assigning a unique identifier to each goose using a tracking algorithm, span measurement is performed at the target location point. Combined with a preset counting line, accurate individual identification is achieved, avoiding double counting and missed counting caused by overlapping geese and their back-and-forth movement. The entire solution reduces the investment in on-site sampling and manual annotation, improves the accuracy of automated goose flock span measurement, and meets the needs of large-scale farm field inspection and statistics. Span measurement involves measuring the displacement of the ordinate of the target location point.

[0006] Preferably, step S1 includes the following steps: S11. Using the real appearance characteristics of Landes geese as a reference, and based on this, analyze the morphological characteristics of geese (including body proportions, head and neck structure, feather color distribution, and overall outline); after the feature analysis is completed, generate multiple goose targets in the simulation environment, and form a goose flock scene by controlling the number, position, and posture; the process of generating the simulated goose flock does not rely on manual shooting and labeling of each goose, but rather on generating goose targets in batches in the virtual scene, thereby achieving rapid construction of training data; Let the simulation scenario be the first i The position of the goose in three-dimensional space is: ; in, , , They represent the first i The three-dimensional spatial coordinates of a goose in the simulation scene; to simulate the discrete distribution of individual geese in a real breeding environment, the positions of the goose targets are generated using a random distribution method: ; ; in, Represents the uniform distribution function. , , , These represent the boundary ranges of the simulation scene in the horizontal and vertical directions, respectively. The distribution state of the goose flock scene (sparse, medium density, and high density, etc.) is set by adjusting the spatial range parameter and the number of generated parameters; Furthermore, in the simulation environment, the orientation, body posture, and local movement state of the goose target can be varied to simulate the appearance differences of the goose flock under different movement states, thereby improving the diversity of simulation data. S12. Six scene randomization control mechanisms are introduced into the simulation scene; the six scene randomization control mechanisms are randomization of the number of geese, randomization of the spatial distribution of geese, randomization of camera height and shooting angle, randomization of light intensity and light direction, randomization of target occlusion degree and randomization of scene background parameters. Then, based on the aforementioned scenario randomization control mechanism, multiple goose flock training samples are generated to obtain the initial simulation training dataset; Specifically, let the simulated image be... The image after scene randomization can be represented as: ; in, This represents the scene randomization mapping function. θ The randomization parameter set; the randomization parameter set can be represented as: ; Where N represents the number of geese; S represents the spatial distribution of the geese; C represents the camera pose; L represents the lighting; O represents the occlusion-related parameters; and B represents the scene background parameters. By using this scenario randomization method, the simulation system can generate large-scale and diverse goose training samples in batches to form a simulation training dataset. Because Landes geese have relatively distinct body contours and head and neck structure features, their overall appearance is stable, providing a good foundation for visual recognition. By introducing appearance reference information from real Landes geese, the simulated geese can more closely resemble the real objects in terms of overall appearance, body proportions, and contour features, thereby reducing the domain differences between simulated and real data and ensuring a high degree of consistency between simulated data and real goose flock scenes. In addition, to enhance the richness and practicality of the generated simulated data, by combining and varying the above parameters, simulated image data under various conditions can be generated, allowing the training samples to cover a wider range of scene distributions, thereby enhancing the robustness and adaptability of the visual detection model in real breeding environments.

[0007] Preferably, step S2 includes the following steps: S21. In the process of constructing traditional target detection datasets, it is usually necessary to manually annotate the bounding boxes of each target in the image one by one, which is labor-intensive and easily affected by human subjective factors. This invention takes advantage of the fact that the spatial position of the Landes goose target in the simulation environment is known and proposes an automatic annotation generation method. Specifically, in the simulation environment, the three-dimensional spatial position and boundary range of each goose can be obtained; based on the camera projection model, the three-dimensional position information of the goose targets in the simulation training dataset is mapped onto the two-dimensional image plane to obtain the coordinates of the projection points; then, the target detection box is automatically generated to obtain the annotation information; The mapping relationship between the three-dimensional position information and the two-dimensional image plane is as follows: ; in, K For the camera intrinsic parameter matrix, R For rotation matrix, t Let be the translation vector, ( X , Y , Z () represents the coordinates of the target in three-dimensional space. u , v () represents the projected coordinates of the target in the two-dimensional image; The process of calculating the correlation between projected coordinates and the target detection box is as follows: In the simulation environment, each goose is tightly enclosed by a 3D bounding box containing 8 vertices. Using the aforementioned camera projection model matrix formula, these 8 3D vertices are projected onto the 2D image plane to obtain 8 sets of 2D projection points. ; The two-dimensional bounding box of the target in the image is the smallest bounding rectangle that can contain these 8 projection points. Therefore, the coordinates of the top left corner of the target bounding box are... and the coordinates of the bottom right corner The relationship with the coordinates of the projection point is as follows: ; ; ; ; Then, based on the coordinates of the projection points, the parameters of the target two-dimensional bounding box are calculated; S22. Combine the initial simulation training dataset and the annotation information to obtain the final simulation training dataset; the dataset can be further divided into training set, validation set and test set to meet the needs of visual detection model training and evaluation. The above-mentioned automatic annotation method can quickly generate large-scale, highly consistent detection annotation data without human intervention, significantly reducing the cost of dataset construction. Furthermore, the simulation training dataset construction method of this invention can form a large-scale, low-cost training sample set with high label consistency in a short period of time, thereby effectively solving problems such as the difficulty in obtaining real goose flock data, the high cost of manual annotation, and the scarcity of public datasets.

[0008] Preferably, the calculation of the target two-dimensional bounding box parameters specifically includes: Set the coordinates of the top left corner of the target detection box to The coordinates of the lower right corner are Then the coordinates of its center point ,Width ,high They are represented as follows: ; ; ; ; If a normalized detection annotation format is used, it can be further expressed as: ; in, W , H These represent the width and height of the two-dimensional image, respectively.

[0009] Preferably, step S3 includes the following steps: S31. After completing the construction of the final simulation training dataset, the visual detection model is trained using the final simulation training dataset. After the training is completed, the final visual detection model is obtained. The final visual detection model is deployed on the video input terminal of the real breeding scene to identify the target position of geese in the video. The visual detection model can be any deep learning detection model suitable for target detection tasks. Through simulation data-driven training, the detection model can be made capable of recognizing real goose flocks. S32. In a real goose scene, video data is collected by a camera, and the final visual detection model is used to detect the images in the video data frame by frame to generate a detection box for each goose, thus obtaining a set of real goose detection boxes. The parameters of the detection boxes in the real goose detection box set are set as follows: ,in, , , , These represent the minimum and maximum coordinates of the detection box in the horizontal direction and the minimum and maximum coordinates in the vertical direction, respectively. To improve the stability of subsequent counting, this invention uses the center point of the bottom edge of the detection box as the target position point, and the coordinates of the target position point are as follows: ; in, Indicates the first i The bottom center point of each detection target; because this point is closer to the contact point between the goose's foot and the ground, it is more suitable as the judgment point for crossing the line than the ordinary geometric center point. S33. In order to obtain the continuous motion trajectory of the target, based on the detection in S32, a target tracking method is further combined to assign a unique identity to each goose and maintain the consistency of the identity between consecutive frames; the target tracking method is the BoT-SORT multi-target tracking algorithm; in S32, the center point of the bottom edge of the detection box is selected as the target position point for trajectory interpolation and line crossing determination. The detailed steps are as follows: The first step is motion state prediction: using a Kalman filter, based on the position and velocity state of the goose detection box in the previous frame, predict its motion bounding box in the current frame; The second step is appearance feature extraction: within the detection box area of ​​the current frame output by the visual detection model, the appearance ReID (target re-identification derived from person re-identification technology) feature vector of each goose is extracted; The third step is to construct the cost matrix: calculate the intersection-over-union ratio (IoU) between the Kalman predicted box and the current detected box, and combine the cosine similarity of the appearance features of the targets in the previous and next frames to fuse spatial and appearance information to construct a multi-dimensional matching cost matrix. The fourth step is data association and identity assignment: The Hungarian Algorithm is used to perform bipartite graph optimal matching on the cost matrix; for successfully matched detection boxes, their identity identifier (TrackID) in the previous frame is inherited; for newly generated detection boxes that fail to match, a new identity identifier is assigned; for trajectories that fail to match for multiple consecutive frames, they are deregistered to release resources; in this way, the motion trajectory of the target in the video sequence can be constructed, providing a basis for subsequent line-crossing counting.

[0010] Preferably, step S4 includes the following steps: S41. After the identity markers are assigned, a counting line is pre-set in the image; after setting, the span of each target location point is measured according to the counting line. The counting line is set as follows: the passable area in the breeding environment is extracted as the region of interest, and a line segment with the same width as the passable area is set along a cross section perpendicular to the main passage direction of the goose flock in the middle section of the region of interest as the counting line.

[0011] This invention also discloses an automated annotation span measurement system for Landes geese counting based on simulation control, including a video source acquisition module, an intelligent target detection module, a multi-target tracking module, and a span measurement module; The video source acquisition module is used to acquire video source data and generate multiple types of goose flock sample images; The intelligent target detection module is used to identify geese in the image and output bounding boxes; The multi-target tracking module is used to assign unique identifiers to associated detection boxes for target tracking; The span measurement module is used to measure the span of the target location point.

[0012] This invention also discloses an application of a simulation-controlled span measurement method for counting Landes geese, which includes the following steps: S5. When the target position point corresponding to the Landes goose moves from one side of the counting line to the other side, it is determined that the target position point has completed one crossing count. Specifically, it includes: The target location point is set at the 1st t The position in the frame is: ; In the t The position in frame +1 is: ; Set the vertical coordinate position of the counting line as The condition for determining if the target location point crosses the line is: ; When the target location point meets the crossing determination condition, it means that the target location point has crossed the counting line between two consecutive frames, completing one count; After completing the training of the detection model and the design of the line-crossing counting method, it was applied to real goose farming videos for verification. With real goose flock videos as input, the system can automatically complete target detection, target tracking and line-crossing counting.

[0013] In practical applications, the direction of the target's movement can be combined to further determine whether it is an entry count or a departure count, thereby realizing the automatic counting of the number of geese entering and leaving the flock.

[0014] The present invention also discloses a Landes goose counting system, including a video source acquisition module, an intelligent target detection module, a multi-target tracking module, a line-crossing counting module, and a statistics and visualization module; The video source acquisition module is used to acquire video source data and generate multiple types of goose flock sample images; The intelligent target detection module is used to identify geese in the image and output bounding boxes; The multi-target tracking module is used to assign unique identifiers to associated detection boxes for target tracking; The line crossing counting module is used to measure, determine, and count the span of the goose target. Statistics and Visualization Module: Used to display the counting results and trajectory lines superimposed on the screen in real time, export CSV data with recorded time, quantity and ID, and record and save labeled inference videos. Sample generation module, training data generation module, goose detection module and counting module; The sample generation module is used to generate multi-class goose flock sample images; The training data generation module is used to construct the final simulation training dataset; The goose detection module is used to capture video frame by frame, detect and generate goose detection boxes, and assign labels to them. The counting module is used to count the number of times a target location point crosses the line.

[0015] The present invention has the following beneficial effects: 1. This invention effectively reduces the cost of collecting data on wild goose flocks by combining simulation-based database construction with visual tracking span measurement. By adjusting parameters to construct differentiated goose flock distribution scenarios and employing a six-scenario randomization control mechanism, it can flexibly generate simulated samples with varying density, posture, and environment, enriching the scenario dimensions of the dataset and avoiding the shortcomings of single-scenario and scarce samples in real-world collection. This enhances the generalization ability of the dataset and helps the detection model adapt to complex field environments. Automatic annotation is generated using camera projection, eliminating manual plotting workload and ensuring annotation accuracy. After assigning a unique identifier to each goose using a tracking algorithm, span measurement is performed at the target location point, and a preset counting line enables accurate individual identification, avoiding duplicate counting and missed counting caused by overlapping geese and their back-and-forth movement. The entire solution reduces the investment in on-site sampling and manual annotation, improves the accuracy of automated goose flock span measurement, and adapts to the field inspection and statistical needs of large-scale farms.

[0016] 2. In this invention, a simulated goose flock scene consistent with the appearance characteristics of Landes geese is generated through a simulation module, and a large-scale, diverse training image data is generated using a scene randomization mechanism. Subsequently, highly consistent target detection labels are obtained through an automatic annotation method, and a simulated training dataset is constructed. Based on this, a visual detection model is trained and applied to real goose flock video scenes. Finally, target tracking and line-crossing counting methods are combined to achieve automatic goose flock detection and number statistics. Compared with traditional methods relying on manual collection and annotation, this invention can significantly reduce data acquisition and annotation costs while improving the scale and consistency of training data. By generating goose flock image data in batches through a simulation environment and automatically generating detection labels based on simulation spatial coordinates, rapid construction of training data is achieved, significantly reducing the cost of real data collection and manual annotation. Furthermore, by utilizing the controllable and repeatable characteristics of the simulation environment, by changing parameters such as the number of geese, spatial location, camera angle, lighting conditions, and occlusion degree, a large number of goose flock samples in different scenes can be quickly generated, greatly improving the scale and diversity of training data.

[0017] 3. In this invention, the target detection box is generated uniformly based on the spatial position and projection relationship in the simulation environment through automatic annotation, which fundamentally avoids the errors caused by the subjectivity of manual annotation.

[0018] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of the invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram of the architecture of the automated labeling and counting system for Landes geese of the present invention; Figure 2 This is a flowchart of the algorithm in a real-world scenario for this invention. Figure 3 This is a simulation of the generated goose flock according to the present invention. Figure 4 This is a schematic diagram illustrating the principle of the simulated line crossing counting method of this invention. Detailed Implementation

[0021] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0022] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0023] Example 1 Please see Figure 1 , Figure 2 This embodiment describes a span measurement method for simulated and controlled Landes goose counting, including the following steps: S1. Conduct morphological feature analysis and generate goose targets in batches in the simulation environment, adjust parameters to construct different distribution goose flock scenarios; introduce six scenario randomization control mechanisms to generate multiple types of goose flock sample images accordingly. The six scene randomization control mechanisms are randomization of goose flock size, randomization of goose flock spatial distribution, randomization of camera height and shooting angle, randomization of light intensity and light direction, randomization of target occlusion degree, and randomization of scene background parameters. Please see Figure 3 S1 includes the following steps: S11. Using the real appearance characteristics of Landes geese as a reference, and based on this, analyze the morphological characteristics of geese (including body proportions, head and neck structure, feather color distribution, and overall outline); after the feature analysis is completed, generate multiple goose targets in the simulation environment, and form a goose flock scene by controlling the number, position, and posture; the process of generating the simulated goose flock does not rely on manual shooting and labeling of each goose, but rather on generating goose targets in batches in the virtual scene, thereby achieving rapid construction of training data; Let the simulation scenario be the first i The position of the goose in three-dimensional space is: ; in, , , They represent the first i The three-dimensional spatial coordinates of a goose in the simulation scene; to simulate the discrete distribution of individual geese in a real breeding environment, the positions of the goose targets are generated using a random distribution method: ; ; in, Represents the uniform distribution function. , , , These represent the boundary ranges of the simulation scene in the horizontal and vertical directions, respectively. The distribution state of the goose flock scene (sparse, medium density, and high density, etc.) is set by adjusting the spatial range parameter and the number of generated parameters; Furthermore, in the simulation environment, the orientation, body posture, and local movement state of the goose target can be varied to simulate the appearance differences of the goose flock under different movement states, thereby improving the diversity of simulation data. S12. Six scene randomization control mechanisms are introduced into the simulation scenario; the specific implementation steps of the scene randomization control mechanisms are as follows: (1) Randomization of goose flock size: Within the effective space, a random function is used to make the target number N uniformly distributed in the interval [50, 200]; (2) Randomization of spatial distribution of goose flock: The Poisson Disk Sampling algorithm is used to generate coordinates to ensure that the target location is random and that the minimum safe distance between individuals is maintained in accordance with the actual body size, so as to avoid the model from clipping through the model; (3) Randomization of camera height and shooting angle: Set the installation height of the virtual camera. Randomly within the range of 1.5m to 3.0m, pitch angle In 30 o ~60 o Random within a range; (4) Randomization of light intensity and direction: Parallel light and ambient light are introduced. The intensity of parallel light fluctuates within the range of 0.5 to 1.5, and the yaw angle of the light source is within 0. o ~360 o Random rotation; (5) Randomization of target occlusion: By controlling the spatial density threshold, the field of view is made to show 0 o ~60 o Unequal individual overlap rates; (6) Randomization of scene background parameters: Randomly switch the texture material of the simulated ground (such as cement ground, mud ground, hay mat, etc.).

[0024] Verification of the principles and effects of the above six specific randomization methods: The breeding environment for Landes geese is mostly semi-enclosed greenhouses or indoor fences. The above six parameters accurately cover the core physical variables in this real-world scenario. If one parameter is removed (e.g., removing illumination randomization), the model will overfit the default light source of the simulation environment, resulting in a significant decrease in generalization ability and an increase in the false negative rate when the light changes between morning and evening in the real-world scenario. If one parameter is added or replaced (e.g., adding rain and fog weather randomization, or replacing height randomization with camera focal length distortion randomization), since extreme weather rarely occurs in the indoor breeding scenario for Landes geese, and farm monitoring usually uses standard distortion-free fixed-focus lenses, introducing such useless randomization will not only exponentially increase the cost of generating simulation data, but also introduce irrelevant domain noise, reducing the upper limit of model convergence accuracy (mAP index decreases). Then, based on the aforementioned scenario randomization control mechanism, multiple goose flock training samples are generated to obtain the initial simulation training dataset; Specifically, let the simulated image be... The image after scene randomization can be represented as: ; in, This represents the scene randomization mapping function. θ The randomization parameter set; the randomization parameter set can be represented as: ; Examples of specific related parameters are as follows: (1) N represents the number of geese: for example, the number of geese generated in the simulation environment is set to be randomly selected between 50 and 200. (2) S represents the spatial distribution parameters of the goose flock: for example, the minimum safe distance threshold in the Poisson disk sampling algorithm is used to control the randomly generated spacing between geese to prevent them from wearing through the mold; (3) C represents the camera pose parameters: for example, including the camera installation height (randomly set between 1.5m and 3.0m) and the pitch angle (randomly set between 30° and 60°). (4) L represents the lighting parameters: for example, the intensity coefficient of parallel light (0.5 to 1.5 random) and the yaw angle of the light source (0° to 360° random rotation); (5) O represents occlusion-related parameters: for example, controlling the spatial aggregation of the goose flock so that the visual overlap rate between individuals in the picture fluctuates randomly within the range of 0% to 60%; (6) B represents scene background parameters: such as the texture material category of the simulated ground (randomly switching between different textures such as cement ground, mud ground, and hay mat). By using this scenario randomization method, the simulation system can generate large-scale and diverse goose training samples in batches to form a simulation training dataset. Because Landes geese have relatively distinct body contours and head and neck structure features, their overall appearance is stable, providing a good foundation for visual recognition. By introducing appearance reference information from real Landes geese, the simulated geese can more closely resemble the real objects in terms of overall appearance, body proportions, and contour features, thereby reducing the domain differences between simulated and real data and ensuring a high degree of consistency between simulated data and real goose flock scenes. In addition, to enhance the richness and practicality of the generated simulated data, by combining and changing the above parameters, simulated image data under various conditions can be generated, allowing the training samples to cover a wider range of scene distributions, thereby enhancing the robustness and adaptability of the visual detection model in real breeding environments. S2. Based on the camera projection model and the corresponding mapping formula, the three-dimensional coordinates of the simulated goose target are mapped to the two-dimensional image plane to obtain the projection coordinates. Based on this, the target detection box annotation information is calculated and generated. Then, the sample images and annotation information in S1 are integrated to form the final simulation training dataset. S2 includes the following steps: S21. In the process of constructing traditional target detection datasets, it is usually necessary to manually annotate the bounding boxes of each target in the image one by one, which is labor-intensive and easily affected by human subjective factors. This invention takes advantage of the fact that the spatial position of the Landes goose target in the simulation environment is known and proposes an automatic annotation generation method. Specifically, in the simulation environment, the three-dimensional spatial position and boundary range of each goose can be obtained; based on the camera projection model, the three-dimensional position information of the goose targets in the simulation training dataset is mapped onto the two-dimensional image plane to obtain the coordinates of the projection points; then, the target detection box is automatically generated to obtain the annotation information; The mapping relationship between the three-dimensional position information and the two-dimensional image plane is as follows: ; in, K For the camera intrinsic parameter matrix, R For rotation matrix, t Let be the translation vector, ( X , Y , Z () represents the coordinates of the target in three-dimensional space. u , v () represents the projected coordinates of the target in the two-dimensional image; The process of calculating the correlation between projected coordinates and the target detection box is as follows: In the simulation environment, each goose is tightly enclosed by a 3D bounding box containing 8 vertices. Using the aforementioned camera projection model matrix formula, these 8 3D vertices are projected onto the 2D image plane to obtain 8 sets of 2D projection points. .

[0025] The two-dimensional bounding box of the target in the image is the smallest bounding rectangle that can contain these 8 projection points. Therefore, the coordinates of the top left corner of the target bounding box are... and the coordinates of the bottom right corner The relationship with the coordinates of the projection point is as follows: ; ; ; ; Then, based on the coordinates of the projection points, the parameters of the target two-dimensional bounding box are calculated; The calculation of the target two-dimensional bounding box parameters specifically includes: Set the coordinates of the top left corner of the target detection box to The coordinates of the lower right corner are Then the coordinates of its center point ,Width ,high They are represented as follows: ; ; ; ; If a normalized detection annotation format is used, it can be further expressed as: ; in, W , H These represent the width and height of the two-dimensional image, respectively. S22. Combine the initial simulation training dataset and the annotation information to obtain the final simulation training dataset; the dataset can be further divided into training set, validation set and test set to meet the needs of visual detection model training and evaluation. The above-mentioned automatic annotation method can quickly generate large-scale, highly consistent detection annotation data without human intervention, significantly reducing the cost of dataset construction. Furthermore, the simulation training dataset construction method of this invention can form a large-scale, low-cost training sample set with high label consistency in a short time, thereby effectively solving problems such as the difficulty in obtaining real goose flock data, the high cost of manual annotation, and the scarcity of public datasets. S3. The visual detection model is trained using the final simulation training dataset and deployed. Video is collected frame by frame to generate goose detection boxes. The center point of the bottom edge of the detection box is used as the target location point. Then, a unique identifier is assigned to each goose in combination with the target tracking method. Please see Figure 4 S3 includes the following steps: S31. After completing the construction of the final simulation training dataset, the visual detection model is trained using the final simulation training dataset. The core visual detection model used is the YOLOv8 model. Its specific network structure includes: the backbone network adopts an improved CSPDarknet structure, which enhances feature gradient flow and lightweights the model by introducing a C2f module; the neck network uses PANet (path aggregation network) to achieve efficient fusion of multi-scale features to adapt to changes in goose body shape at different distances; the detection head adopts a decoupled-head structure, separating classification and regression tasks, and uses an anchor-free design. The core parameters for model training are set as follows: the input image size is uniformly adjusted to 640×640; the SGD optimizer is used, with an initial learning rate of 0.01 and a momentum decay parameter of 0.937; the loss function combines CIoULoss (for bounding box regression) and DFL (distributed focus loss), and a total of 300 epochs (iteration cycles) are trained, using simulation data to drive rapid model convergence. After training, the final visual detection model is obtained. The final visual detection model is then deployed on the video input terminal of a real breeding scene to identify the target location of geese in the video. The visual detection model can be any deep learning detection model suitable for target detection tasks. Through simulation data-driven training, the detection model can be made capable of recognizing real goose flocks. S32. In a real goose scene, video data is collected by a camera, and the final visual detection model is used to detect the images in the video data frame by frame to generate a detection box for each goose, thus obtaining a set of real goose detection boxes. The parameters of the detection boxes in the real goose detection box set are set as follows: ,in, , , , These represent the minimum and maximum coordinates of the detection box in the horizontal direction and the minimum and maximum coordinates in the vertical direction, respectively. To improve the stability of subsequent counting, this invention uses the center point of the bottom edge of the detection box as the target position point, and the coordinates of the target position point are as follows: ; in, Indicates the first i The bottom center point of each detection target; because this point is closer to the contact point between the goose's foot and the ground, it is more suitable as the judgment point for crossing the line than the ordinary geometric center point. Advantages of using the center point of the bottom edge as the target location point: In traditional object detection, the geometric center point of the bounding box is often used. However, in the actual movement of Landes geese, the swaying of their torso and the frequent extension and contraction of their head and neck cause frequent abrupt changes in the height of the entire detection frame, resulting in violent shaking of the geometric center point in the vertical direction. When the goose moves near the counting line, this shaking can easily lead to false judgments of "reciprocating crossing the line" (i.e., the Phantom Crosses phenomenon). The bottom center point reflects the contact position between the goose's feet and the ground, and the physical trajectory at this position is the smoothest and least affected by changes in posture.

[0026] Comparison of relevant characterization data confirms: In a test experiment involving 1000 Landes geese crossing the line, when the geometric center point of the conventional method was used as the target location, the trajectory smoothness (characterized by positional jitter variance) reached as high as 14.5 square pixels. Without the anti-jitter strategy, the false repeat count rate reached 12.8%, and the final counting accuracy was only 89.5%. However, when the bottom edge center point of this proposed method was used as the target location, the trajectory smoothness (positional jitter variance) was significantly reduced to 3.2 square pixels, the false repeat count rate before anti-jitter was sharply reduced to 1.5%, and the final counting accuracy was significantly improved to 98.8%. Experimental data confirms that selecting the bottom edge center point can greatly reduce the target positional jitter variance, effectively suppress erroneous trajectory crossings caused by changes in body posture, thereby significantly improving the stability and accuracy of counting.

[0027] S33. Building upon the detection in S32, a target tracking method is further incorporated to assign a unique identifier to each goose and maintain the consistency of this identifier across consecutive frames. The detailed steps are as follows: The first step is motion state prediction: using a Kalman filter, based on the position and velocity state of the goose detection box in the previous frame, predict its motion bounding box in the current frame; The second step is appearance feature extraction: within the detection box area of ​​the current frame output by the visual detection model, the appearance ReID (target re-identification derived from person re-identification technology) feature vector of each goose is extracted; The third step is to construct the cost matrix: calculate the intersection-over-union ratio (IoU) between the Kalman predicted box and the current detected box, and combine the cosine similarity of the appearance features of the targets in the previous and next frames to fuse spatial and appearance information to construct a multi-dimensional matching cost matrix. The fourth step, data association and identity assignment, involves using the Hungarian Algorithm to perform bipartite graph optimal matching on the cost matrix. For successfully matched detection boxes, their TrackID from the previous frame is inherited; for newly created detection boxes that fail to match, a new TrackID is assigned; for trajectories that fail to match for multiple consecutive frames, they are cancelled. This allows for further integration with target tracking methods based on the detection in resource S32, assigning a unique TrackID to each goose and maintaining consistency of this TrackID across consecutive frames. In this way, the motion trajectory of the target in the video sequence can be constructed, providing a basis for subsequent line-crossing counting. S4. Based on S3, set counting lines in the image and measure the span of the target location point; The target location point is set at the 1st t Position in the frame for: ; in, , These represent the target location points at the [number]th position. t The x and y coordinates of the position within the frame; Set the vertical coordinate position of the counting line as The target location point is at the th t The span of a frame is: ; S4 includes the following steps: S41. After the identity markers are assigned, a counting line is pre-set in the image. After setting, the span of each target location point is measured according to the counting line. The setting of the counting line is not random. The specific steps for setting the position are as follows: First, the main passage or gate area in the farm image is extracted using a background segmentation algorithm and defined as a passable region of interest (ROI). Second, the center normal vector of the passage direction in the ROI is calculated to determine the main movement direction of the geese. Finally, in the middle section of the ROI, along a cross section strictly perpendicular to the main movement direction, a virtual line segment of equal width spanning the entire passage is set as the final counting line.

[0028] Explanation of the principle: This setup is based on the core logic of line-crossing detection, which measures the span of the target's coordinates between two consecutive frames. If the counting line is randomly tilted or placed at the edge of the frame, the projection of the target's trajectory onto the counting line's normal vector will be too short. Setting the counting line strictly perpendicular to the main direction of the flock's movement ensures that the target's vertical (or horizontal) coordinates experience the largest possible jump when crossing the line segment. This results in the highest signal-to-noise ratio for the line-crossing detection condition, significantly reducing the risk of misjudgment due to minor frame jitter.

[0029] Example 2 This embodiment discloses a Landes goose counting system, which can implement the methods of the above embodiments, including a video source acquisition module, an intelligent target detection module, a multi-target tracking module, a line-crossing counting module, and a statistics and visualization module; Video source acquisition module: Its input methods include farm monitoring video or USB camera, the input object is locked to Landes goose flock, the preprocessing steps include image decoding and size normalization, and based on this, multi-type goose flock sample images are generated; The intelligent target detection module uses the YOLOv8 model as its core. Its function is to identify geese in an image and output bounding boxes. The output data format is... , Indicates confidence level; Multi-target tracking module: Employs BoT-SORT as the key tracking algorithm, its function is to associate detection boxes and assign unique TrackIDs (identifiers). The principle is to combine appearance features with motion prediction, and the output data format has been upgraded. ; The line crossing counting module is used to measure, determine, and count the span of the goose target. The determination mechanism is based on linear interpolation of the center point trajectory, the deduplication strategy is to use TrackID to prevent duplicate counting, the motion analysis includes determining the target's movement direction (IN / OUT, i.e., entering / exiting), and an anti-shake cooling time is set to ensure robustness. Statistics and Visualization Module: Includes real-time display of overlaid counting results and trajectory lines on the screen, export of CSV data recording time, quantity and ID, and the function of recording and saving labeled inference videos.

[0030] Example 3 This embodiment discloses an application of the span measurement method for counting Landes geese based on the simulation control in Embodiment 1 in the counting of Landes geese. After S4, the following steps are also included: S5. When the target position point corresponding to the Landes goose moves from one side of the counting line to the other side, it is determined that the target position point has completed one crossing count. Specifically, it includes: The target location point is set at the 1st t The position in the frame is: ; In the t The position in frame +1 is: ; Set the vertical coordinate position of the counting line as The condition for determining if the target location point crosses the line is: ; When the target location point meets the crossing determination condition, it means that the target location point has crossed the counting line between two consecutive frames, completing one count; Combination such as Figure 2 The diagram shows the core algorithm flowchart of this invention in a real-world scenario. After system startup, an "initialization" operation is performed first, followed by a frame-by-frame loop. Once in the loop, "target detection" is executed sequentially to obtain bounding boxes, and targets in preceding and following frames are matched through a "data association" step. Next, the core "trajectory management and counting logic" branch is entered: In this stage, the system iterates through all Track IDs, uses the calculated "bottom edge center point as the centroid," performs "trajectory interpolation: (Prev Point -> Current Point)," and determines "whether it crosses the detection line." If yes, direction determination (IN / OUT) is performed and the count is accumulated; if no, it is ignored. After this counting logic is completed, the system returns to the main path for "state update" and performs "visual rendering." Finally, the system determines "whether to save / export." If yes, the result is written to the video file and recorded as CSV data; if no, it determines whether to end the loop, ultimately reaching the "end" node. After completing the training of the detection model and the design of the line crossing counting method, it was applied to real goose farming videos for verification. With real goose flock videos as input, the system can automatically complete target detection, target tracking and line crossing counting. Data Representation: In a comparative test of 500 real-world instances of geese crossing the line, the relevant data representation is as follows: When using this scheme (setting the counting line perpendicular to the main traffic direction), due to the obvious coordinate span characteristics of the target crossing the line, the system successfully detected 496 valid crossings, achieving a detection accuracy of 99.2%, and only 2 erroneous counts due to jitter occurred (false detection rate of 0.4%). In contrast, if a random setting is used (e.g., setting the counting line at a 45-degree angle to the main traffic direction), due to the shortened projection span, the detection system becomes extremely sensitive to positional jitter, causing the detection accuracy to plummet to 91.6% (458 successful detections), while the erroneous count surges to 29 (false detection rate as high as 5.8%). This data fully demonstrates the necessity and technical effectiveness of the aforementioned non-random, perpendicular setting of the counting line in improving the robustness of the counting system. In practical applications, the direction of the target's movement can be combined to further determine whether it is an entry count or a departure count, thereby realizing the automatic counting of the number of geese entering and leaving the flock; After completing the training of the detection model and designing the line-crossing counting method, it was applied to real goose farming videos for verification. Using real goose flock videos as input, the system was able to automatically complete target detection, target tracking, and line-crossing counting. Specific verification data are shown in Table 1. Table 1 Verification Table for Real Goose Count

[0031] Experimental results show that the detection model trained using simulation data can adapt well to real goose flock scenarios and achieve automatic goose flock number counting, indicating that the simulation data-driven method proposed in this invention has good practical application value.

[0032] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0033] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present invention.

Claims

1. A span measurement method for counting Landes geese using simulation-controlled annotation, characterized in that, Includes the following steps: S1. Conduct morphological feature analysis and generate goose targets in batches in the simulation environment, adjust parameters to construct different distribution goose flock scenarios; introduce six scenario randomization control mechanisms to generate multiple types of goose flock sample images accordingly. The six scene randomization control mechanisms are randomization of goose flock size, randomization of goose flock spatial distribution, randomization of camera height and shooting angle, randomization of light intensity and light direction, randomization of target occlusion degree, and randomization of scene background parameters. S2. Based on the camera projection model and the corresponding mapping formula, the three-dimensional coordinates of the simulated goose target are mapped to the two-dimensional image plane to obtain the projection coordinates. Based on this, the target detection box annotation information is calculated and generated. Then, the sample images and annotation information in S1 are integrated to form the final simulation training dataset. S3. The visual detection model is trained using the final simulation training dataset and deployed. Video is collected frame by frame to generate goose detection boxes. The center point of the bottom edge of the detection box is used as the target location point. Then, a unique identifier is assigned to each goose in combination with the target tracking method. S4. Based on S3, set counting lines in the image and measure the span of the target location point; The target location point is set at the 1st t Position in the frame for: ; in, , These represent the target location points at the [number]th position. t The x and y coordinates of the position within the frame; Set the vertical coordinate position of the counting line as The target location point is at the th t The span of a frame is: .

2. The method for span measurement of labeled Landes geese with simulation control according to claim 1, characterized in that, S1 includes the following steps: S11. Using the real appearance characteristics of Landes geese as a reference, and based on this, analyze the morphological characteristics of geese; after the feature analysis is completed, generate multiple goose targets in the simulation environment, and form a goose flock scene by controlling the number, position and posture; the distribution state of the goose flock scene is set by adjusting the spatial range parameter and the number of generated parameters. S12. Introduce six scene randomization control mechanisms into the simulation scenario; then generate multiple goose flock training samples based on the scene randomization control mechanisms to obtain the initial simulation training dataset.

3. The method for span measurement of labeled Landes geese with simulation control according to claim 2, characterized in that, S2 includes the following steps: S21. Based on the camera projection model, the three-dimensional position information of the goose target in the simulation training dataset is mapped onto the two-dimensional image plane to obtain the coordinates of the projection point; then, the target detection box is automatically generated to obtain the annotation information. The mapping relationship between the three-dimensional position information and the two-dimensional image plane is as follows: ; in, K For the camera intrinsic parameter matrix, R For rotation matrix, t Let be the translation vector, ( X , Y , Z () represents the coordinates of the target in three-dimensional space. u , v The projection coordinates of the target in the two-dimensional image are given; then, the two-dimensional bounding box parameters of the target are calculated based on the projection coordinates. S22. Combine the initial simulation training dataset and the annotation information to obtain the final simulation training dataset.

4. The method for span measurement of labeled Landes geese with simulation control according to claim 3, characterized in that, The calculation of the target two-dimensional bounding box parameters specifically includes: Set the coordinates of the top left corner of the target detection box to The coordinates of the lower right corner are Then the coordinates of its center point ,Width ,high They are represented as follows: ; ; ; 。 5. The method for span measurement of labeled Landes geese with simulation control according to claim 4, characterized in that, S3 includes the following steps: S31. After completing the construction of the final simulation training dataset, the visual detection model is trained using the final simulation training dataset to obtain the final visual detection model. The final visual detection model is then deployed on the video input terminal of a real breeding scene to identify the location of the goose target in the video. S32. Collect video data through a camera, and use the final visual detection model to perform frame-by-frame detection of the images in the video data to generate a detection box for each goose, thereby obtaining a set of real goose detection boxes. The parameters of the detection boxes in the real goose detection box set are set as follows: ,in, , , , These represent the minimum and maximum coordinates of the detection box in the horizontal direction and the minimum and maximum coordinates in the vertical direction, respectively. The center point of the bottom edge of the detection box is used as the target location point, and the coordinates of the target location point are as follows: ; in, Indicates the first i The bottom center point of each detection target; S33. Based on the detection in S32, further combine the target tracking method to assign a unique identity to each goose and maintain the consistency of the identity between consecutive frames.

6. The method for span measurement of labeled Landes geese with simulation control according to claim 5, characterized in that: The target tracking method is the BoT-SORT multi-target tracking algorithm; in step S32, the center point of the bottom edge of the detection box is selected as the target position point for trajectory interpolation and line crossing determination.

7. The method for span measurement of labeled Landes geese with simulation control according to claim 6, characterized in that, S4 includes the following steps: S41. After the identity markers are assigned, a counting line is pre-set in the image; after setting, the span of each target location point is measured according to the counting line.

8. The method for span measurement of labeled Landes geese with simulation control according to claim 7, characterized in that: The counting line described in S41 is set as follows: the passable area in the breeding environment is extracted as the region of interest, and a line segment with the same width as the passable area is set along a cross section perpendicular to the main passage direction of the flock in the middle section of the region of interest as the counting line.

9. A system for implementing the simulated control method for span measurement of Landes geese as described in any one of claims 1-8, characterized in that: It includes a video source acquisition module, an intelligent target detection module, a multi-target tracking module, and a span measurement module; The video source acquisition module is used to acquire video source data and generate multiple types of goose flock sample images; The intelligent target detection module is used to identify geese in the image and output bounding boxes; The multi-target tracking module is used to assign unique identifiers to associated detection boxes for target tracking; The span measurement module is used to measure the span of the target location point.

10. An application of the span measurement method for Landes goose counting based on simulation control as described in any one of claims 1-8 in Landes goose counting, characterized in that, It also includes the following steps: S5. When the target position point corresponding to the Landes goose moves from one side of the counting line to the other side, it is determined that the target position point has completed one crossing count. Specifically, it includes: The target location point is set at the 1st t The position in the frame is: ; In the t The position in frame +1 is: ; Set the vertical coordinate position of the counting line as The condition for determining if the target location point crosses the line is: ; When the target location point meets the crossing determination condition, it means that the target location point has crossed the counting line between two consecutive frames, completing one count.