A method and device for determining the amount of movement of a chicken, a storage medium and an electronic device

By using federated learning and video analytics, the amount of movement in chickens is automatically calculated, which solves the problems of low efficiency and poor accuracy of manual observation in traditional broiler breeding, and improves breeding efficiency and chicken product quality.

CN119648746BActive Publication Date: 2026-01-23CHINA AGRI UNIV +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411907867.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2026-01-23
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

In traditional broiler breeding, the measurement of chicken activity relies on manual observation, which leads to low efficiency and poor accuracy, affecting breeding progress and the quality of chicken products.

Method used

By employing a federated learning approach, and utilizing a pre-trained target recognition model and multi-target tracking algorithm, the movement of chickens is automatically calculated through video frame recognition and tracking.

Benefits of technology

It enables efficient and accurate measurement of chicken activity levels, reduces human intervention, and improves the objectivity and accuracy of breeding data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648746B_ABST
    Figure CN119648746B_ABST
Patent Text Reader

Abstract

The application provides a method and device for determining the amount of movement of a chicken, a storage medium and an electronic device. The method comprises: obtaining a target chicken video frame; the target chicken video frame is a current video frame to be identified in a chicken video; identifying the target chicken video frame using a pre-trained target identification model to obtain an identification result of the target chicken video frame, the identification result comprising at least one chicken image region information; processing the identification result of the target chicken video frame using a pre-set multi-target tracking algorithm to obtain a multi-target tracking result of the target chicken video frame; the multi-target tracking result comprising at least a movement trajectory of each chicken in the target chicken video frame; and determining the amount of movement of each chicken according to the movement trajectory of each chicken in the target chicken video frame. The method provided by the application can efficiently and accurately measure the amount of movement of a chicken.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a chicken movement determination method and device, a storage medium and an electronic device. BACKGROUND

[0002] With the continuous growth and consumption upgrading of China's chicken consumption market, consumers' demand for chicken quality is constantly improving. Traditional large-scale production mode, although it has ensured the supply of the market in the past, but gradually can not meet the needs of consumers in the new era for higher quality and diversified chicken products. In order to adapt to this trend, speed up the development of breeding industry, and cultivate high-quality broiler varieties that can meet market demand, has become the core task of industry development.

[0003] In the current broiler breeding practice, the determination of phenotypic traits mostly depends on manual observation. This method not only significantly increases the workload, but also due to the influence of human factors, it is difficult to achieve the ideal level of repeatability and accuracy of the collected data. Especially in the evaluation of the movement of breeding chickens, the traditional observation method often relies on the experience of observers and uses a stopwatch, a tape measure and other simple tools to estimate. This method is low in efficiency, and it is easy to cause unnecessary pressure to the breeding chickens due to direct intervention, affecting their normal growth and development, so that the observation results obtained finally lack objectivity and scientific basis. This situation not only limits the efficiency and accuracy of breeding work, but also hinders the development of high-quality broiler varieties, and indirectly weakens the supply capacity of high-quality chicken products in the market. SUMMARY

[0004] The technical problem to be solved by the present application is to provide a chicken movement determination method and device, a storage medium and an electronic device, which can efficiently and accurately measure the movement of chickens. The specific scheme is as follows:

[0005] A chicken movement determination method applied to a first participant of federated learning, comprising:

[0006] Obtaining a target chicken video frame; the target chicken video frame is a video frame to be identified in a chicken video;

[0007] Using a pre-trained target recognition model to identify the target chicken video frame, obtaining an identification result of the target chicken video frame, the identification result comprising at least one chicken image region information;

[0008] Using a preset multi-target tracking algorithm to process the identification result of the target chicken video frame, obtaining a multi-target tracking result of the target chicken video frame; the multi-target tracking result at least includes the movement trajectory of each chicken in the target chicken video frame;

[0009] determine an amount of movement of each of the chickens according to the movement trajectory of each of the chickens in the target chicken video frame.

[0010] Optionally, the method further comprises:

[0011] In a case where the target chicken video frame is not the first video frame in the chicken video, a similarity between each chicken image region information in the recognition result of the target chicken video frame and historical chicken image region information of a historical recognition result of a previous video frame is determined, the similarity including an appearance feature similarity, a spatial scale similarity, and a running trajectory similarity.

