Data parameter regulation method and system for three-dimensional rendering of poultry detection and application thereof

CN122416187BActive Publication Date: 2026-08-18WEST ANHUI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610879441.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-17
Publication Date
2026-08-18
Estimated Expiration
2046-06-17

AI Technical Summary

Technical Problem

首先,数据采集成本极其高昂;传统的数据收集方法需要数据工程师深入真实的养殖场环境,架设监控摄像设备并进行长时间的视频录制;养殖场环境往往复杂且存在生物安全控制限制,同时家禽的生长周期长,物理形态变化大;要采集涵盖不同生长阶段、不同光照条件(清晨、正午、夜晚、强逆光)、不同天气状况的数据,必须耗费巨大的人力与物力周期,导致研发成本居高不下;

Benefits of technology

1.本发明中通过图像生成脚本参数的反馈调控,有效提升家禽数据集质量与实用性;通过对三维模型质量进行反馈检测调控,可提前筛除网格畸变、贴图错位、模型比例失真等缺陷模型,规避不合格三维素材流入后续渲染流程,大幅减少群体图像边界错标、画面畸变等问题,避免反复返工渲染与标注,压缩全流程资源损耗;具体的,通过闭环回退至S1进行模型调控重构,持续优化家禽三维建模精度,保障模型体态、纹理贴合真实家禽特征;合格三维模型为渲染、标注、退化处理提供标准基底,提升边界框标注准确率与画面匹配度,降低域差异。后续叠加退化模型与风格迁移后,所得图像样本真实度更高,扩充数据集多样性,降低因底层模型缺陷引发的数据集失效风险;通过对渲染控制脚本中的以下参数进行细化调控,能够降低图像中大角度斜拍带来的投影畸变,保证最后的家禽帧图像的质量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122416187B_ABST
    Figure CN122416187B_ABST
Patent Text Reader

Abstract

The application discloses a data parameter regulation method and system for three-dimensional rendering poultry detection and application thereof, and relates to the field of parameter regulation.The application directly intercepts a two-dimensional bounding box from three-dimensional space by using a coordinate projection mathematical conversion formula based on a pinhole camera model of a three-dimensional graphics rendering engine bottom layer and operating a matrix in the background.The technical process completely eliminates the most expensive, most boring and most time-consuming manual image acquisition and frame-by-frame manual frame drawing costs in traditional computer vision tasks, and compresses the original monthly data preparation period to an hour level.Meanwhile, relying on programmable automation scripts and Monte Carlo parameter space domain randomization control technology, the time and space constraints of physical world data acquisition are broken, and marginal computing power costs are almost zero, so that edge scene data in the real world which is difficult to capture, dangerous or has an extremely occasional probability can be generated infinitely and at a high frequency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of parameter control, and specifically relates to a method, system and application of data parameter control for poultry detection using 3D rendering. Background Technology

[0002] In modern smart agriculture and intensive poultry farming, computer vision-based object detection technology is widely used in scenarios such as automatic poultry counting, body posture monitoring, abnormal behavior recognition, and animal welfare assessment. Current mainstream industrial solutions largely rely on deep learning object detection algorithms (such as the YOLO series and Faster R-CNN). The performance limits of these supervised learning algorithms are highly dependent on the size, quality, and scenario diversity of the input training dataset. However, existing technologies face the following significant challenges in practical implementation and commercialization: First, data collection costs are extremely high. Traditional data collection methods require data engineers to go deep into the real farm environment, set up monitoring camera equipment, and record videos for a long time. The farm environment is often complex and subject to biosecurity control restrictions. At the same time, poultry have a long growth cycle and undergo great changes in physical form. To collect data covering different growth stages, different lighting conditions (early morning, noon, night, strong backlight), and different weather conditions, a huge amount of human and material resources must be spent, resulting in high research and development costs. Secondly, manual annotation is inefficient and prone to introducing human error. Deep learning object detection models require precise two-dimensional bounding boxes or instance segmentation masks as supervision signals during the training phase. When faced with highly dense poultry flocks (such as hundreds of geese overlapping and gathering in front of the feeding trough), manual frame-by-frame bounding box annotation is not only extremely time-consuming (the annotation time for a single dense image may exceed tens of minutes), but it is also prone to omissions, inaccurate box selection, and blurred boundaries. Such "dirty labels" caused by fatigue and subjective judgment will seriously interfere with the gradient descent direction of the model and reduce the final convergence accuracy of the model. Secondly, real-world datasets commonly suffer from a lack of long-tail (edge) scene data. In real-world physical environments, it is difficult to collect "long-tail data" such as data on extreme weather (e.g., heavy fog, heavy rain), special optical interference (e.g., lens flare, extremely dark environments), severe physical occlusion, rare behavioral poses, or sudden clustering in a short period of time. This severe imbalance in data distribution leads to extremely poor generalization ability of the trained model. Once it encounters a complex environment in actual deployment, the detection accuracy will drop significantly, resulting in a large number of missed detections and false detections. Finally, the weak cross-domain generalization ability is the core barrier limiting the direct application of synthetic data. Some existing methods that use computer graphics to synthesize data produce images that have significant "domain differences" with images captured by real surveillance cameras in terms of material texture, color saturation, sensor noise distribution, and optical distortion. If there is a lack of effective domain adaptation methods, when a model trained with pure synthetic data is directly deployed to a real farm surveillance video stream, its feature extraction network often fails to recognize the underlying texture of the real domain, resulting in a precipitous drop in performance. Summary of the Invention

[0003] In response to the problems in related technologies, this invention proposes a method, system and application for adjusting data parameters for poultry detection using 3D rendering, in order to overcome the aforementioned technical problems existing in the existing related technologies.

[0004] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: This invention relates to a method for adjusting data parameters in poultry detection using 3D rendering, comprising the following steps: S1. Generate a multi-view two-dimensional image of the target poultry based on the prompt words, and then process the multi-view two-dimensional image of the target poultry through a graph-generated three-dimensional model network, UV coordinate unrolling, PBR material mapping and simplified mesh processing to obtain a simplified three-dimensional model of the target poultry. S2. Perform quality inspection and control on the simplified target poultry 3D model in S1. If the inspection passes, it is put into storage; otherwise, the control process returns to S1 and is repeated until it passes. S3. Import the qualified poultry 3D model from S2 into the rendering engine to generate a poultry group image and mark the bounding box. Then check the accuracy of the marking and the matching degree of the image. If the validation passes, then validate the domain differences. If the domain differences validation passes, inspect the poultry group image after the domain differences validation and adjust the script parameters until the check result shows that it passes. If the domain differences validation fails, execute S4. If the verification fails, adjust the script parameters and repeat the verification of annotation accuracy and image matching until the verification passes. S4. Overlay the physical and mathematical degradation model onto the poultry group image labeled in S3, and then perform unsupervised deep style transfer. S5. Check the poultry frame image superimposed and migrated in S4 and adjust the script parameters until the check result shows that it passes.

[0005] This invention effectively improves the quality and usability of poultry datasets through feedback control of image generation script parameters. By controlling the quality of 3D models through feedback detection, defective models such as mesh distortion, texture misalignment, and model scale distortion can be screened out in advance, preventing unqualified 3D materials from entering the subsequent rendering process. This significantly reduces issues such as mislabeling of group image boundaries and image distortion, avoiding repeated re-rendering and annotation, and reducing overall resource consumption. Specifically, by reverting to S1 through closed-loop control for model adjustment and reconstruction, the accuracy of poultry 3D modeling is continuously optimized, ensuring that the model's body shape and texture match the characteristics of real poultry. Qualified 3D models provide a standard base for rendering, annotation, and degradation processing, improving the accuracy of bounding box annotation and image matching, and reducing domain differences. After subsequent overlay of degradation models and style transfer, the resulting image samples have higher realism, expand the diversity of the dataset, and reduce the risk of dataset failure caused by defects in the underlying model. By refining the following parameters in the rendering control script, projection distortion caused by large-angle oblique shots in the images can be reduced, ensuring the quality of the final poultry frame images.

[0006] Preferably, step S1 includes the following steps: S11. Preset several prompt words to obtain a set of prompt words for generating poultry images; generate two-dimensional images of the target poultry from multiple perspectives using the poultry image prompt word set and a text-based image model. The text-based image model adopts a latent diffusion model architecture, which consists of three core parts: a text encoder, an image autoencoder, and a denoising U-Net. The text encoder uses a CLIP or T5 model to encode the input prompt words into text embedding vectors. The image autoencoder compresses the image to a low-dimensional latent space to reduce computational complexity. The denoising U-Net iteratively denoises the latent space by fusing text embeddings and image features through a cross-attention mechanism. The sampler uses DDIM or DPM-So. Lver++ completes the denoising process in 20 to 50 steps. During generation, it sequentially generates corresponding two-dimensional images for multiple preset perspective prompts, ultimately forming a target poultry two-dimensional image set. Each image in the target poultry two-dimensional image set is input into the image-generated 3D model network to obtain the initial 3D white model of the target poultry. The image-generated 3D model network adopts a large-scale reconstruction model architecture, which sequentially extracts features from the input multi-view two-dimensional images through an image encoder, maps them to three orthogonal planes through a three-plane generator, regresses density and color through a neural radiation field decoder, and finally extracts and optimizes the mesh through the moving cube algorithm to output the initial 3D white model of the target poultry. S12. Automatically unfold the initial three-dimensional white model of the target poultry using UV coordinates, and then perform PBR material mapping to obtain the textured three-dimensional model of the target poultry. The extended quadratic error metric algorithm is then used to simplify the mesh of the textured target poultry 3D model, resulting in a simplified target poultry 3D model. By utilizing cutting-edge generative large models to generate the basic 3D geometry of poultry, and combining it with a quadratic error metric algorithm for mesh optimization, we can meet the computing power requirements of subsequent large-scale cluster rendering.

