Meat pigeon behavior counting method and device, electronic equipment and storage medium
By automatically identifying and counting the feeding behavior of pigeons, the problem of inaccurate feeding of pigeon feed has been solved, achieving precise feeding, improving breeding efficiency and reducing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHONGKAI UNIV OF AGRI & ENG
- Filing Date
- 2023-09-04
- Publication Date
- 2026-05-05
AI Technical Summary
Existing pigeon farming methods and techniques result in inaccurate feed delivery, which can easily lead to insufficient or excessive feed, increasing management costs and polluting the environment. Furthermore, manual observation is labor-intensive and time-consuming.
By identifying the feeding behavior of pigeons through real-time video streams, a target detection model is used for frame-by-frame identification, and a counting model is used to automatically count the number of feedings, thus achieving precise feeding.
It has improved breeding efficiency and quality, reduced labor and management costs, reduced unreasonable feed input, and enhanced the automation level of the breeding environment.
Smart Images

Figure CN117218577B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, electronic device, and storage medium for counting the behavior of pigeons. Background Technology
[0002] With the accelerating pace of urbanization and the improvement of people's living standards, people's requirements for food quality are becoming increasingly higher. Healthy, environmentally friendly, and safe food is becoming a necessity in people's daily lives. Pigeon meat, as a nutritious, delicious, and cholesterol-free meat product, is becoming increasingly popular in the market. However, the current outdated pigeon farming methods and techniques have greatly restricted the growth of pigeons. First, most farmers feed pigeons based on their own experience, easily leading to insufficient or excessive feed, resulting in feed contamination, mold, and other problems that affect the normal growth of the pigeons. Although some employees feed based on the pigeons' feeding behavior, manually observing pigeon behavior is not only labor-intensive, time-consuming, and costly, but also makes it impossible to accurately control the amount and timing of feeding, leading to the same problems. Second, the management costs of traditional pigeon farming methods are high and constantly rising, the production potential of breeding pigeons is not fully realized, and it is also prone to causing pollution of the breeding environment. Summary of the Invention
[0003] To address the aforementioned technical problems, this invention provides a method, apparatus, electronic device, and storage medium for counting pigeon behavior, which enables automatic identification and counting of pigeon behavior, thereby achieving precise feeding, improving breeding efficiency and quality, and reducing costs.
[0004] To achieve the above-mentioned technical objectives, the technical solutions adopted in the embodiments of this application include:
[0005] In a first aspect, embodiments of this application provide a method for counting the behavior of pigeons, comprising the following steps:
[0006] Acquire video streams obtained from real-time filming of pigeons;
[0007] A preset target detection model is used to identify the video stream frame by frame to obtain the feeding behavior of the target pigeon in each frame of the video stream.
[0008] The number of consecutive frames is obtained based on the feeding behavior, which is the number of consecutive frames with the same feeding behavior.
[0009] Based on the number of consecutive frames and the established counting model, the number of feedings corresponding to the number of consecutive frames is obtained. The counting model describes the correspondence between the number of consecutive frames and the number of feedings.
[0010] In addition, the pigeon behavior counting method according to the above embodiments of this application may also have the following additional technical features:
[0011] Furthermore, in a method for counting pigeon behavior according to an embodiment of this application, the target detection model includes a backbone network, a feature fusion network, and a detection head;
[0012] The video stream is analyzed frame by frame using a preset target detection model to obtain the feeding behavior of the target pigeon in each frame of the video stream, including:
[0013] By extracting features from each frame of the video stream through the backbone network, multi-dimensional features corresponding to each frame of the video stream are obtained.
[0014] The feature fusion network is used to fuse the multi-dimensional features corresponding to each frame of the video stream to obtain the fused features corresponding to each frame of the video stream.
[0015] Feeding behavior is obtained by detecting the fusion characteristics through the detection head.
[0016] Furthermore, in one embodiment of this application, a preset target detection model is used to identify the video stream frame by frame to obtain the feeding behavior of the target pigeon in each frame of the video stream, including:
[0017] A target detection model is used to identify the feeding behavior frame by frame in the video stream within a preset time period.
[0018] Furthermore, in one embodiment of this application, the construction of the counting model includes:
[0019] A four-parameter categorical variable regression function was used to model the relationship between the number of consecutive frames and the number of feedings, resulting in a counting model.
[0020] The counting model is fitted to obtain its parameters.
[0021] Furthermore, in one embodiment of this application, the counting method further includes:
[0022] Identify the sex of the target pigeon;
[0023] The study correlated gender with feeding behavior and frequency of feeding.
[0024] Furthermore, in one embodiment of this application, identifying the sex of the target pigeon includes:
[0025] The sex of the target pigeon is identified based on the video stream and the gender markers pre-set on the target pigeon.
[0026] Furthermore, in one embodiment of this application, the counting method further includes:
[0027] Store the video stream, the feeding behavior in each frame of the video stream, and the number of feedings corresponding to the feeding behavior.
[0028] Secondly, embodiments of this application propose a pigeon behavior counting device, comprising:
[0029] The first acquisition module is used to acquire the video stream obtained from real-time shooting of pigeons;
[0030] The recognition module is used to identify the video stream frame by frame using a preset target detection model, so as to obtain the feeding behavior of the target pigeon in each frame of the video stream.
[0031] The second acquisition module is used to acquire the number of consecutive frames based on the feeding behavior. The number of consecutive frames is the number of consecutive frames with the same feeding behavior.
[0032] The counting module is used to obtain the number of feeding times corresponding to the number of consecutive frames based on the number of consecutive frames and the established counting model. The counting model describes the correspondence between the number of consecutive frames and the number of feeding times.
[0033] Thirdly, embodiments of this application propose an electronic device, including:
[0034] At least one memory and at least one processor;
[0035] Memory, used to store one or more programs;
[0036] When one or more programs are executed by the at least one processor, the at least one processor implements the steps of the pigeon behavior counting method of the first aspect.
[0037] Fourthly, embodiments of this application propose a storage medium storing a computer program, which, when executed by a processor, implements the steps of the pigeon behavior counting method of the first aspect.
[0038] The beneficial effects of this invention are reflected in the fact that by performing frame-by-frame identification on the video stream obtained from real-time shooting of pigeons, the feeding behavior of the target pigeons in each frame of the video stream is obtained, and the number of consecutive frames with the same feeding behavior is obtained. Combined with the counting model, the number of feeding times corresponding to the number of consecutive frames is obtained, thus realizing the automatic identification and counting of pigeon behavior. This enables precise feeding based on the number of feeding times of pigeons, reduces unreasonable feed distribution, improves breeding efficiency and quality, and reduces labor and management costs. Attached Figure Description
[0039] Figure 1 A flowchart illustrating a specific embodiment of the pigeon behavior counting method provided by the present invention;
[0040] Figure 2This is a network topology diagram of a specific embodiment of the pigeon behavior counting method provided by the present invention;
[0041] Figure 3 This is a schematic diagram of the target detection model structure of a specific embodiment of the pigeon behavior counting method provided by the present invention;
[0042] Figure 4 A schematic diagram of the Swin transformer block structure is shown in a specific embodiment of the pigeon behavior counting method provided by the present invention.
[0043] Figure 5 This is a schematic diagram showing the correspondence between the number of consecutive frames and the number of feedings in a specific embodiment of the pigeon behavior counting method provided by the present invention;
[0044] Figure 6 A schematic diagram of the counting model fitting for a specific embodiment of the pigeon behavior counting method provided by the present invention;
[0045] Figure 7 A schematic diagram of the system architecture of a specific embodiment of the pigeon behavior counting method provided by the present invention;
[0046] Figure 8 This is a schematic diagram of a specific embodiment of the pigeon behavior counting device provided by the present invention. Detailed Implementation
[0047] 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.
[0048] Reference Figure 1 A method for counting the behavior of pigeons according to an embodiment of this application includes the following steps:
[0049] S101. Obtain the video stream obtained from real-time shooting of pigeons.
[0050] Among them, the pigeons are raised in pigeon cages, referring to Figure 2 The present invention acquires video streams of real-time captured images of pigeons in various cages by using multiple cameras (such as ordinary cameras or depth cameras) and uploading the corresponding video streams via wireless communication methods (such as WiFi / 4G / 5G).
[0051] Reference Figure 2 In this application embodiment, the video stream and the data obtained from subsequent processing of the video stream will be uploaded to the cloud server and stored in the data storage center.
[0052] S102. The video stream is identified frame by frame using a preset target detection model to obtain the feeding behavior of the target pigeon in each frame of the video stream.
[0053] The target pigeon is one of all the pigeons included in the video stream. Specifically, in this embodiment, a preset target detection model is used to frame the target pigeon, images of the target pigeon are captured from each frame of the video stream, and action recognition is performed on each image of the target pigeon to obtain the feeding behavior of the target pigeon in each frame of the video stream.
[0054] Reference Figure 3 Optionally, in some embodiments, the algorithm portion of the target detection model is based on YOLOv5s, and the model includes a backbone network, a feature fusion network, and a detection head. Step S102 specifically includes:
[0055] 1) Extract features from each frame of the video stream using a backbone network to obtain multi-dimensional features corresponding to each frame of the video stream;
[0056] 2) The multi-dimensional features corresponding to each frame of the video stream are fused using a feature fusion network to obtain the fused features corresponding to each frame of the video stream.
[0057] 3) Based on the fusion characteristics, feeding behavior is obtained through the detection head.
[0058] Understandably, the breeding environment presents complex foregrounds and backgrounds, and the light changes significantly over different time periods, greatly interfering with the accurate identification of pigeon behavior by the model. Therefore, this embodiment incorporates a Swing transformer into the backbone network, enhancing the feature extraction capability of the target detection model and thus improving the accuracy of pigeon behavior recognition.
[0059] Continue to refer to Figure 3 The input video stream for the object detection model consists of 320×320×3 frames. A backbone network extracts features from these images. Patch Partition is used to split and compress the images, stretching a 4×4×3 region to 1×1×48 dimensions, resulting in each frame having a dimension of 80×80×48. Linear Embedding reassembles the output of Patch Partition, changing the channel dimensions of the features. These features are then passed through two consecutive Swing transformer blocks, such as... Figure 4 As shown, the result T after feature recombination i-1After layer normalization, the output is then processed by W-MSA (window-based multi-segment attention) and compared with T. i-1 Adding them together forms the residual structure, resulting in... The output after level normalization and multilayer perceptron and Add them together to get the output T of the first Swing transformer block. i The second Swin transformer block has a similar structure to the first, except that W-MSA is replaced with SW-MSA (shifted window based multi-segment attention). The output T of the first Swin transformer block... i As input to the second Swingtransformer block, the final output is T. i+1 The calculation process for two consecutive Swintransformer blocks in this embodiment is as follows:
[0060]
[0061]
[0062]
[0063]
[0064] Patch Merging is used to perform feature downsampling and dimensionality reduction operations, and the output is input into a program such as... Figure 4 In the two consecutive Swing transformer blocks shown, refer to Figure 3 The backbone network of this application ultimately outputs multi-dimensional features corresponding to each frame of the video stream.
[0065] Continue to refer to Figure 3 In some embodiments, Carafe (Content-Aware ReAssembly of Feature) Upsampling is set in the feature fusion network to improve the efficiency of feature transfer, enabling efficient fusion of features from different dimensions, thereby improving the recognition efficiency of the target detection model.
[0066] Continue to refer to Figure 3 Optionally, the detection head outputs the category of feeding behavior, anchor box, and corresponding confidence level.
[0067] Optionally, in some embodiments, step S102 specifically includes:
[0068] A target detection model is used to identify the feeding behavior frame by frame in the video stream within a preset time period.
[0069] It is understandable that the number of feedings corresponding to the same frame number may differ. In this embodiment, the feeding behavior within a preset time period is obtained by identifying the video stream frame by frame, and the number of feedings within that time period is subsequently obtained. This reduces the statistical error in the number of feedings caused by the difference in the number of feedings corresponding to the same frame number.
[0070] Optionally, in some embodiments, the preset time period is one hour.
[0071] S103. Obtain the number of consecutive frames based on feeding behavior.
[0072] The number of consecutive frames refers to the number of consecutive frames in which the feeding behavior is the same.
[0073] Specifically, after identifying the feeding behavior of the target pigeon in each frame of the video stream in step S102, consecutive frames with the same feeding behavior are selected, and the frame number of the consecutive frames is calculated.
[0074] Optionally, in some embodiments, after step S102 identifies the feeding behavior of the target pigeon in each frame of the video stream within a preset time period, at least one consecutive frame with the same feeding behavior is selected, the frame number of each consecutive frame is calculated, and the frame numbers of each consecutive frame are added together to obtain the total frame number of each consecutive frame within the preset time period, so that the number of feedings within the preset time period can be obtained subsequently.
[0075] S104. Based on the number of consecutive frames and the established counting model, obtain the number of feeding times corresponding to the number of consecutive frames.
[0076] The counting model describes the relationship between the number of consecutive frames and the number of feedings.
[0077] Optionally, in some embodiments, the construction of the counting model includes:
[0078] 1) A four-parameter categorical variable regression function was used to model the relationship between the number of consecutive frames and the number of feedings, resulting in a counting model;
[0079] 2) Perform model fitting on the counting model to obtain the various parameters of the counting model.
[0080] The relationship between the number of consecutive frames and the number of feedings is as follows: Figure 5 As shown. (Refer to...) Figure 5 It can be seen that the number of feedings varies for the same frame number.
[0081] Specifically, a four-parameter Probit function is used to model the relationship between the number of consecutive frames and the number of feeding attempts. It is understood that Probit regression, also known as probability unit regression, belongs to the category of linear regression. The four-parameter Probit function in this embodiment is a variation of the Probit regression function, following a normal probability distribution function, and also exhibiting non-linear characteristics. The expression of the four-parameter Probit function is as follows:
[0082]
[0083] Where frame represents the number of consecutive frames, which is the independent variable of the four-parameter Probit function; f(frame) represents the number of feedings, which is the dependent variable of the four-parameter Probit function; parameters a, b, c, and d are the variable parameters obtained from model fitting, where y = c and y = d represent the lower and upper asymptotes of the function, a represents the growth rate of the function, and b represents the inflection point of the function; Φ represents the cumulative distribution function of the normal distribution (Gaussian distribution), and the expression of this function is:
[0084]
[0085] The fitting curve of the four-parameter Probit function is as follows: Figure 6 As shown. (Refer to...) Figure 6 It can be seen that when frame > b, the number of feedings slows down as the number of frames increases, eventually approaching the upper asymptote y = d.
[0086] It is understood that only one pair of meat pigeons is typically raised in each cage, meaning each cage contains one male and one female pigeon. Optionally, in some embodiments, the counting method further includes: identifying the sex of the target meat pigeon and associating sex with feeding behavior and the frequency of feeding.
[0087] It is understood that the embodiments of this application achieve individual-level identification of feeding behavior and statistics of feeding frequency by associating the sex of the target pigeon with feeding behavior and feeding frequency.
[0088] Furthermore, the sex identification of the target pigeon specifically includes: identifying the sex of the target pigeon based on the video stream and pre-set sex markers on the target pigeon. Optionally, in some embodiments, the head and chest of female pigeons are highlighted in red to complete the pre-setting of sex markers.
[0089] Optionally, in some embodiments, the system architecture corresponding to the pigeon behavior counting method in steps S101-S104 above is as follows: Figure 7 As shown. (Refer to...) Figure 7The system consists of a data acquisition layer, a transmission layer, a storage layer, an algorithm layer, a business layer, and a user layer. The system acquires pigeon feeding behavior data (video stream) through the data acquisition layer, transmits the data using 4G / 5G / WIFI, and stores it in the storage layer. The storage layer includes relational databases, non-relational databases, and file storage, used to store various types of relational and non-relational data, pigeon behavior videos, and behavioral images. The algorithm layer is responsible for real-time identification of pigeon feeding behavior in the video stream and, through continuous frame detection statistics and counting models of the same feeding behavior, calculates the number of times the pigeons feed, thus obtaining the amount of food consumed. In addition, the system's business layer is built using Spring Boot, Nacos, and MybatisPlus to handle the system's logical business logic; in the user layer, users can access the system via PC, mobile, or web.
[0090] Optionally, in some embodiments, the counting method further includes:
[0091] Store the video stream, the feeding behavior in each frame of the video stream, and the number of feedings corresponding to the feeding behavior.
[0092] In summary, the pigeon behavior counting method in steps S101-S104 above identifies the feeding behavior of the target pigeon in each frame of the video stream obtained by real-time shooting of pigeons by performing frame-by-frame identification, and obtains the number of consecutive frames with the same feeding behavior. Combined with the counting model, the number of feeding times corresponding to the number of consecutive frames is obtained, realizing the automatic identification and counting of pigeon behavior. This enables precise feeding based on the number of feeding times of pigeons, reduces unreasonable feed distribution, improves breeding efficiency and quality, and reduces labor and management costs.
[0093] Secondly, a pigeon behavior counting device according to an embodiment of this application is described with reference to the accompanying drawings.
[0094] Figure 8 This is a schematic diagram of the structure of a pigeon behavior counting device according to an embodiment of this application.
[0095] The pigeon behavior counting device specifically includes:
[0096] The first acquisition module 801 is used to acquire the video stream obtained by real-time shooting of pigeons;
[0097] The recognition module 802 is used to perform frame-by-frame recognition of the video stream using a preset target detection model to obtain the feeding behavior of the target pigeon in each frame of the video stream.
[0098] The second acquisition module 803 is used to acquire the number of consecutive frames based on the feeding behavior, wherein the number of consecutive frames is the number of consecutive frames with the same feeding behavior;
[0099] The counting module 804 is used to obtain the number of feedings corresponding to the number of consecutive frames based on the number of consecutive frames and the established counting model. The counting model describes the correspondence between the number of consecutive frames and the number of feedings.
[0100] It is evident that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0101] This application also proposes an electronic device, including:
[0102] At least one memory and at least one processor;
[0103] Memory, used to store one or more programs;
[0104] When one or more programs are executed by the at least one processor, the at least one processor performs the operation of the pigeon behavior counting method as described in steps S101-S104.
[0105] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0106] This application also proposes a storage medium storing a computer program, which, when executed by a processor, implements the operation of the pigeon behavior counting method as described in steps S101-S104.
[0107] Storage media are computer-usable media, including permanent and non-permanent, removable and non-removable media, and can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0108] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this application are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.
[0109] Furthermore, although this application is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding this application. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional technology for an engineer. Therefore, those skilled in the art can implement the application set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of this application, which is determined by the full scope of the appended claims and their equivalents.
[0110] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable program execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0111] In the description of the embodiments of the present invention, it should be understood that the terms "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "center," "top," "bottom," "top," "bottom," "inner," "outer," "inner side," and "outer side," etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the accompanying drawings and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. "Inner side" refers to the interior or enclosed area or space. "Outer perimeter" refers to the area surrounding a specific component or specific area.
[0112] In the description of embodiments of the present invention, the terms "first," "second," "third," and "fourth" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first," "second," "third," or "fourth" may explicitly or implicitly include one or more of that feature. In the description of the present invention, unless otherwise stated, "a plurality of" means two or more. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0113] In the description of the embodiments of the present invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," "joining," and "assembly" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0114] In the description of embodiments of the present invention, specific features, structures, materials or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0115] In the description of the embodiments of the present invention, it should be understood that "-" and "~" represent a range of two numerical values, and this range includes the endpoints. For example, "AB" represents a range greater than or equal to A and less than or equal to B. "A~B" represents a range greater than or equal to A and less than or equal to B.
[0116] In the description of embodiments of the present invention, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0117] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for counting the behavior of pigeons, characterized in that, Includes the following steps: Acquire video streams obtained from real-time filming of pigeons; A preset target detection model is used to identify the video stream frame by frame to obtain the feeding behavior of the target pigeon in each frame of the video stream. The target detection model includes a backbone network, a feature fusion network, and a detection head, and includes: extracting features from each frame of the video stream through the backbone network to obtain multi-dimensional features corresponding to each frame of the video stream; fusing the multi-dimensional features corresponding to each frame of the video stream through the feature fusion network to obtain fused features corresponding to each frame of the video stream; and obtaining the feeding behavior based on the fused features using the detection head. The number of consecutive frames is obtained based on the feeding behavior, where the number of consecutive frames is the number of consecutive frames with the same feeding behavior; Based on the number of consecutive frames and the constructed counting model, the number of feedings corresponding to the number of consecutive frames is obtained. The counting model describes the correspondence between the number of consecutive frames and the number of feedings. The construction of the counting model includes: using a four-parameter categorical variable regression function to perform regression modeling on the correspondence between the number of consecutive frames and the number of feedings to obtain the counting model; and performing model fitting on the counting model to obtain the parameters of the counting model. The expression for the four-parameter Probit function is as follows: in, This represents the number of consecutive frames and is the independent variable of the four-parameter Probit function; The number of feedings represents the dependent variable of the four-parameter Probit function; parameters a, b, c, and d are the variable parameters obtained from model fitting, where... and Let a represent the lower and upper asymptotes of the function, a represent the growth rate of the function, and b represent the inflection point of the function. The cumulative distribution function of the normal distribution is expressed as: when At this point, the frequency of feeding slows down as the frame rate increases, eventually approaching the upper asymptote. .
2. The method for counting the behavior of pigeons according to claim 1, characterized in that, The step of using a preset target detection model to identify the video stream frame by frame, and obtaining the feeding behavior of the target pigeon in each frame of the video stream, includes: The target detection model is used to identify the video stream frame by frame within a preset time period to obtain the feeding behavior.
3. The method for counting the behavior of pigeons according to claim 1, characterized in that, The counting method further includes: Identify the sex of the target pigeon; The gender is associated with the feeding behavior and the number of feedings.
4. The method for counting the behavior of pigeons according to claim 3, characterized in that, The process of identifying the sex of the target pigeon includes: The sex of the target pigeon is identified based on the video stream and the gender identifier pre-set on the target pigeon.
5. The method for counting the behavior of pigeons according to claim 1, characterized in that, The counting method further includes: The video stream, the feeding behavior in each frame of the video stream, and the number of feedings corresponding to the feeding behavior are stored.
6. A pigeon behavior counting device, characterized in that, include: The first acquisition module is used to acquire the video stream obtained from real-time shooting of pigeons; The identification module is used to identify the video stream frame by frame using a preset target detection model to obtain the feeding behavior of the target pigeon in each frame of the video stream. The target detection model includes a backbone network, a feature fusion network, and a detection head, and includes: extracting features from each frame of the video stream through the backbone network to obtain multi-dimensional features corresponding to each frame of the video stream; fusing the multi-dimensional features corresponding to each frame of the video stream through the feature fusion network to obtain fused features corresponding to each frame of the video stream; and obtaining the feeding behavior through the detection head based on the fused features. The second acquisition module is used to acquire the number of consecutive frames based on the feeding behavior, wherein the number of consecutive frames is the number of consecutive frames with the same feeding behavior; The counting module is used to obtain the number of feedings corresponding to the number of consecutive frames based on the number of consecutive frames and the constructed counting model. The counting model describes the correspondence between the number of consecutive frames and the number of feedings. The construction of the counting model includes: using a four-parameter categorical variable regression function to perform regression modeling on the correspondence between the number of consecutive frames and the number of feedings to obtain the counting model; and performing model fitting on the counting model to obtain the parameters of the counting model. The expression for the four-parameter Probit function is as follows: in, This represents the number of consecutive frames and is the independent variable of the four-parameter Probit function; The number of feedings represents the dependent variable of the four-parameter Probit function; parameters a, b, c, and d are the variable parameters obtained from model fitting, where... and Let a represent the lower and upper asymptotes of the function, a represent the growth rate of the function, and b represent the inflection point of the function. The cumulative distribution function of the normal distribution is expressed as: when At this point, the frequency of feeding slows down as the frame rate increases, eventually approaching the upper asymptote. .
7. An electronic device, characterized in that, include: At least one memory and at least one processor; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, the at least one processor performs the steps of the pigeon behavior counting method as described in any one of claims 1-5.
8. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the pigeon behavior counting method as described in any one of claims 1-5.
Citation Information
Patent Citations
Behavior recognition method and device, equipment and storage medium
CN115797964A