[0012] According to the similarity between each of the chicken image region information and each of the historical chicken image region information, the chicken image region information and the historical chicken image region information belonging to each chicken are determined.

[0013] According to the chicken image region information and the historical chicken image region information of each of the chickens, a multi-target tracking result of the target chicken video frame is obtained.

[0014] Optionally, the method further comprises:

[0015] detecting whether the movement trajectory of each of the chickens in the target chicken video frame meets a preset optimization condition.

[0016] optimizing the movement trajectory meeting the optimization condition.

[0017] After the movement trajectory meeting the optimization condition is optimized, an amount of movement of each of the chickens is determined according to the current movement trajectory of each of the chickens in the target chicken video frame.

[0018] Optionally, the training process of the target recognition model comprises:

[0019] an initial YOLOv7 model and a first training data set are obtained, the first training data set including a plurality of first training video frames, each of the first training video frames including label box information for labeling each chicken image region in the first training video frame.

[0020] the initial YOLOv7 model is trained using the first training data set.

[0021] If the initial YOLOv7 model meets the preset training completion conditions, the initial YOLOv7 model that meets the training completion conditions is determined as the trained target recognition model.

[0022] Optionally, in the above method, determining the amount of motion for each chicken based on the motion trajectory of each chicken in the target chicken video frame includes:

[0023] Obtain the correspondence between the pixel lengths and actual lengths in the target chicken video frames;

[0024] The amount of movement of each chicken is determined based on the movement trajectory of each chicken in the target chicken video frame and the corresponding relationship.

[0025] Optionally, after determining the amount of motion of each chicken based on the motion trajectory of each chicken in the target chicken video frame, the above method further includes:

[0026] Based on the amount of movement of each chicken, the movement status information of the chicken group is determined, wherein the movement status includes at least one of the total movement distance of the chicken group, the activity level of the chicken group, and the rate of change of the activity level of the chicken group; wherein the chicken group includes each of the chickens.

[0027] Output the amount of movement of each chicken and the movement status information of the chicken group.

[0028] A device for determining the activity level of chickens, comprising:

[0029] The acquisition unit is used to acquire the target chicken video frame; the target chicken video frame is the video frame to be identified in the chicken video.

[0030] The recognition unit is used to recognize the target chicken video frame using a pre-trained target recognition model, and obtain the recognition result of the target chicken video frame, wherein the recognition result includes at least one chicken image region information;

[0031] The processing unit is used to process the recognition results of the target chicken video frame using a preset multi-target tracking algorithm to obtain the multi-target tracking result of the target chicken video frame; the multi-target tracking result includes at least the motion trajectory of each chicken in the target chicken video frame;

[0032] The determining unit is used to determine the amount of motion of each chicken based on the motion trajectory of each chicken in the target chicken video frame.

[0033] Optionally, the processing unit in the aforementioned apparatus includes:

[0034] The first determining subunit is used to determine the similarity between each chicken image region information in the recognition result of the target chicken video frame and the historical chicken image region information in the historical recognition result of the previous video frame when the target chicken video frame is not the first video frame in the chicken video. The similarity includes appearance feature similarity, spatial scale similarity and running trajectory similarity.

[0035] The second determining subunit is used to determine the chicken image region information and the historical chicken image region information belonging to each chicken based on the similarity between each chicken image region information and each historical chicken image region information.

[0036] The execution subunit is used to obtain the multi-target tracking result of the target chicken video frame based on the chicken image region information of each chicken and the historical chicken image region information.

[0037] A storage medium comprising stored instructions, wherein, when the instructions are executed, the device containing the storage medium is controlled to perform the method for determining the amount of chicken movement as described above.

[0038] An electronic device includes a memory and one or more instructions, wherein one or more instructions are stored in the memory and configured to be executed by one or more processors as described above in the method for determining the amount of movement of chickens.