[0007] Preferably, the extended quadratic error metric algorithm in S12 uses an extended high-dimensional QEM matrix; in addition to geometric position coordinates, the extended high-dimensional QEM matrix also introduces visual attributes such as vertex texture coordinates and normal vectors as additional dimensions to construct a hyperplane distance metric in a high-dimensional feature space. To prevent severe stretching or tearing of poultry feather texture during the face reduction process, this invention employs an extended high-dimensional QEM matrix. In addition to geometric position coordinates, the system also introduces visual attributes such as vertex texture coordinates and normal vectors as additional dimensions into the quadratic matrix to construct a hyperplane distance metric in the high-dimensional feature space. This ensures that when the model is simplified from a 100,000-face level to a lightweight model with 2,000 faces, it not only maintains the realism of the geometric silhouette but also locks in the pixel-level mapping accuracy of the PBR texture.

[0008] Preferably, step S2 includes the following steps: S21. Perform quality inspection on the simplified target poultry 3D model. The quality inspection indicators include model topology and model texture, etc. S22. After the test is completed, if the test result shows that it passes, the simplified target poultry 3D model will be stored as an asset to obtain the final target poultry 3D model; otherwise, S11 and S12 will be executed repeatedly and feedback will be provided to modify the input parameters or re-optimize the mesh until the test result shows that it passes. When a quality check fails, the system first identifies the cause of the failure: if there are problems with the model's topology (such as non-manifold surfaces, holes, or broken edges), it is judged as geometrically unqualified. The system automatically reverts to S12 and dynamically adjusts the edge folding threshold and face number retention ratio in the extended quadratic error metric algorithm, while increasing the weight coefficients of texture coordinates and normal vectors to strengthen attribute preservation. Then, mesh simplification is re-executed. If the model texture has stretching, seams, or blurring issues, it is judged as texture unqualified. The system reverts to S11 and S12, adjusting the prompts for the texture-generated model to generate multi-view images with higher resolution and clearer textures. On the other hand, a UV re-unwrapping step is added to the texture-generated 3D model, and the texture sampling density is increased. Then, the asset generation and optimization process is re-executed. All feedback adjustments are automatically triggered through a log file recording the failure type, without manual intervention, until the model passes all quality check indicators.

[0009] Preferably, step S3 includes the following steps: S31. The final target poultry 3D model is imported into the 3D graphics rendering engine. The 3D graphics rendering engine generates a poultry flock in the virtual farm space based on the joint probability distribution function of multiple variables, and obtains a set of target poultry model flock frame images. The randomization dimension of the parameters in the virtual farm space includes spatial layout and posture variables as well as ambient lighting and camera variables. S32. Calculate the bounding box of each poultry in each frame image of the target poultry model group frame image set on the two-dimensional image to obtain the labeled poultry model group frame image set; S33. Verify the accuracy and image matching of each annotation in the set of labeled poultry model group frame images. If the verification fails, return to S31 and adjust the script parameters until the verification passes. When the accuracy or image matching verification fails, the system returns to S31 and refines the following parameters in the rendering control script: In terms of spatial layout and pose variables, if the verification finds that a large number of poultry are severely occluded, resulting in missing or incorrect annotation boxes, refine the group density parameter, reduce the number of poultry per frame from the current value by 10% to 30%, and adjust the probability weight of the quaternion pose distribution to reduce the probability of extreme overlapping poses; if the verification finds that the annotation box deviates significantly from the actual outline of the poultry, refine the camera intrinsic and extrinsic parameters, including randomly fine-tuning the focal length parameter within ±15% and narrowing the camera pitch angle sampling range from ±30° to ±15° to reduce projection distortion; in terms of ambient light and camera... Regarding camera variables, if the verification reveals that the image brightness is too dark or overexposed, making it difficult to distinguish the edges of poultry, the light source color temperature parameters and HDRI skybox intensity are refined. The ambient light intensity is resampled from its original value by a factor of 0.8 to 1.2, and the color temperature range is narrowed from 2000K to 10000K to 4000K to 7000K to ensure basic visibility. In addition, if the image matching verification shows physical anomalies such as model interleaving or floating in the generated image, the ground collision detection parameters are refined, the weight of ground adsorption constraints is enabled or increased, and the random perturbation range of the poultry placement height is reduced from ±0.2m to ±0.05m. All refinement operations are implemented by modifying the probability distribution function parameters in the rendering engine's Python script configuration file, and the parameter combinations after each refinement are recorded for subsequent iterations until the verification is passed. If the verification is passed, the synthetic data is compared with a small number of real samples to obtain domain differences. If the domain difference is too large, proceed to step S4; if the difference is within an acceptable range, obtain the poultry flock image set after domain difference verification; then perform dataset diversity and long-tail data balance checks on each frame image in the poultry flock image set after domain difference verification. If the check results show uneven data distribution or insufficient specific edge scenes, return to step S31 and adjust the script parameters until the check results show that they pass, thus obtaining the final enhanced poultry frame image set; otherwise, directly use the poultry flock image set after domain difference verification as the final enhanced poultry frame image set. After acquiring the optimized 3D assets, they are imported into a 3D graphics rendering engine. By using the written automated control scripts, various environmental variables of the scene are randomly combined with a high degree of freedom. Based on the principle of 3D to 2D photogrammetric projection, pixel-level accurate detection box annotations are exported simultaneously. In particular, by using Python scripts to define a joint probability distribution function of multiple variables, dense flocks of poultry are dynamically generated in the virtual farm space, ensuring that the detection model trained subsequently has the robustness to cope with the endless changes in the real world.

[0010] Preferably, step S32 includes the following steps: S321. Let the homogeneous coordinates of any corner point of the poultry 3D bounding box in the absolute world coordinate system be... The first three components , , These represent the precise spatial coordinates of the corner point along the three orthogonal axes in the world coordinate system, with the numerical unit being world units (such as meters or centimeters); the fourth component is the scaling factor of the homogeneous coordinates, which is fixed at 1 and used to realize the linear expression of translation operations in subsequent matrix transformations, so that rotation, scaling and translation in three-dimensional space can be uniformly represented as the multiplication operation of a 4×4 matrix and a four-dimensional vector. And through the camera extrinsic matrix Transform points in the world coordinate system to the camera coordinate system with the camera's optical center as the origin to obtain coordinates. The calculation formula is as follows: ; in, A 3×3 orthogonal rotation matrix to reflect the spatial orientation of the camera. The translation vector that reflects the spatial position of the camera; S322, Application Camera Intrinsic Matrix Projecting 3D point perspective from the camera coordinate system onto a 2D image plane; intrinsic parameter matrix The optical properties of the virtual camera are encapsulated, and their form is as follows: ; in, , These represent the camera's focal length (in pixels) in the horizontal and vertical directions, respectively. Represents the physical principal point of the image. This is the pixel skew coefficient; The complete mathematical equation for the perspective projection is: ; The left side of the equation yields a scaled homogeneous 2D coordinate; to obtain the actual pixel coordinates of this 3D vertex in the final 2D rendered image... The first and second components need to be divided by the third component, where the first component... The second component represents the scaled horizontal pixel coordinates. The third component represents the scaled vertical pixel coordinates. This is the depth scaling factor, whose value is equal to the point's position in the camera coordinate system. Axial depth (i.e., the distance from a point to the camera's optical center along the optical axis). This is used to obtain the actual pixel coordinates of the 3D vertex in the final 2D rendered image. The first component needs to be... Divide by the third component get , the second component Divide by the third component get This process essentially removes the scaling effect of depth information on the projection scale, accurately mapping three-dimensional points onto the two-dimensional image plane; S323. Obtain the 8 3D axial bounding box vertices at the object level, convert the local bounding box coordinates to world coordinates through matrix multiplication, and then call the perspective projection logic to calculate the set of 2D pixel coordinates corresponding to these 8 vertices; take the extreme values ​​of these projection point sets in the image plane; Simultaneously, mathematical clamping operations are used to restrict the coordinates to... as well as Within the image resolution range; where as well as These are the width and height of the rendered output image, respectively; S324. While rendering the RGB main channel, an object index channel image is rendered simultaneously. Each poultry in the object index channel image is assigned a unique pure color grayscale value. By reading the object index channel image, the total number of pixels in the image matrix that are equal to the poultry's unique ID is counted. If the total number of pixels is lower than the set effective visibility threshold, the system determines that the poultry is severely occluded and invisible, and automatically removes the detection box data of the object from the final output annotation sequence. The final calculation result is obtained by performing coordinate transformation operations based on the extracted pixel-level extreme value boundaries; The final calculation results will be directly formatted and written to the corresponding annotation file.

[0011] Preferably, step S4 includes the following steps: S41. A strict physical-mathematical degradation model is superimposed on each image in the labeled poultry model group frame image set to obtain the superimposed poultry model group frame image set; the physical-mathematical degradation model includes the addition of Gaussian noise, Poisson noise, and motion blur; S42. Unsupervised deep style transfer is performed using a cycle-consistent generative adversarial network to transform the synthetic source domain with physical degradation into a target domain with real farm features. After the transformation, a set of poultry frame images enhanced by virtual-real transfer is obtained. After being rendered by CycleGAN, the output dataset has three advantages: it retains a rigorous automatic coordinate frame, covers the rich long-tail distribution features of the synthesis space, and is covered with a low-level lighting and shadow that is indistinguishable from a real farm, thus achieving a perfect data loop.

[0012] Preferably, step S5 includes the following steps: S51. Perform dataset diversity and long-tail data balance checks on each frame image in the virtual-real migration enhanced poultry frame image set. If the check results show uneven data distribution or insufficient specific edge scenes, return to S31 and adjust the script parameters until the check results show that they pass, and obtain the final enhanced poultry frame image set; otherwise, directly use the virtual-real migration enhanced poultry frame image set as the final enhanced poultry frame image set.