[0039] Based on the above-described embodiments of this application, a method, apparatus, storage medium, and electronic device for determining the activity level of chickens are provided. The method includes: acquiring a target chicken video frame; the target chicken video frame is a currently identified video frame in a chicken video; identifying the target chicken video frame using a pre-trained target recognition model to obtain a recognition result for the target chicken video frame, the recognition result including at least one chicken image region information; processing the recognition result of the target chicken video frame using a preset multi-target tracking algorithm to obtain a multi-target tracking result for the target chicken video frame; the multi-target tracking result at least includes the movement trajectory of each chicken in the target chicken video frame; and determining the activity level of each chicken based on the movement trajectory of each chicken in the target chicken video frame. Applying the method provided in this application embodiment can efficiently and accurately measure the activity level of chickens. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0041] Figure 1 A flowchart of a method for determining the activity level of chickens provided in this application;

[0042] Figure 2 A flowchart of a process for obtaining multi-target tracking results of video frames of target chickens provided in this application;

[0043] Figure 3 A flowchart illustrating a process for determining the amount of exercise for each chicken, as provided in this application;

[0044] Figure 4 A flowchart illustrating the data processing process of a federated learning model provided in this application;

[0045] Figure 5 This application provides a schematic diagram of a chicken's movement trajectory;

[0046] Figure 6 A schematic diagram illustrating a multi-target tracking process provided in this application;

[0047] Figure 7 A schematic diagram of a device for determining the activity level of chickens provided in this application;

[0048] Figure 8 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation

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

[0050] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0051] This invention provides a method for determining the activity level of chickens. This method can be applied to electronic devices. The flowchart of the method is shown below. Figure 1 As shown, it specifically includes:

[0052] S101: Obtain the target chicken video frame; the target chicken video frame is the video frame to be identified in the chicken video.

[0053] In this embodiment, the chicken video can be obtained by capturing images of the chicken's activity area using an image acquisition device. The chicken activity area can be a chicken breeding area, and the number of chickens in the activity area can be multiple.

[0054] See Figure 2 Image acquisition devices can be installed at the top of the chickens' activity area. These devices are connected to a computer to enable real-time monitoring and image acquisition of all chickens within the activity area. Vertical deployment ensures that the monitoring cameras cover the entire breeding area without blind spots. Furthermore, by adjusting the camera's height above the ground, the requirements for field of view and image resolution can be balanced. That is, the closer the camera is to the ground, the narrower the field of view but the higher the image clarity; the farther the camera is from the ground, the wider the field of view but the lower the resolution of individual images.

[0055] In some embodiments, the chicken video has a frame rate of 25fps, a resolution of 2560×1440, and is encoded in H.264.

[0056] S102: The target chicken video frame is identified using a pre-trained target recognition model to obtain the recognition result of the target chicken video frame, and the recognition result includes at least one chicken image region information.

[0057] In this embodiment, the target recognition model can be a trained YOLOv7 model. The YOLOv7 model is used to identify the target chicken video frame to obtain the recognition result of the target chicken video frame. The recognition result can include a rectangular bounding box. The recognition result can be used to identify a specific object box within the image or video frame, that is, chicken image region information.

[0058] Optionally, the following techniques can be used during the YOLOv7 model training process to improve the training speed, detection accuracy, and robustness of the model: 1. Use Mixup data augmentation to increase data diversity and improve the model's generalization ability by mixing the training data; 2. Introduce the E-ELAN structure to optimize the network architecture and improve feature extraction efficiency and feature representation ability; 3. Apply EPSA attention mechanism and ACmix attention mechanism to enhance the model's ability to capture key information, further improve detection accuracy and robustness, and ensure accurate and rapid identification and location of individual chickens in complex farming environments.

[0059] S103: The recognition results of the target chicken video frame are processed using a preset multi-target tracking algorithm to obtain the multi-target tracking results of the target chicken video frame; the multi-target tracking results include at least the motion trajectory of each chicken in the target chicken video frame.

[0060] In this embodiment, for each chicken image region information in the recognition result, a deep neural network can be used to extract the feature embedding vector of the chicken belonging to the chicken image region. This embedding vector is used to characterize the attributes of the chicken. The SORT algorithm is used to predict the next possible position of each target after the current frame based on the motion information of the tracked target. By calculating the similarity between the feature embedding vector of the chicken detected in the current frame and the feature embedding vector of the tracked target in the previous frame, a similarity measurement method is used to achieve matching and association between the target detected in the current frame and the target tracked in the previous frame, thereby realizing continuous tracking of the target.

[0061] Optionally, the multi-target tracking results may also include at least one of the following: the bounding box of each chicken, the chicken category, and the target unique identifier (ID). The chicken category can be divided according to the growth stage of the chicken, for example, it can be the chick stage, the rearing stage, and the degeneration stage.

[0062] S104: Determine the amount of motion of each chicken based on the motion trajectory of each chicken in the target chicken video frame.

[0063] In this embodiment, a distance mapping method is used to determine the actual movement distance of each chicken based on the movement trajectory of each chicken.

[0064] The method provided in this application can improve the accuracy and efficiency of exercise volume calculation, reduce the subjective bias of manual measurement, and does not require affecting the chickens, thereby realizing non-interventional calculation of chicken exercise volume and providing data support for efficient breeding.

[0065] In one embodiment provided in this application, based on the above-described scheme, optionally, the process of processing the recognition result of the target chicken video frame using a preset multi-target tracking algorithm to obtain the multi-target tracking result of the target chicken video frame is as follows: Figure 3 As shown, it includes:

[0066] S301: If the target chicken video frame is not the first video frame in the chicken video, determine the similarity between each chicken image region information in the recognition result of the target chicken video frame and the historical chicken image region information in the historical recognition result of the previous video frame. The similarity includes appearance feature similarity, spatial scale similarity and running trajectory similarity.

[0067] In this embodiment, when the target chicken video frame is the first video frame in the chicken video, a multi-target tracking structure can be obtained based on the pixel positions of all chicken image region information.

[0068] S302: Based on the similarity between each chicken image region information and each historical chicken image region information, determine the chicken image region information and historical chicken image region information belonging to each chicken.

[0069] In this embodiment, chicken appearance features, historical movement trajectory information, and spatial scale information are combined to construct a three-dimensional similarity matrix. Then, the Hungarian algorithm is used to solve for the loss matrix transformed from the similarity matrix, thereby obtaining the optimal matching of individual chickens between frames.

[0070] Optionally, the function for calculating the similarity of chicken appearance features is:

[0071]

[0072] in, For the physical characteristics of chickens, through Calculate the cosine distance between two features. Within the chicken's activity area, the Intersection over Union (IoU) between adjacent chickens reflects the similarity of spatial scale information. In this embodiment, spatial matching of two chickens between two different video frames can be achieved using the Intersection over Union (IoU).

[0073] Optionally, the function for calculating the spatial similarity of chickens in two video frames is: .

[0074] Optionally, the function for calculating the similarity of the chickens' movement trajectories is: In the formula Represents the trajectory vector. The vector formed by the trajectory region of the most recent frame and the center point of the detection region of the current frame is represented by the cosine angle. During the movement, the angle between the trajectory of the chicken in front and the trajectory of the historical chicken is the smallest, so the cosine angle can well reflect its changing trend.

[0075] In this embodiment, the formula for calculating the distance of a chicken moving by pixels per unit time in a video sequence is:

[0076]

[0077] in, For a unit of time, at this time It also means The first frame The velocity of the object; Indicates the first The first frame The pixel coordinates of an object.

[0078] Optional, when When the similarity is large, the similarity value obtained from trajectory information is more reliable than the IoU based on spatial information similarity. And when... When the similarity is smaller, the similarity value obtained from spatial information is more reliable. Therefore, considering both cases, the similarity values ​​of spatial and motion information can be summed as follows: The calculation formula is as follows:

[0079] .

[0080] in, This is a hyperparameter representing the maximum pixel distance the chicken can move between two adjacent frames.

[0081] Based on the above calculation formula, the similarity matrix of multidimensional information fusion can be obtained. Then, the similarity matrix is ​​converted into a loss matrix, as shown in the following formula:

[0082]

[0083]

[0084] In this embodiment, , , The loss matrices represent the chicken's physical characteristics, spatial similarity, and movement trajectory similarity, respectively. The weighting factor controls the proportion of the appearance feature loss function and the similarity loss function based on spatial and motion information in the total loss function. Finally, the Hungarian algorithm is used to obtain the optimal matching result of the loss matrix.

[0085] S303: Based on the chicken image region information of each chicken and the historical chicken image region information, obtain the multi-target tracking result of the target chicken video frame.