[0013] The present invention also discloses a data parameter control system for poultry detection using 3D rendering, including an asset generation and optimization module, a rendering control module, a projection and purification module, and a multi-level virtual-real migration enhancement module; The asset generation and optimization module is responsible for reverse engineering the 3D white model based on the text-based or image-based 3D large model pipeline, performing PBR material attribute mapping association, and optimizing the polygon mesh topology. The rendering control module is used to randomize the number of individuals, 3D spatial position, pose matrix, and camera intrinsic and extrinsic parameters according to a preset probability distribution. The projection and purification module is used to solve the coordinates using matrix multiplication and camera projection mathematical formulas, followed by numerical clamping and severe occlusion filtering based on index mask. The multi-level virtual-real migration enhancement module is used to perform virtual-real migration and domain adaptation from a dual perspective.

[0014] This invention also discloses a data parameter control method for poultry detection using 3D rendering, and its application in poultry target detection includes the following steps: S6. Construct an initial single-stage anchor-free target detection network, and train and test the initial single-stage anchor-free target detection network using the final enhanced poultry frame image set; after training and testing, obtain the final single-stage anchor-free target detection network.

[0015] Preferably, step S6 includes the following steps: S61. Divide the final enhanced poultry frame image set into a training set and a validation set, and feed them into the initial single-stage no-anchor-box target detection network for supervised learning model training. The loss function of the initial single-stage anchorless object detection network includes classification loss, bounding box regression loss, and distribution focus loss; S62. After the initial single-stage no-anchor-box object detection network model is trained, the model performance will be evaluated on the validation set. If the performance is not up to standard, return to S61 and adjust the training strategy until the performance is up to standard. If the performance is up to standard, export the model and use operator fusion and low-precision quantization to convert it into a format supported by the lightweight inference engine of ONNX or TensorRT to obtain the final single-stage no-anchor-box object detection network. S63. Deploy the final single-stage anchorless target detection network on the edge computing nodes of a real farm or in a cloud-based AI monitoring system.

[0016] This invention also discloses a poultry target detection system, including an asset generation and optimization module, a rendering control module, a projection and purification module, a multi-level virtual-real migration enhancement module, and a training and edge deployment module; The asset generation and optimization module is responsible for reverse engineering the 3D white model based on the text-based or image-based 3D large model pipeline, performing PBR material attribute mapping association, and optimizing the polygon mesh topology. The rendering control module is used to randomize the number of individuals, 3D spatial position, pose matrix, and camera intrinsic and extrinsic parameters according to a preset probability distribution. The projection and purification module is used to solve the coordinates using matrix multiplication and camera projection mathematical formulas, followed by numerical clamping and severe occlusion filtering based on index mask. A multi-level virtual-real migration enhancement module is used to perform virtual-real migration and domain adaptation from a dual perspective; The training and edge deployment module is used to calculate the joint loss function and perform backpropagation iterative optimization.

[0017] The present invention has the following beneficial effects: 1. This invention effectively improves the quality and usability of poultry datasets through feedback control of image generation script parameters. By controlling the quality of 3D models through feedback detection, defective models such as mesh distortion, texture misalignment, and model scale distortion can be screened out in advance, preventing unqualified 3D materials from flowing into subsequent rendering processes. This significantly reduces issues such as mislabeling of group image boundaries and image distortion, avoiding repeated re-rendering and annotation, and compressing overall process resource consumption. Specifically, by reverting to S1 through closed-loop model control and reconstruction, the accuracy of poultry 3D modeling is continuously optimized, ensuring that the model's body shape and texture match the characteristics of real poultry. Qualified 3D models provide a standard base for rendering, annotation, and degradation processing, improving the accuracy of bounding box annotation and image matching, and reducing domain differences. After subsequent overlay of degradation models and style transfer, the resulting image samples have higher realism, expand the diversity of the dataset, and reduce the risk of dataset failure caused by defects in the underlying model. By refining the following parameters in the rendering control script, projection distortion caused by large-angle oblique shots in the image can be reduced, ensuring the quality of the final poultry frame image.

[0018] 2. This invention creatively utilizes the coordinate projection mathematical transformation formula based on the pinhole camera model at the bottom layer of the 3D graphics rendering engine to directly extract 2D bounding boxes from 3D space using a background computation matrix. This technical process completely eliminates the most expensive, tedious, and time-consuming costs of manual image acquisition in rural areas and frame-by-frame manual drawing in traditional computer vision tasks, compressing the data preparation cycle from months to hours. Furthermore, combined with an occlusion filtering verification algorithm based on depth buffering and color index map masks, the annotation accuracy reaches zero error at the mathematical level, eliminating dirty data pollution caused by subjective manual annotation. In addition, relying on programmable self- The automated scripting and Monte Carlo parameter space domain randomization control technology breaks the time and space constraints of physical world data acquisition. It can generate edge scene data that is difficult to capture in the real world and has dangerous or extremely random probability with near-zero marginal computing power cost. By forcibly feeding these sufficient hard samples to the YOLO detection network, the feature extraction dimension of the model is greatly enriched, and the generalization ability of the model when facing extremely complex and harsh agricultural environments in reality shows an exponential leap. Among them, edge scene data include extremely dark light at dawn, strong backlight interference at noon, ultra-high density occlusion of group gathering, and rare pathological postures.

[0019] 3. This invention employs a two-step domain adaptation enhancement strategy that combines low-level physical image signal degradation (Gaussian noise / discrete motion blur kernel superposition simulation) with advanced deep generative adversarial networks (CycleGAN cyclic consistency style transfer). This joint design mathematically ensures that the geometric and physical correspondence of the original rendered bounding boxes remains intact (benefiting from Cycle consistency loss), while effectively bridging and reconstructing the structural visual feature gap in color saturation, texture distribution, and random noise between pure fake data generated by computer graphics and images captured by inexpensive real-world monitoring equipment. This enables the target detection model, which was originally trained only on purely virtual synthetic fake data, to achieve stable detection accuracy and recall comparable to that trained on large-scale real manually labeled datasets, even without any fine-tuning with real data, once deployed in real agricultural hardware scenarios. It possesses extremely high commercial scalability, low-cost reuse, and cross-scenario cloning and promotion value.

[0020] 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

[0021] 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.

[0022] Figure 1 This is a schematic diagram illustrating how the present invention uses videos generated by generative AI to verify the model results of automatically labeled training. Figure 2 This is a schematic diagram illustrating how the model results of automatic annotation training are verified using real data according to the present invention. Figure 3 This is a schematic diagram illustrating an overview of the virtual goose flock of the present invention; Figure 4 This is a schematic diagram illustrating a virtual flock of geese under heavy rain conditions, as described in this invention. Figure 5 This is a schematic diagram of the simulated goose model of the present invention; Figure 6 This invention is illustrated by a graphic image. Detailed Implementation

[0023] 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.

[0024] 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.

[0025] Example 1 Please see Figure 1 This embodiment describes a method for adjusting data parameters in poultry detection using 3D rendering, including the following steps: S1. Generate multi-view two-dimensional images of the target poultry based on prompt words, and then process the multi-view two-dimensional images of the target poultry through a graph-generated three-dimensional model network, UV coordinate unrolling, PBR material mapping and simplified mesh processing to obtain a simplified three-dimensional model of the target poultry.

[0026] Please see Figure 3 , Figure 4 , Figure 5 , Figure 6 S1 includes the following steps: S11. Preset several prompt words to obtain a set of prompt words for generating poultry images; generate two-dimensional images of target poultry (such as geese or chickens of different breeds and feather colors) from multiple perspectives based on the set of prompt words for generating poultry images and using a text-to-image model to obtain a set of two-dimensional images of target poultry; input each image in the set of two-dimensional images of target poultry into a text-to-image model network (Image-to-3D) to obtain an initial three-dimensional white model of the target poultry; The text-based image model can adopt a latent diffusion model architecture, which consists of three core parts: a text encoder, an image autoencoder, and a denoising U-Net. The text encoder uses a CLIP or T5 model to encode the input prompts into text embedding vectors. The image autoencoder uses a VAE structure to compress the image into a low-dimensional latent space to reduce computational complexity. The denoising U-Net iteratively denoises the latent space by fusing text embeddings and image features through a cross-attention mechanism. The sampler uses DDIM or DPM-Solver++ to complete the denoising process in 20 to 50 steps. During generation, corresponding two-dimensional images are generated sequentially for multiple preset perspective prompts, ultimately forming a set of two-dimensional images of the target poultry. For example, the text-based image model can adopt a Stable Diffusion architecture based on a diffusion model. The 3D model network adopts a large-scale reconstruction model architecture, consisting of an image encoder, a three-plane generator, a neural radiation field decoder, and a mesh extraction module cascaded in sequence. The input multi-view 2D image is processed by the image encoder to extract depth visual features, and then the three-plane generator maps the features to three orthogonal planes XY, XZ, and YZ. The neural radiation field decoder uses a small MLP to regress the density and color of the sampling points in 3D space based on the three-plane features. Finally, the moving cube algorithm extracts and optimizes the explicit mesh from the density field, outputting the initial 3D white model of the target poultry. This network typically uses implicit neural representations, such as NeRF or explicit 3D Gaussian Splatting technology, to initially extract and generate the initial 3D white model of the target poultry through multi-view geometric consistency constraints.