[0086] In this embodiment, for each chicken, the current pixel position can be obtained based on the chicken image region information in the target chicken video frame, the historical pixel position can be obtained based on the historical chicken image region information, the chicken's motion trajectory can be obtained based on the current pixel position and the historical pixel position, and the multi-target tracking result of the target chicken video frame can be obtained based on the motion trajectories of each chicken.

[0087] In one embodiment provided in this application, based on the above-described scheme, optionally, the process of determining the amount of motion of each chicken according to the motion trajectory of each chicken in the target chicken video frame is as follows: Figure 4 As shown, it includes:

[0088] S401: Detect whether the motion trajectory of each chicken in the target chicken video frame meets the preset optimization conditions.

[0089] In this embodiment, if the pixel distance between the current pixel position of the chicken and the historical pixel position of the chicken in the previous video frame is less than a preset distance threshold, then the movement trajectory of the chicken is determined to meet the preset optimization conditions.

[0090] Optionally, the distance threshold can be set to 2 pixel values.

[0091] S402: Optimize the motion trajectory that meets the optimization conditions.

[0092] In this embodiment, for a motion trajectory that meets the optimization conditions, the current pixel position of the chicken to which the motion trajectory belongs can be replaced with the historical pixel position of the chicken in the previous video frame to complete the optimization of the motion trajectory.

[0093] like Figure 5 As shown, Figure 5 Part a shows the motion trajectory before optimization. Figure 5 Part b shows the optimized motion trajectory.

[0094] S403: After optimizing the motion trajectory that meets the optimization conditions, determine the amount of motion of each chicken based on the current motion trajectory of each chicken in the target chicken video frame.

[0095] In this embodiment, by optimizing the movement trajectory that meets the optimization conditions, the movement trajectory error caused by the chicken swaying its body without changing its position while standing can be reduced.

[0096] In one embodiment provided in this application, based on the above-described scheme, optionally, determining the amount of motion of each chicken according to the motion trajectory of each chicken in the target chicken video frame includes:

[0097] Obtain the correspondence between the pixel lengths and actual lengths in the target chicken video frames;

[0098] The amount of movement of each chicken is determined based on the movement trajectory of each chicken in the target chicken video frame and the corresponding relationship.

[0099] In this embodiment, the length of the ground in the chicken's activity area can be assumed. and width As a fixed value, the ground length within the identifiable range is divided into... Equal parts, of which By calculation, the ground width value and its corresponding pixel width value can be obtained for each division point. The length of each small interval after ground length division is close to the ground width value, so by calculating the relationship between the ground width value and the image pixel value, we can approximate the relationship between the ground length value and the image pixel value. Let the pixel width value be... Ground width value .

[0100] Define the fitting model as

[0101] ,

[0102] The loss function is defined as follows:

[0103]

[0104] in, This represents the number of data sets.

[0105] Optional, about The partial derivatives are: .

[0106] Optional, about The partial derivatives are: .

[0107] Optional, about The partial derivatives are: .

[0108] In this embodiment, after obtaining the actual amount of exercise of each chicken, the group activity level calculation method is used to quantify the degree of group activity.

[0109] For example, setting a certain period of time as The total number of chickens detected within a certain period is N, and the distance traveled by the i-th chicken within that period is . The total distance traveled by the group is The calculation process is as follows:

[0110] .

[0111] Optionally, the level of group activity over a certain period of time is The calculation process is as follows:

[0112]

[0113] Optionally, the rate of change of activity level over different time periods is R, which is calculated as follows:

[0114] .

[0115] In this embodiment, let The partial derivatives are zero; substituting them into the actual data points yields the optimal fitting parameters. The best-fit equation can be obtained.

[0116] In one embodiment provided in this application, based on the above-described scheme, optionally, the training process of the target recognition model includes:

[0117] Obtain the initial YOLOv7 model and the first training dataset; the first training dataset includes multiple first training video frames, and each first training video frame includes bounding box information for annotating each chicken image region in the first training video frame.

[0118] The initial YOLOv7 model is trained using the first training dataset;

[0119] If the initial YOLOv7 model meets the preset training completion conditions, the initial YOLOv7 model that meets the training completion conditions is determined as the trained target recognition model.