[0027] S12. Automatically unfold the initial three-dimensional white model of the target poultry using UV coordinates, and then perform PBR material mapping to obtain the textured three-dimensional model of the target poultry. The extended quadratic error metric algorithm is then used to simplify the mesh of the textured target poultry 3D model, resulting in a simplified target poultry 3D model. Specifically, the core idea of ​​the QEM algorithm is to reduce the number of vertices and faces by iteratively performing edge collapse operations; let the edge to be collapsed be... ,in For the new vertices generated after folding, , The first , The original vertices; to scientifically measure the error caused by this folding to the overall geometric appearance of the model, the algorithm defines the error as the new vertices. To the original vertex and The sum of the squares of the perpendicular distances between all the relevant triangular faces (i.e., the supporting planes); Let the equation of one of the supporting planes be... ,in, It is a three-dimensional coordinate vector of any point on the plane, written in column vector form. , , , , , and , respectively, are the X, Y, and Z coordinates of any point on the plane; where Let be the unit normal vector of the supporting plane, with a magnitude of 1, and its direction is perpendicular to the supporting plane and points outward. The algebraic distance from the supporting plane to the origin; any vertex in space The square of the distance to this plane can be expanded as: ; Wherein, any vertex in space The first three components The fourth component is the position coordinates of the vertex in three-dimensional space, and the fifth component is the homogeneous scaling factor (fixed to 1), which is used to uniformly express translation transformations and is represented by homogeneous coordinates.

[0028] For ease of calculation, the above expression can be transformed into a 4×4 symmetric quadratic form matrix. (Fundamental Error Quadric); as follows: ; Quadratic matrix It is a 4×4 symmetric matrix, where the submatrix is... It is a 3×3 matrix, vector It is a 3×1 column vector, a scalar This matrix is ​​used to encode information about the plane equations in order to efficiently calculate the squared distance from a point to the plane; For each vertex in the initial mesh Its initial quadratic error matrix Defined as the triangles adjacent to this vertex. Sum of matrices:

[0029] Initial quadratic error matrix Defined as with vertex All adjacent triangular faces corresponding to The sum of matrices measures the cumulative error in the model geometry caused when the vertex is removed or moved. Represents the vertex All adjacent triangular faces.

[0030] In the evaluation side When the folding cost occurs, the new vertex It will inherit the quadratic error matrix with two vertices, that is ;in, , , Representing the new vertices and the original vertex and The quadratic error matrix; the geometric cost function resulting from performing this folding operation. That is, the quadratic form of the new vertex under the accumulated quadratic error matrix: ; The value after the quadratic form is expanded is the weighted sum of the squares of the distances from the new vertex to all relevant supporting planes. The smaller the value, the less the folding operation damages the geometric appearance of the model. The key to the algorithm lies in finding an optimal new vertex. The position makes the folding cost Minimize; this is a typical multivariate function extremum problem, which is solved by... Taking the partial derivatives of the three spatial coordinate components and setting them equal to zero yields a system of linear equations. Solving this system of equations (usually equivalent to solving for the inverse of a matrix) will give the optimal new vertex. The system calculates the cost of all potential folded edges, puts them into a priority queue (min-heap), takes the edge with the smallest cost each time and folds it, and dynamically updates the quadratic error matrix of the affected adjacent vertices until the target number of faces is reached.

[0031] The extended quadratic error metric algorithm described in S12 uses an extended high-dimensional QEM matrix. In addition to geometric position coordinates, the extended high-dimensional QEM matrix also introduces visual attributes such as vertex texture coordinates and normal vectors as additional dimensions to construct a hyperplane distance metric in a high-dimensional feature space. 3D mesh models directly output by Image-to-3D generative AI typically contain millions of high-poly triangles. In smart agriculture simulations, hundreds or thousands of poultry often need to be rendered simultaneously to simulate high-density farming environments. Using high-poly models can lead to severe memory overflow and excessively long rendering times. Therefore, this invention introduces a Quadratic Error Metric (QEM) algorithm with visual attribute features for mesh simplification, which significantly reduces the number of polygons while maintaining the outline of the poultry and the boundaries of the feather texture. To prevent severe stretching or tearing of poultry feather texture during the face reduction process, this invention employs an extended high-dimensional QEM matrix. In addition to geometric position coordinates, the system also introduces vertex texture coordinates (UV), normal vectors, and other appearance attributes as additional dimensions into the quadratic matrix, constructing a hyperplane distance metric within the high-dimensional feature space. This ensures that when the model is simplified from a 100,000-face level to a 2,000-face level low-poly model, it not only maintains the realism of the geometric silhouette but also locks in the pixel-level mapping accuracy of the PBR texture.

[0032] The primary prerequisite for generating highly realistic data in a virtual engine is a 3D digital asset with high fidelity and a reasonable polygonal topology. This step utilizes cutting-edge generative large-scale models to generate the basic 3D geometry of poultry, and combines it with the Quadric Error Metrics (QEM) algorithm for mesh optimization to meet the computational demands of subsequent large-scale cluster rendering. In addition, to ensure that the 3D model has physically consistent reflection characteristics with the real world, the system automatically performs UV coordinate unwrapping on the generated 3D white model and applies physically-based rendering (PBR) texture mapping. The PBR material system strictly follows the law of conservation of energy and includes multiple functional maps: the diffuse map (Albedo) defines the basic feather color of poultry; the normal map simulates the microscopic bumps and depressions of the feathers without increasing the geometric polygons by perturbing the surface normals; and the roughness map controls the degree of light scattering on the feather surface, constructing a 3D digital asset library with realistic light reflection and refraction characteristics.

[0033] S2. Perform quality inspection and control on the simplified target poultry 3D model in S1. If the inspection passes, the model is stored in the warehouse; otherwise, the control process returns to S1 and is repeated until it passes.

[0034] S2 includes the following steps: S21. Perform quality inspection on the simplified target poultry 3D model. The quality inspection indicators include model topology and model texture, etc.

[0035] S22. After the inspection is completed, if the inspection result shows that it passes, the simplified target poultry 3D model will be stored as an asset to obtain the final target poultry 3D model; otherwise, repeat S11 and S12 and provide feedback to modify the input parameters or re-optimize the mesh until the inspection result shows that it passes. The specific process of repeatedly executing S11 and S12 and providing feedback to modify input parameters or re-optimize the mesh until the detection result shows a pass is as follows: When the quality inspection fails, the system first locates the cause of the failure and performs corresponding feedback adjustments: If the inspection finds problems with the model's topology (such as non-manifold surfaces, free vertices, holes, or broken edges), it is judged as geometrically unqualified. The system automatically reverts to S12 and executes the mesh optimization retry process. Specific operations include dynamically adjusting the edge folding threshold in the extended quadratic error metric (QEM) algorithm, increasing or decreasing the maximum face count retention ratio from the current value by 10% to 20%, and increasing the weight coefficients of texture coordinates and normal vectors (such as increasing the texture weight from 1.0 to 1.5) to strengthen attribute preservation. Then, mesh simplification is re-executed. If it still fails after 3 retries, it reverts to S11 and adjusts the prompts for the graph model, adding keywords describing the model's topological clarity (such as "clear mesh boundaries" or "completely closed surfaces"). At the same time, it adjusts the output parameters of the graph-generated 3D model network, increasing the mesh resolution or enabling the hole filling post-processing option. If the detection reveals severe stretching, obvious seams, or blurring in the model texture, it is determined that the texture is unqualified. The system reverts to S11 and S12. On one hand, the prompts for the texture-generated model are adjusted to generate multi-view images with higher resolution (e.g., increasing from 512×512 to 1024×1024) and clearer texture details. On the other hand, a forced UV re-unwrapping step is added to the texture-generated 3D model, and the texture sampling density is increased (e.g., increasing the texture resolution from 1024×1024 to 2048×2048). At the same time, the proportion of simplified target faces in QEM is reduced to retain more texture mapping details. If the detection finds that the model material reflection properties do not meet the PBR standard (e.g., excessively high metallicity or excessively low roughness), feedback is provided to modify the PBR material texture parameters, adjusting the generation thresholds of diffuse map, normal map, and roughness map. All feedback adjustments are automatically triggered through a log file recording the failure type, and a retry counter is maintained. After each failure, the parameter combination is automatically adjusted, with a maximum of 5 retries. If it is still unqualified after 5 retries, the asset is marked as a failure and manual intervention is required to check the quality of the input prompt words. The above process ensures that the model iterates automatically until it passes all quality inspection indicators.

[0036] S3. Import the qualified poultry 3D model from S2 into the rendering engine to generate a poultry group image and mark the bounding box. Then check the accuracy of the marking and the matching degree of the image. If the validation passes, then validate the domain differences. If the domain differences validation passes, inspect the poultry group image after the domain differences validation and adjust the script parameters until the check result shows that it passes. If the domain differences validation fails, execute S4. If the verification fails, adjust the script parameters and repeat the verification of annotation accuracy and image matching until the verification passes.

[0037] S3 includes the following steps: Please see Figure 2S31. The final target poultry 3D model is imported into the 3D graphics rendering engine. The 3D graphics rendering engine generates a poultry flock in the virtual farm space based on a multivariate joint probability distribution function, and obtains a set of target poultry model flock frame images. The randomization dimension of the parameters in the virtual farm space includes spatial layout and posture variables as well as ambient lighting and camera variables.

[0038] Specifically, the joint probability distribution function of the multivariate can be defined using a Python script; The spatial layout and attitude variables refer to the random generation of the three-dimensional spatial coordinates of each poultry, and the use of quaternions. Control its rotation angle in three-dimensional space; then call the preset ribging and animation library to randomly assign different behavioral postures to each poultry (such as looking down to forage, spreading wings, running, lying down, etc.); and set high-density clustering parameters to generate difficult samples with severe physical occlusion between them. The ambient lighting and camera variables refer to the random adjustment of the position, color temperature (such as simulating the cool tone of the morning or the warm tone of the evening) and luminous intensity of global illumination (HDRI skybox) and local light sources in the scene through scripts; at the same time, a virtual camera is generated in three-dimensional space along a spherical trajectory or random coordinates, and the camera's pitch angle, focal length and depth blur parameters are dynamically changed. This method of generating parameter combinations through Monte Carlo sampling or exhaustive traversal enables the system to generate long-tail edge data (such as dense flocks of geese in extremely dark light before a rainstorm) that is difficult to capture completely in the real physical world with extremely low marginal computing power cost.

[0039] S32. Calculate the bounding box of each poultry in each frame image of the target poultry model group frame image set on the two-dimensional image to obtain the labeled poultry model group frame image set; While the ray-tracing rendering engine outputs the current frame image, the system must calculate the precise bounding box of each poultry in the scene on the two-dimensional image. This process relies rigorously on the pinhole camera model in computer graphics, and completes the mapping from three-dimensional to two-dimensional through the extrinsic matrix and the intrinsic matrix.

[0040] S32 includes the following steps: S321. Let the homogeneous coordinates of any corner point of the poultry 3D bounding box in the absolute world coordinate system be... ; in, This indicates the position coordinates of the corner point along the X-axis in the world coordinate system. Indicates the position coordinates along the Y-axis. The first three components represent the position coordinates along the Z-axis. These three components together determine the precise geometric position of the corner point in three-dimensional space, and their numerical units are consistent with those used in the world coordinate system (e.g., meters or centimeters). The fourth component is the scaling factor for homogeneous coordinates, fixed at 1. Its function is to represent the translation transformation of the original three-dimensional vector as a matrix multiplication form consistent with rotation and scaling, thus allowing the transformation to be performed by a single... The matrix can perform affine transformations such as rotation, translation, and scaling simultaneously.

[0041] And through the camera extrinsic matrix Transform points in the world coordinate system to the camera coordinate system with the camera's optical center as the origin to obtain coordinates. The calculation formula is as follows: ; in, A 3×3 orthogonal rotation matrix to reflect the spatial orientation of the camera. The translation vector that reflects the spatial position of the camera; S322, Application Camera Intrinsic Matrix Projecting 3D point perspective from the camera coordinate system onto a 2D image plane; intrinsic parameter matrix The optical properties of the virtual camera are encapsulated, and their form is as follows: ; in, , These represent the camera's focal length (in pixels) in the horizontal and vertical directions, respectively. The principal point of the image (usually the center of the image plane). This is the pixel skew factor (usually 0 in standard renderers); The complete mathematical equation for the perspective projection is: ; The left side of the equation yields a scaled homogeneous 2D coordinate; to obtain the actual pixel coordinates of this 3D vertex in the final 2D rendered image... The first and second components need to be divided by the third component.

[0042] Specifically, the process and principle of dividing the first and second components by the third component are as follows: In the perspective projection equation In the equation, the left side yields a scaled homogeneous two-dimensional coordinate. The first component The second component represents the scaled horizontal pixel coordinates. The third component represents the scaled vertical pixel coordinates. This is the depth scaling factor, whose value is equal to the point's position in the camera coordinate system. Principal optical axis depth (i.e., the distance from a point to the camera's optical center along the principal optical axis). This is used to obtain the actual pixel coordinates of the 3D vertex in the final 2D rendered image. The first component needs to be... Divide by the third component get , the second component Divide by the third component get This process essentially removes the scaling effect of depth information on the projection scale, accurately mapping 3D points onto the 2D image plane. This is known as the depth scaling factor. Its value is equal to the point in the camera coordinate system. Axial depth.