[0120] In this embodiment, the chicken's activity area can be filmed using an image acquisition device to collect the video required for training. To ensure the spatiotemporal continuity, motion smoothness, and information retention of the extracted video images, the video image is saved every two frames. This preserves important trajectory information of the chicken's movement while avoiding obvious blurring, distortion, and image content jumps. The extracted video images are filtered, categorized, and saved. Then, data preprocessing operations such as image color transformation, scale transformation, and noise perturbation are performed on the images to increase data diversity, improve image complexity, and enhance the model's robustness and generalization ability. The images obtained after preprocessing are labeled according to the chicken movement dataset labeling standards to obtain the first training dataset and the second training dataset, which are then divided proportionally.

[0121] Optionally, the annotation standard for the first training dataset is as follows: all chickens in the images extracted from the video are annotated at the box level, and each box should accurately mark the position and size of the chicken, and record the coordinates of the upper left and lower right corners of the box.

[0122] Optionally, the annotation criteria for the second training dataset are as follows: images extracted from the same video segment are saved in frame order and distinguished from images extracted from other videos. Each chicken in the image is labeled with a bounding box, and each chicken target is assigned a category label and a unique identifier (ID). Within the image sequence extracted from the same video segment, the category label and ID of each target should remain consistent from the beginning to the end of the sequence.

[0123] In this embodiment, as Figure 6 As shown, a trained target recognition model can be used to identify video frames in the second training dataset to obtain recognition results. Then, the appearance features, historical movement trajectory information, and spatial location information of chickens in the second training dataset can be combined to construct a three-dimensional similarity matrix. The Hungarian algorithm is then used to solve for the loss matrix transformed from the similarity matrix, thereby obtaining the optimal matching of individual chickens between frames.

[0124] and Figure 1 Corresponding to the method described above, this application also provides a device for determining the activity level of chickens, used for... Figure 1 The specific implementation of the method is shown in the following structural diagram. Figure 7 As shown, it specifically includes:

[0125] The acquisition unit 701 is used to acquire the target chicken video frame; the target chicken video frame is the video frame to be identified in the chicken video.

[0126] The recognition unit 702 is used to recognize the target chicken video frame using a pre-trained target recognition model, and obtain the recognition result of the target chicken video frame, wherein the recognition result includes at least one chicken image region information.

[0127] The processing unit 703 is used to process the recognition result of the target chicken video frame using a preset multi-target tracking algorithm to obtain the multi-target tracking result of the target chicken video frame; the multi-target tracking result includes at least the motion trajectory of each chicken in the target chicken video frame;

[0128] The determining unit 704 is used to determine the amount of motion of each chicken based on the motion trajectory of each chicken in the target chicken video frame.

[0129] In one embodiment provided in this application, based on the above-described solution, optionally, the processing unit includes:

[0130] The first determining subunit is used to determine the similarity between each chicken image region information in the recognition result of the target chicken video frame and the historical chicken image region information in the historical recognition result of the previous video frame when the target chicken video frame is not the first video frame in the chicken video. The similarity includes appearance feature similarity, spatial scale similarity and running trajectory similarity.

[0131] The second determining subunit is used to determine the chicken image region information and the historical chicken image region information belonging to each chicken based on the similarity between each chicken image region information and each historical chicken image region information.

[0132] The execution subunit is used to obtain the multi-target tracking result of the target chicken video frame based on the chicken image region information of each chicken and the historical chicken image region information.

[0133] In one embodiment provided in this application, based on the above-described solution, optionally, the determining unit includes:

[0134] The detection subunit is used to detect whether the motion trajectory of each chicken in the target chicken video frame meets the preset optimization conditions;

[0135] An optimization subunit is used to optimize the motion trajectory that meets the optimization conditions;

[0136] The third determining subunit is used to determine the amount of motion of each chicken based on the current motion trajectory of each chicken in the target chicken video frame after optimizing the motion trajectory that meets the optimization conditions.

[0137] In one embodiment provided in this application, based on the above-described scheme, optionally, the training process of the target recognition model includes:

[0138] The sub-unit is used to acquire the initial YOLOv7 model and the first training dataset; the first training dataset includes multiple first training video frames, and each first training video frame includes bounding box information for labeling each chicken image region in the first training video frame.

[0139] The training subunit is used to train the initial YOLOv7 model using the first training dataset;

[0140] The execution subunit is used to determine the initial YOLOv7 model that meets the preset training completion conditions as the trained target recognition model, provided that the initial YOLOv7 model meets the preset training completion conditions.

[0141] In one embodiment provided in this application, based on the above-described solution, optionally, the determining unit includes:

[0142] The acquisition subunit is used to acquire the correspondence between the pixel length and the actual length in the target chicken video frame;

[0143] The fourth determining subunit is used to determine the amount of motion of each chicken based on the motion trajectory of each chicken in the target chicken video frame and the corresponding relationship.

[0144] In one embodiment provided in this application, based on the above-described solution, optionally, the apparatus further includes:

[0145] An execution unit is configured to determine the movement status information of the chicken group based on the amount of movement of each chicken, wherein the movement status includes at least one of the total movement distance of the chicken group, the activity level of the chicken group, and the rate of change of the activity level of the chicken group; wherein the chicken group includes each of the chickens.

[0146] The output unit is used to output the amount of movement of each chicken and the movement status information of the chicken group.

[0147] The specific principles and execution processes of each unit and module in the chicken movement determination device disclosed in the above-described embodiments of this application are the same as those of the chicken movement determination method disclosed in the above-described embodiments of this application. Please refer to the corresponding parts of the chicken movement determination method provided in the above-described embodiments of this application, and they will not be repeated here.

[0148] This application embodiment also provides a storage medium, the storage medium including stored instructions, wherein, when the instructions are executed, the device where the storage medium is located is controlled to execute the above-described method for determining the amount of chicken movement.

[0149] This application also provides an electronic device, the structural schematic diagram of which is shown below. Figure 8 As shown, it specifically includes a memory 801 and one or more instructions 802, wherein one or more instructions 802 are stored in the memory 801 and configured to be executed by one or more processors 803 to perform the following operations:

[0150] Acquire the target chicken video frame; the target chicken video frame is the video frame to be identified in the chicken video;

[0151] The target chicken video frame is identified using a pre-trained target recognition model to obtain the recognition result of the target chicken video frame, and the recognition result includes at least one chicken image region information;

[0152] The recognition results of the target chicken video frame are processed using a preset multi-target tracking algorithm to obtain the multi-target tracking result of the target chicken video frame; the multi-target tracking result includes at least the motion trajectory of each chicken in the target chicken video frame;

[0153] The amount of movement of each chicken is determined based on the movement trajectory of each chicken in the target chicken video frame.

[0154] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0155] Finally, it should be noted that in this paper, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0156] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0157] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0158] The above provides a detailed description of a method for determining the activity level of chickens provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for determining the amount of exercise in chickens, characterized in that, include: Acquire video frames of the target chicken; The target chicken video frame is the video frame currently to be identified in the chicken video; The target chicken video frame is identified using a pre-trained target recognition model to obtain the recognition result of the target chicken video frame, and the recognition result includes at least one chicken image region information; The recognition results of the target chicken video frame are processed using a preset multi-target tracking algorithm to obtain the multi-target tracking result of the target chicken video frame; the multi-target tracking result includes at least the motion trajectory of each chicken in the target chicken video frame; The amount of motion of each chicken is determined based on the motion trajectory of each chicken in the target chicken video frame; The process of using a preset multi-target tracking algorithm to process the recognition results of the target chicken video frame to obtain the multi-target tracking result of the target chicken video frame includes: If the target chicken video frame is not the first video frame in the chicken video, the similarity between each chicken image region information in the recognition result of the target chicken video frame and the historical chicken image region information in the historical recognition result of the previous video frame is determined. The similarity includes appearance feature similarity, spatial scale similarity, and trajectory similarity. The appearance feature similarity is obtained by calculating the cosine distance between the appearance features of the chickens in the two video frames. The trajectory similarity is calculated based on the chicken trajectory vector and the vector formed by the trajectory region of the previous video frame and the center point of the recognition result of the target chicken video frame. The spatial scale similarity includes the intersection-union ratio (IUU) between the appearance features of the chickens in the target chicken video frame and the appearance features of the chickens in the previous video frame. Based on the similarity between each chicken image region information and each historical chicken image region information, the chicken image region information and historical chicken image region information belonging to each chicken are determined. Based on the chicken image region information of each chicken and the historical chicken image region information, the multi-target tracking result of the target chicken video frame is obtained.