[0043] S323. Obtain the 8 3D axial bounding box vertices of the object at the object level, through matrix multiplication ( object.matrixworld The local bounding box coordinates are converted to world coordinates, and then the perspective projection logic is called (or the engine's built-in bpyextras.objectutils.worldeocameraview utility function is used directly) to calculate the set of 2D pixel coordinates corresponding to these 8 vertices. ; To generate the 2D rectangular bounding box required by the object detection network, the extreme values ​​of these projection point sets are taken in the image plane: ; ; ; ; in,( , ) indicates the first i The two-dimensional pixel coordinates obtained by projecting the vertices of the bounding box i =1,2,...,8; and These are the minimum and maximum horizontal pixel coordinates of all projected points, respectively. and These are the minimum and maximum vertical pixel coordinates of all projected points, respectively; Simultaneously, mathematical clamping operations are used to adjust the coordinates. , , , Limited to as well as Within the image resolution range; where as well as These are the width and height (in pixels) of the rendered output image, respectively. The mathematical clamping operation includes first obtaining the width of the rendered output image. and height Then clamp the two coordinates in the horizontal direction, if Then let ,like Then let Similarly, clamp the two coordinates in the vertical direction if... Then let ,like Then let If clamping occurs or If the bounding box is completely outside the frame, it will be determined and removed.

[0044] S324. Core Logic for Deep Occlusion Handling and Validity Verification: In dense poultry scenes, if the above mathematical projection is used directly, even if a poultry is completely physically occluded by an object in front (invisible to the naked eye in the final image), its 3D coordinates can still be projected and incorrect bounding boxes will be generated. This will introduce extremely serious noise (FalsePositives) into the model. To solve this problem, the system renders an object pass index map (Segmentation Mask) simultaneously with the RGB main channel. Each poultry in the object pass index map is assigned a unique solid grayscale value. The embedded OpenCV / Numpy Python script reads the object pass index map (OpenEXR full floating-point format to prevent precision loss) to count the total number of pixels in the image matrix that are equal to the poultry's unique ID. If the total number of pixels is lower than the set effective visibility threshold (e.g., 15% of its theoretical unoccluded area), the system determines that the poultry is severely occluded and invisible, and automatically removes the detection box data of the object from the final output annotation sequence. This mechanism ensures that the generated supervision signal achieves 100% high reliability.

[0045] YOLO format normalization conversion: Object detection algorithms (such as the YOLO series) require annotation files to be presented in a specific dimensionless normalization format. ; The final calculation result is obtained by performing coordinate transformation based on the extracted pixel-level extreme value boundaries; the transformation formulas are as follows: ; ; ; ; The horizontal normalized coordinates of the center point of the bounding box, with values ​​between 0 and 1; Represents the vertical normalized coordinates of the center point of the bounding box; Indicates the normalized width of the bounding box; This represents the normalized height of the bounding box. These four normalized coordinate values ​​together constitute the core content of the YOLO format annotation file, decoupling the annotation information from the original image resolution and facilitating uniform processing by the object detection network under different input image sizes. The final calculation results will be directly formatted and written to the corresponding .txt annotation file, achieving highly accurate data self-annotation; In actual Blender script execution, due to the complexity of the poultry model, directly extracting all vertices of the mesh for projection computation is extremely computationally intensive; the system accelerates the computation by directly obtaining the eight 3D axial bounding box vertices at the object-level.

[0046] S33. Verify the accuracy of annotation and the matching degree of each annotation content in the set of labeled poultry model group frame images. If the verification fails, return to S31 and adjust the script parameters, especially the control of edge scenes (such as extreme occlusion), until the verification passes. If the verification passes, compare the synthetic data with a small number of real samples to obtain the domain difference. If the domain difference is too large, proceed to step S4; if the difference is within an acceptable range, obtain the poultry flock image set after domain difference verification; then perform dataset diversity and long-tail data balance checks on each frame image in the poultry flock image set after domain difference verification. If the check results show uneven data distribution or insufficient specific edge scenes, return to step S31 and adjust the script parameters until the check results show that they pass, thus obtaining the final enhanced poultry frame image set; otherwise, directly use the poultry flock image set after domain difference verification as the final enhanced poultry frame image set. The process of returning to S31 and adjusting script parameters includes refining the following parameters in the rendering control script when the annotation accuracy or image matching verification fails, particularly for edge scenes such as extreme occlusion control: If the verification finds that a large number of poultry are missing or severely deviated due to mutual occlusion, the group density parameter is refined, reducing the number of poultry per frame from the current value by 20%~40%. Simultaneously, the probability weight of the quaternion pose distribution is adjusted to reduce the degree of overlap between models, and the minimum spacing constraint in the spatial layout parameters is refined, forcing that the 3D distance between any two poultry is not less than 0.5 times the diagonal length of the model bounding box. If the verification finds that the annotation box deviates significantly from the actual poultry outline, the camera intrinsic and extrinsic parameters are refined, narrowing the camera pitch angle sampling range from ±45° to ±25°, and simultaneously adjusting the focal length parameter from 18mm~50mm. The image thickness is set to 35mm~80mm to reduce projection distortion caused by large-angle oblique shots. If the verification process finds physical anomalies such as models intersecting or floating on the ground in the generated image, the ground collision detection parameters are refined, ground adsorption constraints in rigid body physics simulation are enabled, the gravity influence factor is increased from the default 1.0 to 1.5, and the bounding box collision response radius is set to 1.1 times the actual size of the model. If the verification process finds that the number of generated images for specific difficult scenes, such as extremely dark lighting with high-density occlusion, is insufficient, the Monte Carlo sampling parameters are refined, giving higher sampling weights to such edge scene combinations, increasing their occurrence probability from the default 5% to 30%, and adding a dedicated rendering round for this scene combination. All refinement operations are implemented by modifying the probability distribution function parameters in the rendering engine's Python script configuration file, and recording the parameter combinations after each refinement and the corresponding verification results to form a closed-loop feedback until the verification is passed.

[0047] Specifically, the domain difference is obtained by comparing the synthetic data with a small number of real samples. The domain difference is quantified using the Fréchet Inception Distance (FID) as the core evaluation indicator, supplemented by the Maximum Mean Discrepancy (MMD) for joint judgment. When the FID value is greater than 50, it is considered that the domain difference is too large, and S4 is required for multi-level virtual-real migration enhancement. When the FID value is less than or equal to 30, it is considered that the domain difference is within an acceptable range, and S5 can be directly executed for object detection network training. When the FID value is between 30 and 50, the MMD value of the synthetic data and real samples in the texture feature space is further calculated. If the MMD value is greater than 0.15, it is considered that the domain difference is too large; otherwise, it is considered acceptable. The above thresholds are based on comparative experiments of typical farm monitoring datasets and synthetic datasets and can be dynamically adjusted according to specific application scenarios.

[0048] After acquiring the optimized 3D assets, they are imported into a 3D graphics rendering engine. By utilizing a written automated control script (based on the Blender Python API bpy), various environmental variables of the scene are randomly combined with a high degree of freedom. Based on the principle of 3D to 2D photogrammetric projection, pixel-level accurate bounding box annotations are simultaneously exported. In particular, by using Python scripts to define a joint probability distribution function of multiple variables, dense flocks of poultry are dynamically generated in the virtual farm space, ensuring that the detection model trained subsequently has the robustness to cope with the endless changes in the real world.

[0049] S4. Overlay the physical and mathematical degradation model onto the poultry group image labeled in S3, and then perform unsupervised deep style transfer. S4 includes the following steps: S41. Because the CMOS sensors of inexpensive farm surveillance cameras often generate strong signal noise in poorly lit poultry houses, and the rapid movement of poultry will produce shutter integration motion blur; this system directly superimposes a strict physical and mathematical degradation model on each image in the labeled poultry model group frame image set to obtain the superimposed poultry model group frame image set; the physical and mathematical degradation model includes the addition of Gaussian noise, Poisson noise and motion blur.

[0050] Specifically, the Gaussian noise and Poisson noise are mainly used to simulate the thermal noise and photon shot noise of the sensor; these are then used to normalize the image pixel matrix. Superimposed independent and identically distributed additive white Gaussian noise ; ,in Let represent the image pixel matrix after superimposing independent and identically distributed additive white Gaussian noise. The sampling of the additive white Gaussian noise follows a normal distribution with a mean of 0. Its probability density function is ; in, Indicates noise value The probability density of occurrence Standard deviation, The variance is a natural constant, and this function describes the distribution characteristics of Gaussian noise: the closer the noise value is to 0, the higher the probability of it occurring; the probability of it being far from 0 decreases exponentially, where the variance... Dynamic inverse mapping is performed based on scene illumination intensity parameters (the darker the light, the greater the noise variance).

[0051] The motion blur is an integral blur effect that simulates poultry running or camera shake; the system constructs a two-dimensional directional linear filter kernel. (in For the random angle of motion, (where the length is the blurred pixel length), and then apply it to the image using a discrete two-dimensional convolution operation; the formula for the discrete two-dimensional convolution operation is as follows: ; Represents the original image in pixel coordinates Pixel value at that location, This indicates that the motion blur convolution kernel is at the offset. The weight value at that point, This indicates the pixel coordinates of the image after motion blur processing. Pixel value at, double summation symbol This means that the convolution kernel iterates through and accumulates all pixel positions within its coverage area. The overall meaning is to perform a convolution operation between the original image and the motion blur kernel. That is, each output pixel is calculated by the weighted sum of its surrounding neighboring pixels, thereby simulating the motion blur effect caused by the rapid movement of poultry or camera shake. Through physical-level degradation operations, the model is forced to learn more robust edge gradient features.

[0052] S42. Physical degradation can only simulate low-level visual artifacts. To further eliminate the global stylistic differences between the synthetic model and real farm scenes in terms of feather texture, reflective properties, etc., the system adopts unsupervised deep style transfer based on CycleGAN to transfer the synthetic source domain with physical degradation. Convert to a target domain with characteristics of a real farm After the conversion is completed, a set of poultry frame images with virtual-real migration enhancement is obtained.

[0053] Since collecting "synthetic-real" paired data with identical poses and perspectives is impossible, recurrent consistency generative adversarial networks (GANs) solve this problem through a non-paired game-theoretic learning architecture; it contains two mapping generators. (Synthetic to Realistic) and (Real-to-Real conversion), and the corresponding two discriminators. and The optimization of the entire network is a process of finding Nash equilibrium, which specifically relies on the joint gradient constraint of the three loss functions: adversarial loss, cycle consistency loss, and identity preservation loss. Among them, the adversarial loss aims to ensure that the image distribution generated by the generator seamlessly approximates the data distribution of the target domain; to overcome the gradient vanishing problem during training, a least-squares-based LSGAN loss is adopted; and the generator G and discriminator... For example, the calculation formula is as follows: ; in, Indicates resistance to loss; discriminator Attempting to use real farm images The generated image is scored as 1. The score is 0; while the generator G tries its best to make it 0. The generator approaches 1 to "deceive" the discriminator; through this adversarial game, the generator gradually learns to generate images that approximate the distribution of real domain data, thereby minimizing the domain difference between synthetic data and real data. E It is to calculate the expectation, which is equivalent to: substituting all samples in the dataset that meet the sampling rules into the loss function in parentheses, summing them all and then taking the average; =Source domain synthesized image sample (synthetic domain image, input to generator G); =Target domain real image samples (real domain image, discriminator) (real samples) Represents the true data distribution; Real image of the target domain Data distribution Source domain synthesized image Data distribution; express: Random sampling is performed on the real dataset of the target domain; express: Random sampling is performed on the source domain synthetic dataset; Overall meaning: It was randomly selected from the overall distribution of the real dataset in the target domain; Overall meaning: It was randomly sampled from the overall distribution of the source domain synthetic dataset; the first item: (True Sample Loss); Meaning: Sampling from the real target dataset Discriminator The goal is to score the real-world image in a manner that approximates parameter tuning domain 1; if the parameter tuning domain... The further away from the parameter control domain (parameter 1), the greater the squared loss, forcing the discriminator to classify the real image as real. Second term: (Loss from generating fake samples), meaning: the domain of parameter modulation sampled from the source domain. Generating a fake image via G Discriminator The goal is to score fake images close to the parameter control range of 0; if the score deviates from the parameter control range of 0, the loss increases, thus constraining the discriminator to distinguish between real and fake images.

[0054] Cyclic consistency loss is used to ensure that bounding boxes do not fail; simple adversarial loss may lead to "mode collapse," causing the generator to arbitrarily tamper with image content (e.g., rendering one goose as two, or changing the relative positions of the geese), which will directly cause the bounding boxes generated in S31 and S32 to fail due to incorrect positions; the cycle consistency constraint requires that the image undergoes... After the bidirectional reconstruction loop is closed, the original pixel structure must be restored; the calculation formula is as follows: ; in, This represents the cycle consistency loss; through pixel-level penalties based on the L1 norm, the network is forced to preserve the geometry and topological information of the poultry.

[0055] Identity preservation loss is designed to further prevent excessive color deviation in the generator (e.g., forcibly rendering daytime as nighttime). This loss is achieved by adjusting the target domain. The image is sent to the generator In the generator G, it is mandatory that the output matches the input: ; in, This indicates a loss of identity retention; Total objective loss function The weighted sum of the above three: ; Represents generator With discriminator The losses in the confrontation, among which Responsible for synthesizing the source domain Image converted to real target domain The style, Responsible for determining whether the input image belongs to the real target domain; the second item Indicates reverse generator With discriminator The losses in the confrontation, among which Responsible for the real target domain Image conversion back to the synthetic source domain The style; the third item The cycle consistency loss multiplied by the weighting factor Its function is to force the image to undergo [processing / processing]. After passing through The bidirectional conversion can restore the original image, thus ensuring that the geometric structure and positional information are not destroyed; the fourth item The identity retention loss is multiplied by a weighting factor. Its function is to prevent the generator from excessively altering the color and hue of the image, requiring the output to be as consistent as possible with the input target domain image. The overall meaning of this total objective loss function is: by minimizing the weighted sum of the above four losses, the network can achieve the transfer of the synthetic image to a realistic style, while strictly preserving the poultry geometry, bounding box positions, and basic color structure in the original image, ensuring that the annotation box information is not lost during the style transfer process.

[0056] Although 3D rendering engines can simulate ray tracing, there is still a significant "domain gap" between synthetic images generated by pure mathematical algorithms (SourceDomain) and real-world images captured by monitoring cameras in a farm (TargetDomain), due to differences in sensor physical noise distribution, optical lens distortion, and high-level semantic textures. If unprocessed synthetic data (Sim) is used directly for training, the model's feature matching channels in the real scene (Real) will fail. To address this, this invention designs a two-level domain adaptation module consisting of physical signal degradation injection and deep unsupervised style transfer. After being rendered by CycleGAN, the output dataset has three advantages: it retains a rigorous automatic coordinate frame, covers the rich long-tail distribution features of the synthesis space, and is covered with a low-level lighting and shadow that is indistinguishable from a real farm, thus achieving a perfect data loop.

[0057] S5. Check the poultry frame image superimposed and migrated in S4 and adjust the script parameters until the check result shows that it passes. S5 includes the following steps: S51. Perform dataset diversity and long-tail data balance checks on each frame image in the virtual-real migration enhanced poultry frame image set. If the check results show uneven data distribution or insufficient specific edge scenes, return to S31 and adjust the script parameters until the check results show that they pass, and obtain the final enhanced poultry frame image set; otherwise, directly use the virtual-real migration enhanced poultry frame image set as the final enhanced poultry frame image set. The process of returning to S31 and adjusting script parameters includes the following adjustments when the dataset diversity and long-tail data balance check results show uneven data distribution or insufficient specific edge scenes. The system returns to S31 and refines the following parameters in the rendering control script: If the check finds that the sample proportion under a specific lighting condition is too low, such as extremely dark lighting scenes being less than 5% of the total sample size, then the ambient lighting parameters are refined, reducing the light source intensity sampling range from the usual 0.5 to 1.5 to 0.05 to 0.3, while adjusting the color temperature sampling range to 2000K to 3000K to simulate a dimly lit breeding environment; if the check finds that high-density clustering scenes are missing, then the group density parameters are refined, increasing the number of poultry per frame from the usual range of 10 to 50 to 80 to 150, while adjusting the spatial distribution probability weight to increase the probability of clustering poultry in the area near the feeding trough; if the check finds extreme posture scenes such as wing-spreading, fighting, or falling... If there are insufficient ground samples, the skeletal animation parameters are refined to assign higher random sampling weights to these rare poses, increasing their occurrence probability from the default 5% to 10% to 30% to 50%. If the inspection finds that samples of specific camera perspectives, such as overhead, low-angle, or extreme tilt angles, are missing, the camera intrinsic and extrinsic parameters are refined to expand the pitch angle sampling range from the usual -30 to 30 degrees to -60 to 60 degrees, while increasing the random sampling density along the spherical trajectory. If the inspection finds that there are insufficient samples of specific breeds or plumage colors of poultry, the prompt word parameters of the Wensheng image model are refined to assign higher sampling weights to keywords of that breed or to add special rendering rounds. All refinement operations are implemented by modifying the probability distribution function parameters in the rendering engine's Python script configuration file, and the parameter combinations and corresponding data distribution improvements after each refinement are recorded to form a closed-loop feedback until all distribution indicators meet the standards.

[0058] Example 2 This embodiment discloses a poultry target detection system, which can implement the methods of the above embodiments, including an asset generation and optimization module, a rendering control module, a projection and purification module, a multi-level virtual-real migration enhancement module, and a training and edge deployment module; The Asset Generation and Optimization module is responsible for reverse engineering 3D white models based on text-based or image-based 3D large model pipelines, performing PBR material attribute mapping association, and optimizing polygon mesh topology. Specifically, it is responsible for reverse engineering 3D white models based on text-based or image-based 3D large model pipelines, performing PBR material attribute mapping association, and calling a quadratic error matrix algorithm with attribute protection to optimize polygon mesh topology. The input of this module includes text prompt word sequences, single-view or multi-view reference images, and core parameters such as QEM folding threshold and maximum face count. The module integrates an asset quality detection and judgment node to evaluate the topology and texture quality of the generated model. Unqualified models will be fed back to the previous steps for parameter adjustment or regeneration. The final output is a 3D poultry model with a reasonable topology and high-fidelity PBR texture, supporting common formats such as .obj and .gltf.

[0059] The rendering control module is used to randomize the number of individuals, 3D spatial positions, pose matrices, and camera intrinsic and extrinsic parameters according to a preset probability distribution. Specifically, it receives the aforementioned low-poly 3D assets, constructs a Cartesian coordinate system using an embedded Python script (such as Blender's bpy library), and randomizes the number of individuals, 3D spatial positions, pose matrices, and camera intrinsic and extrinsic parameters according to a preset probability distribution. The engine's input includes a 3D model file library, camera intrinsic and extrinsic parameters, and random sampling probability distribution maps of illumination intensity, color temperature, and population density. The engine supports refining parameters based on feedback from subsequent decision nodes to generate more targeted edge scene data. Its output consists of raw rendering sequence frames (clean and free of physical noise) and auxiliary channels, including depth maps and color index mask maps.

[0060] The projection and refinement module is used to calculate coordinates using matrix multiplication and camera projection mathematical formulas, followed by numerical clamping and severe occlusion filtering based on index masks. Specifically, it obtains the 3D bounding box coordinates (8 poles) of objects in the current rendering frame in real time, calculates the coordinates using matrix multiplication and camera projection mathematical formulas, and then applies numerical clamping and severe occlusion filtering based on index masks. The inputs to this module include the camera focal length and sensor principal point, the object's local world matrix, and the pixel resolution of the rendered output. The module internally includes a label accuracy verification node to verify the matching degree between the generated label boxes and the image content. The final output is a text label file (.txt or .xml) conforming to the YOLO standard format, containing the category number and normalized center coordinates and width and height.

[0061] A multi-level virtual-real transfer enhancement module is used to perform virtual-real transfer and domain adaptation from dual perspectives. Specifically, it is used to perform virtual-real transfer and domain adaptation from dual perspectives. The first level injects physical signal degradation features with specific probability densities into the original frame, including Gaussian noise, Poisson noise, and 2D motion blur convolution kernels. The second level performs style transfer of deep visual underlying texture and color distribution through the deployed and trained CycleGAN network. The input of this module includes the original clean rendering frame, the target domain visual reference map (real farm monitoring and capture image set), as well as noise variance hyperparameters and blur kernel size, etc. The module has a dataset diversity and balance check node to ensure the reasonable distribution of the generated data. Its output is a visually highly realistic multimodal synthetic dataset, the image visual features have been transferred, and it strictly corresponds to the original automatically labeled box data at the pixel level.

[0062] The training and edge deployment module is used to calculate the joint loss function and perform backpropagation iterative optimization. Specifically, it loads the high-quality dataset and labeled data after domain adaptation transformation, dynamically allocates samples through the TaskAlignedAssigner of the deep neural network, calculates the joint loss function of BCE classification, CIoU regression, and DFL distribution, and performs backpropagation iterative optimization. The input of this module includes the transformed synthetic dataset and training strategy hyperparameters (initial learning rate, batch size, and weight coefficients of various loss functions). The module has a model performance evaluation node, which verifies the model based on metrics such as test set mAP and recall rate in different scenarios. At the same time, the module establishes a deployment performance monitoring feedback loop, continuously collecting new deviations in real data and feeding them back to the virtual-real migration module to form a continuous optimization iterative mechanism. Finally, it outputs a lightweight model weight file (such as .pt or .onnx format) that has been iteratively trained to convergence, which can be directly mounted on embedded devices to perform high frame rate real-time inference computation.

[0063] The above five modules are tightly coupled through preset judgment nodes and feedback loops, forming a complete automated closed-loop system from asset construction, data synthesis, automatic annotation, virtual-to-real migration to model training and deployment monitoring.

[0064] Example 3 This embodiment discloses an application of the data parameter control method for poultry detection based on the 3D rendering in Embodiment 1 to poultry target detection, and also includes the following steps: S6. Construct an initial single-stage anchor-free target detection network, and train and test the initial single-stage anchor-free target detection network using the final enhanced poultry frame image set; after training and testing, obtain the final single-stage anchor-free target detection network.

[0065] S6 includes the following steps: S61. Divide the large-scale, unmanned, and highly accurate final enhanced poultry frame image set generated by the aforementioned steps into a training set and a validation set, and feed them into an initial one-stage anchor-free object detection network (such as Ultralytics YOLOv8 or YOLO11 architecture) for supervised learning model training. The loss function of the initial single-stage anchorless object detection network includes classification loss, bounding box regression loss, and distribution focus loss.

[0066] For example, taking Ultralytics YOLOv8 as an example, the initial single-stage anchor-based object detection network structure adopts a decoupled head, abandoning the previous practice of mixing classification and regression in the same convolutional channel, which greatly alleviates the conflict between multi-task learning. In terms of positive and negative sample allocation strategy, it abandons the static anchor-based matching that heavily relies on hyperparameters, and instead adopts the TaskAlignedAssigner dynamic allocation mechanism. This mechanism calculates the "alignment metric" by calculating the weighted product of the object classification prediction score and the IoU of the predicted box, and dynamically selects the Top-K grid points as positive samples. The calculation formula is as follows: ; in To predict the confidence score of the network output for classification, To predict the Intersection over Union (IoU) value between the bounding box and the ground truth (GT) bounding box, and An adjustment scalar to balance the degree of alignment between classification and positioning.

[0067] The weight update of the deep initial single-stage anchor-free object detection network is guided by three loss functions, and the overall optimization objective is calculated as follows: ; in, Represents classification loss. This represents the bounding box regression loss. Indicates the distribution focus loss. , , These represent the weight coefficients of classification loss, bounding box regression loss, and distribution focus loss, respectively. The reason for using classification loss is that, in practical applications, there may be multiple class mixtures (e.g., free-range chickens, ducks, and geese mixed together). Therefore, the system uses binary cross-entropy loss (BCEWithLogitsLoss) based on the sigmoid function in the classification branch instead of the standard Softmax CrossEntropy, thus allowing a single grid to output multiple label probabilities. The calculation formula is as follows: ; In the formula: This represents the total number of samples (i.e., the total number of all predicted grid points). Indicates the first The true label of each sample is either 0 or 1 (1 represents that the grid point belongs to the target category, and 0 represents that it does not). Indicates to The probability value obtained after applying the Sigmoid function is between 0 and 1. For the natural logarithm function, The model represents the first The original score (logit) predicted for each sample.

[0068] The reason for using bounding box regression loss is to replace the earlier L1 or L2 distance loss and instead use Complete IoU (CIoU) Loss. CIoU comprehensively considers the overlap area between the predicted box and the ground truth box, the Euclidean distance between the center points, and the consistency of the aspect ratio. It can effectively accelerate network convergence and improve the localization accuracy of tightly occluded objects. The calculation formula is as follows: ; ; In the formula: Indicates the center of the prediction box Centered with the automatic annotation box The Euclidean distance between them This represents the diagonal length of the smallest closure rectangle that can simultaneously contain both the predicted bounding boxes and the automatically labeled bounding boxes. It is a parameter that measures the consistency of aspect ratio. Indicates the width of the ground truth bounding box. Indicates the actual height of the annotation box, Indicates the width of the prediction box, Indicates the height of the prediction box. The trade-off parameter represents the balance weights.

[0069] The reason for using distributed focus loss is that in extremely high-density poultry overlapping scenarios, the boundaries of targets are often extremely blurry, making direct regression using the absolute Dirac distribution no longer applicable. The YOLO architecture innovatively introduces DFL (Distributed Focus Loss), which models the edge positions of the bounding box as a continuous probability distribution and optimizes on this distribution. DFL optimizes two adjacent discrete intervals around the target position through cross-entropy. and The probability of () is used to make the network focus more on the peak of the true distribution. The calculation formula is as follows: ; In the formula: This represents the total number of discretized intervals, that is, the number of discrete grids into which a continuous range of position coordinates is divided. Represents the true location of the target bounding box edge (in discrete coordinates). This indicates that the model predicts at discrete locations. The probability value at the location, This indicates that the model predicts at discrete locations. The probability value at that location; This unique loss function design significantly improves the stability and recall of the model in dealing with occlusion caused by dense poultry flocks.

[0070] S62. After the initial single-stage anchorless object detection network model is trained, the model performance will be evaluated on the validation set. If the performance is not up to standard, return to S61 and adjust the training strategy (such as data augmentation weights, hyperparameters, etc.) until the performance meets the standard. If the performance meets the standard, the model will be exported and converted into a format supported by the lightweight inference engine of ONNX or TensorRT using operator fusion and low-precision quantization to obtain the final single-stage anchorless object detection network.

[0071] The model performance evaluation metrics include detailed mAP and recall rate by scenario type. Specifically, model performance is evaluated using multiple core metrics on the validation set, with the following target ranges: Mean accuracy (mAP) at an IoU threshold of 0.5 must reach at least 85%, and mAP at an IoU threshold of 0.5:0.95 must reach at least 65%; mean accuracy for each category (e.g., different breeds or postures of poultry) must not be lower than 80% to exclude cases of insufficient training for a particular category; recall must reach at least 80% at a confidence threshold of 0.5 to measure the model's ability to detect poultry in densely occluded scenes. For long-tail edge scenarios (such as extremely low lighting, high-density occlusion, rare poses, etc.), the recall rate calculated separately for each scenario type should reach more than 70% to ensure the model's generalization ability on difficult samples; the localization accuracy is measured by the CIoU metric, and the average CIoU value between the predicted bounding box and the ground truth bounding box should reach more than 0.85; when all the above metrics are met simultaneously, the performance is considered satisfactory; if any metric fails to reach the corresponding threshold, the performance is considered unsatisfactory, and the system needs to return to S61 to adjust the training strategy (such as adjusting the learning rate, increasing the number of training rounds, modifying the loss function weights, or enhancing the data augmentation strategy) before retraining and evaluation.

[0072] S63. Deploy the final single-stage frameless target detection network on the edge computing nodes of a real farm or in a cloud-based AI monitoring system. Specifically, after the initial single-stage anchor-box-less object detection network model is validated and fully converged on the training set, it is exported and converted into a format supported by lightweight inference engines such as ONNX or TensorRT using operator fusion and low-precision quantization (e.g., FP16 / INT8). Finally, this high-precision, high-frame-rate poultry detection and counting model (the final single-stage anchor-box-less object detection network) is deployed on edge computing nodes in real farms or cloud AI monitoring systems. It can directly receive RTSP video streams from real IP cameras to achieve low-latency, real-time, accurate counting and trajectory tracking of poultry. At the same time, the system will monitor deployment performance, that is, continuously collect new deviations in real data and feed them back to S4 (virtual-real transfer enhancement), forming a continuously optimized closed loop, constantly iterating the model to adapt to environmental changes.

[0073] 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.

[0074] 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 method of data parameter regulation for three-dimensional rendering of poultry detection, characterized in that, Includes the following steps: S1. Generate a multi-view two-dimensional image of the target poultry based on the prompt words, and then process the multi-view two-dimensional image of the target poultry through a graph-generated three-dimensional model network, UV coordinate unrolling, PBR material mapping and simplified mesh processing to obtain a simplified three-dimensional model of the target poultry. S2. Perform quality inspection and control on the simplified target poultry 3D model in S1. If the inspection passes, it is put into storage; otherwise, the control process returns to S1 and is repeated until it passes. S3. Import the qualified poultry 3D model from S2 into the rendering engine to generate a poultry group image and mark the bounding box. Then check the accuracy of the marking and the matching degree of the image. If the verification passes, then verify the domain difference. If the domain difference verification passes, check the poultry group image after the domain difference verification and adjust the script parameters until the check result shows that it passes. If the domain difference verification fails, execute S4; If the verification fails, adjust the script parameters and repeat the verification of annotation accuracy and image matching until the verification passes. S4. Overlay the physical and mathematical degradation model onto the poultry group image labeled in S3, and then perform unsupervised deep style transfer. S5. Check the poultry frame image superimposed and migrated in S4 and adjust the script parameters until the check result shows that it passes.

2. The method of claim 1, wherein, S1 includes the following steps: S11. Preset several prompt words to obtain a set of prompt words for generating poultry images; generate two-dimensional images of the target poultry from multiple perspectives based on the set of prompt words for generating poultry images and use a text-based image model to obtain a set of two-dimensional images of the target poultry; input each image in the set of two-dimensional images of the target poultry into a text-based three-dimensional model network to obtain an initial three-dimensional white model of the target poultry. S12. Automatic UV coordinate unfolding is performed on the initial 3D white model of the target poultry. After unfolding, PBR material mapping is performed to obtain the textured 3D model of the target poultry. Then, the extended quadratic error metric algorithm is used to simplify the mesh of the textured 3D model of the target poultry to obtain the simplified 3D model of the target poultry.

3. The method of claim 2, wherein: The extended quadratic error metric algorithm described in S12 employs an extended high-dimensional QEM matrix. In addition to geometric position coordinates, the extended high-dimensional QEM matrix also introduces vertex texture coordinates and visual attributes of normal vectors as additional dimensions to construct a hyperplane distance metric in a high-dimensional feature space.

4. The method of claim 3, wherein, S2 includes the following steps: S21. Perform quality inspection on the simplified target poultry 3D model. The quality inspection indicators include model topology and model texture. S22. After the test is completed, if the test result shows that it passes, the simplified target poultry 3D model will be stored as an asset to obtain the final target poultry 3D model; otherwise, S11 and S12 will be executed repeatedly and feedback will be provided to modify the input parameters or re-optimize the mesh until the test result shows that it passes.

5. The method of claim 4, wherein, S3 includes the following steps: S31. The final target poultry 3D model is imported into the 3D graphics rendering engine. The 3D graphics rendering engine generates a poultry flock in the virtual farm space based on the joint probability distribution function of multiple variables, and obtains a set of target poultry model flock frame images. S32. Render and calculate the bounding box of each poultry in each frame image of the target poultry model group frame image set on the two-dimensional image to obtain the labeled poultry model group frame image set. S33. Verify the accuracy and image matching of each labeled content in the labeled poultry model group frame image set. If the verification fails, return to S31 and adjust the script parameters until the verification passes. If the verification passes, compare the synthetic data with a small number of real samples to obtain the domain difference. If the domain difference does not meet the requirements, execute S4. If the difference meets the requirements, obtain the poultry group image set after domain difference verification. Then, check the dataset diversity and long-tail data balance of each frame image in the poultry group image set after domain difference verification. If the check results show uneven data distribution or insufficient specific edge scenes, return to S31 and adjust the script parameters until the check results show that they pass, and obtain the final enhanced poultry frame image set. Otherwise, directly use the poultry group image set after domain difference verification as the final enhanced poultry frame image set.

6. The method for adjusting data parameters for poultry detection using 3D rendering according to claim 5, characterized in that: During the rendering process in S32, an object index channel map needs to be rendered synchronously. Each poultry in the object index channel map is assigned a unique solid gray value. By reading the object index channel map, the total number of pixels in the image matrix that are equal to the corresponding poultry's unique ID is counted. If the total number of pixels is lower than the set effective visibility threshold, it is determined that the poultry is severely occluded and invisible, and the detection box data of the poultry object is automatically removed from the final output annotation sequence. The coordinate transformation operation is performed based on the extreme values ​​of the projection point set to obtain the final calculation result. The final calculation result is then directly formatted and written into the corresponding annotation file.

7. The method for adjusting data parameters for poultry detection using 3D rendering according to claim 6, characterized in that, S4 includes the following steps: S41. A strict physical-mathematical degradation model is superimposed on each image in the labeled poultry model group frame image set to obtain the superimposed poultry model group frame image set; the physical-mathematical degradation model includes the addition of Gaussian noise, Poisson noise, and motion blur; S42. Unsupervised deep style transfer is performed using a cycle-consistent generative adversarial network to transform the synthetic source domain with physical degradation into a target domain with real farm features. After the transformation, a set of poultry frame images enhanced by virtual-real transfer is obtained.

8. The method for adjusting data parameters for poultry detection using 3D rendering according to claim 7, characterized in that, S5 includes the following steps: S51. Perform dataset diversity and long-tail data balance checks on each frame image in the virtual-real migration enhanced poultry frame image set. If the check results show uneven data distribution or insufficient specific edge scenes, return to S31 and adjust the script parameters until the check results show that they pass, and obtain the final enhanced poultry frame image set; otherwise, directly use the virtual-real migration enhanced poultry frame image set as the final enhanced poultry frame image set.

9. A system for implementing the data parameter control method for poultry detection using three-dimensional rendering as described in any one of claims 1-8, characterized in that: This includes modules for asset generation and optimization, rendering control, projection and purification, and multi-level virtual-real migration enhancement. The asset generation and optimization module is responsible for reverse engineering the 3D white model based on the text-based or image-based 3D large model pipeline, performing PBR material attribute mapping association, and optimizing the polygon mesh topology. The rendering control module is used to randomize the number of individuals, 3D spatial position, pose matrix, and camera intrinsic and extrinsic parameters according to a preset probability distribution. The projection and purification module is used to solve the coordinates using matrix multiplication and camera projection mathematical formulas, followed by numerical clamping and severe occlusion filtering based on index mask. The multi-level virtual-real migration enhancement module is used to perform virtual-real migration and domain adaptation from a dual perspective.

10. An application of a data parameter control method for poultry detection based on three-dimensional rendering according to any one of claims 1-8 in poultry target detection.

Citation Information

Patent Citations

  • Three-dimensional model simplifying method, device and equipment

    CN110298922A

  • Three-dimensional object material mapping generation method based on generative prior

    CN121437759A