2. The method according to claim 1, characterized in that, Based on the motion trajectory of each chicken in the target chicken video frame, determine the amount of motion for each chicken, including: Detect whether the motion trajectory of each chicken in the target chicken video frame meets the preset optimization conditions; Optimize the motion trajectory that meets the optimization conditions; After optimizing the motion trajectory that meets the optimization conditions, the amount of motion of each chicken is determined based on the current motion trajectory of each chicken in the target chicken video frame.

3. The method according to claim 1 or 2, characterized in that, The training process of the target recognition model includes: Obtain the initial YOLOv7 model and the first training dataset; the first training dataset includes multiple first training video frames, and each first training video frame includes bounding box information for annotating each chicken image region in the first training video frame. The initial YOLOv7 model is trained using the first training dataset; If the initial YOLOv7 model meets the preset training completion conditions, the initial YOLOv7 model that meets the training completion conditions is determined as the trained target recognition model.

4. The method according to claim 1, characterized in that, The step of determining the amount of motion for each chicken based on the motion trajectory of each chicken in the target chicken video frame includes: Obtain the correspondence between the pixel lengths and actual lengths in the target chicken video frames; The amount of movement of each chicken is determined based on the movement trajectory of each chicken in the target chicken video frame and the corresponding relationship.

5. The method according to claim 1, characterized in that, After determining the amount of motion of each chicken based on the motion trajectory of each chicken in the target chicken video frame, the method further includes: Based on the amount of movement of each chicken, the movement status information of the chicken group is determined, wherein the movement status includes at least one of the total movement distance of the chicken group, the activity level of the chicken group, and the rate of change of the activity level of the chicken group; wherein the chicken group includes each of the chickens. Output the amount of movement of each chicken and the movement status information of the chicken group.

6. A device for determining the amount of movement in chickens, characterized in that, include: The acquisition unit is used to acquire video frames of the target chicken. The target chicken video frame is the video frame currently to be identified in the chicken video; The recognition unit is used to recognize the target chicken video frame using a pre-trained target recognition model, and obtain the recognition result of the target chicken video frame, wherein the recognition result includes at least one chicken image region information; The processing unit is used to process the recognition results of the target chicken video frame using a preset multi-target tracking algorithm to obtain the multi-target tracking result of the target chicken video frame; the multi-target tracking result includes at least the motion trajectory of each chicken in the target chicken video frame; The determining unit is used to determine the amount of motion of each chicken based on the motion trajectory of each chicken in the target chicken video frame; The processing unit includes: The first determining subunit is configured to, when the target chicken video frame is not the first video frame in the chicken video, determine the similarity between each chicken image region information in the recognition result of the target chicken video frame and the historical chicken image region information in the historical recognition result of the previous video frame. The similarity includes appearance feature similarity, spatial scale similarity, and trajectory similarity. The appearance feature similarity is obtained by calculating the cosine distance between the appearance features of the chickens in the two video frames. The trajectory similarity is calculated based on the chicken trajectory vector and the vector formed by the trajectory region of the previous video frame and the center point of the recognition result of the target chicken video frame. The spatial scale similarity includes the intersection-union ratio (IUU) between the appearance features of the chickens in the target chicken video frame and the appearance features of the chickens in the previous video frame. The second determining subunit is used to determine the chicken image region information and the historical chicken image region information belonging to each chicken based on the similarity between each chicken image region information and each historical chicken image region information. The execution subunit is used to obtain the multi-target tracking result of the target chicken video frame based on the chicken image region information of each chicken and the historical chicken image region information.

7. A storage medium, characterized in that, The storage medium includes stored instructions, wherein, when the instructions are executed, the device containing the storage medium is controlled to perform the method for determining the amount of chicken movement as described in any one of claims 1 to 5.

8. An electronic device, characterized in that, It includes a memory, and one or more instructions, wherein one or more instructions are stored in the memory and configured to be executed by one or more processors as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Chicken flock activity amount real-time estimation method and chicken flock activity amount real-time estimation system based on multi-target tracking

    CN111680587A

  • Method, device and system for determining multi-target trajectory in video and storage medium

    CN113780058A