Chicken number detection method, device, equipment, medium and program product
By combining the YOLO model with a reversible vertical backbone network and an attention mechanism, a chicken count detection model was developed. This model solved the problems of high labor intensity and poor accuracy in traditional manual counting methods, enabling automated and efficient monitoring of chicken counts and improving breeding efficiency and management level.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SOUTH CHINA AGRICULTURAL UNIVERSITY
- Filing Date
- 2025-12-12
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional methods of manually counting chickens are labor-intensive, inaccurate, and difficult to achieve precise management and health monitoring.
A chicken count detection model combining the YOLO model with a reversible vertices backbone network and an attention mechanism is used to automatically identify the range of chicken coops and the number of chickens. Image quality is improved through image enhancement and cropping techniques, and chicken coop images are acquired by an inspection robot and uploaded to the cloud for analysis.
It enables automated, efficient, and accurate monitoring of chicken numbers, significantly reducing labor costs and improving breeding efficiency and management level.
Smart Images

Figure CN122023237A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of poultry management technology, and in particular to a method, device, equipment, medium and program product for detecting the number of chickens. Background Technology
[0002] Currently, in large-scale poultry farms, accurate inventory of live chickens is key to achieving intelligent and precise management and health monitoring.
[0003] In related technologies, traditional manual inventory methods require inspectors to patrol the chicken coop multiple times a day, manually recording the number and condition of each caged chicken. However, in practical applications, it has been found that traditional inventory methods suffer from problems such as high labor intensity, heavy workload, and poor accuracy.
[0004] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0005] This application provides a method, apparatus, equipment, medium, and program product for detecting the number of chickens, which can automatically, efficiently, and accurately monitor the number of chickens, significantly reducing labor costs and inventory pressure, and improving breeding efficiency and management level.
[0006] On one hand, embodiments of this application provide a method for detecting the number of chickens, the method comprising the following steps: Acquire images of chickens in the target area; The images of the chickens are input into the chicken count detection model to obtain the chicken count detection results output by the chicken count detection model. The chicken count detection model is based on the YOLO model and combines a reversible vertical backbone network with an attention mechanism.
[0007] Optionally, the step of inputting the chicken images into the chicken count detection model to obtain the chicken count detection result output by the chicken count detection model includes: The images of the chickens are input into the chicken count detection model; The chicken count detection model is used to detect and determine the range of the chicken cage, and then to detect and determine the number of chickens in the cage, which is then output as the chicken count detection result.
[0008] Optionally, the step of detecting and determining the range of the chicken coop using the chicken count detection model, and then detecting and determining the number of chickens in the coop, as the chicken count detection result and outputting it, includes: Using the chicken count detection model, the bounding box of the chicken cage fence in the chicken photograph is identified, and the minimum and maximum x-coordinates of the bounding box of the chicken cage fence are extracted to define the range of the chicken cage. The system detects and identifies the number and status of chickens within the cage area and outputs the chicken count detection result.
[0009] Optionally, the method further includes: Based on the chicken cage number information, determine the chicken count detection results of multi-frame chicken images of the chicken cage; If there are abnormal frames in the chicken number detection results of the multi-frame chicken images in the chicken cage, determine the chicken images of the abnormal frames and the corresponding chicken cage number information, and generate abnormal warning information. If no abnormal frames are found in the chicken count detection results of the multi-frame chicken images in the chicken coop, the chicken count detection result with the highest value among all the multi-frame chicken count detection results is determined as the chicken count detection result of the chicken coop and uploaded to the cloud.
[0010] Optionally, after acquiring images of chickens in the target area, the method further includes: The images of the chickens are enhanced and cropped to a preset size. The image enhancement includes adaptive histogram equalization and high-pass filtering.
[0011] Optionally, the chicken count detection model is trained based on the following steps: Acquire multiple historical images of chickens, and obtain the chicken count detection results corresponding to the multiple historical images of chickens; The training dataset is constructed by taking each of the historical chicken images as samples and taking the chicken count detection results corresponding to each of the historical chicken images as the sample labels. The chicken count detection model is pre-trained using the training dataset.
[0012] On the other hand, embodiments of this application provide a chicken count detection device, the device comprising: The image acquisition module is used to acquire images of chickens in the target area. The chicken detection module is used to input the chicken images into the chicken number detection model to obtain the chicken number detection result output by the chicken number detection model. The chicken count detection model is based on the YOLO model and combines a reversible vertical backbone network with an attention mechanism.
[0013] On the other hand, embodiments of this application provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0014] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0015] On the other hand, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0016] This application embodiment inputs the chicken images of the target area into a pre-trained chicken number detection model, uses the chicken number detection model to extract features from the chicken images, and automatically identifies and detects the chicken number to obtain the detection result. This can automatically, efficiently, and accurately monitor the number of chickens, significantly reduce labor costs and inventory pressure, and improve breeding efficiency and management level. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the implementation environment of a chicken count detection method provided in an embodiment of this application; Figure 2 This is a flowchart illustrating a method for detecting the number of chickens provided in an embodiment of this application; Figure 3 This is a schematic diagram of a process for detecting and analyzing the number of chickens according to an embodiment of this application; Figure 4 This is a schematic diagram of the structure of a chicken count detection device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0019] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”
[0020] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0022] Currently, in large-scale poultry farms, accurate inventory of live chickens is key to achieving intelligent and precise management and health monitoring.
[0023] In related technologies, traditional manual inventory methods require inspectors to patrol the chicken coop multiple times a day, manually recording the number and condition of each caged chicken. However, in practical applications, it has been found that traditional inventory methods suffer from problems such as high labor intensity, heavy workload, and poor accuracy.
[0024] In view of this, the present application provides a method, apparatus, device, medium and program product for detecting the number of chickens. By inputting the chicken images of the target area into a pre-trained chicken number detection model, the chicken number detection model extracts the features in the chicken images and automatically identifies and detects the chicken number to obtain the detection result. This can automatically, efficiently and accurately monitor the number of chickens, significantly reduce labor costs and inventory pressure, and improve breeding efficiency and management level.
[0025] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0026] The specific implementation methods of the embodiments of this application will be described in detail below with reference to the accompanying drawings. First, a method for detecting the number of chickens provided in the embodiments of this application will be described with reference to the accompanying drawings.
[0027] Please refer to Figure 1 , Figure 1 This is a schematic diagram of the implementation environment for a chicken count detection method provided in this application embodiment. In this implementation environment, the main hardware and software components involved include a terminal processor 110 and a server 120.
[0028] Specifically, the terminal processor 110 may be equipped with a control program for a chicken count detection method, and the server 120 serves as the backend server for this control program. The terminal processor 110 and the backend server 120 are connected via a communication link. The chicken count detection method provided in this embodiment can be executed on the terminal processor 110 side.
[0029] Server 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0030] In addition, server 120 can also be a node server in a blockchain network.
[0031] The terminal processor 110 and the server 120 can establish a communication connection via a wireless network. This wireless network uses standard communication technologies and / or protocols. The network can be the Internet or any other network, including but not limited to a Local Area Network (LAN), Metropolitan Area Network (MAN), Wide Area Network (WAN), mobile, or any combination of wireless networks, private networks, or virtual private networks. Furthermore, these hardware and software components can use the same or different communication connection methods; this application does not impose specific limitations in this regard.
[0032] Of course, this is understandable. Figure 1 The implementation environment described in this application is only one of the optional application scenarios for the chicken count detection method provided in this embodiment. The actual application is not fixed. Figure 1 The software and hardware environment shown is not specifically limited in this application.
[0033] like Figure 2 As shown, Figure 2 This is a flowchart illustrating a method for detecting the number of chickens provided in an embodiment of this application, specifically including but not limited to steps 100 to 200.
[0034] Step 100: Obtain images of chickens in the target area.
[0035] In this embodiment of the application, the chicken images of the target area can be uploaded in response to user input, or the data acquisition step of chicken images can be triggered according to a preset triggering mechanism when the chicken images to be detected in the database meet a certain threshold, and all chicken images to be detected can be read from the database.
[0036] In practical applications, based on a preset path planning algorithm, the robot can be controlled to follow a preset planned path and use the onboard camera to take real-time inspection videos of each chicken cage in the caged poultry house. By extracting the image frames from the inspection videos, images of chickens in the target area can be taken.
[0037] The target area can be the chicken cages in the poultry house. By setting different numbers for the chicken cages as the inspection task targets and marking the chicken cage numbers with information such as QR codes at the chicken cages, the inspection robot can determine whether it has reached the target area when performing the inspection task and then take pictures through the camera.
[0038] Furthermore, when acquiring images of chickens in the target area, image quality can be improved through autofocus and exposure compensation technologies. Stable network equipment can be configured at the caged poultry houses to enable cloud database-based image transmission and RTSP-based video streaming, ensuring that the data captured by the inspection robot can be efficiently and stably transmitted to the cloud for storage and analysis, thus ensuring data reliability and real-time performance.
[0039] Specifically, as an optional implementation, after acquiring the images of chickens in the target area, the method further includes: The images of the chickens are enhanced and cropped to a preset size. The image enhancement includes adaptive histogram equalization and high-pass filtering.
[0040] In this embodiment of the application, the images of chickens in the target area acquired by the inspection robot can be enhanced by methods such as adaptive histogram equalization and high-pass filtering to improve image quality and increase the accuracy of subsequent processing. Furthermore, image denoising, contrast enhancement, and cropping can be used to make the images reach a uniform specification, ensuring the consistency and validity of the model input data.
[0041] Step 200: Input the chicken images into the chicken count detection model to obtain the chicken count detection results output by the chicken count detection model; The chicken count detection model is based on the YOLO model and combines a reversible vertical backbone network with an attention mechanism.
[0042] In this embodiment of the application, the images of chickens in the target area obtained by the inspection robot are input into the chicken number detection model, which performs feature extraction and chicken number recognition, and finally outputs the chicken number detection result.
[0043] The chicken count detection model can use YOLOv8s as its foundation, replace the backbone network with Reversible Column Networks, and incorporate a Coord Attention mechanism. This allows the Reversible Columns to be used as the feature extraction backbone. During forward propagation, each column of RevCol learns decoupled features step by step, while maintaining the integrity of the information. By introducing the Coord Attention mechanism, channel information and position information can be encoded simultaneously, which is beneficial for maintaining more stable detection under fence interference and target occlusion, thereby enhancing the model's ability to detect and classify chickens.
[0044] In addition, YOLOv8s, as a lightweight model, combines a reversible vertical backbone network with the Coord Attention mechanism, making it lightweight. After training the chicken count detection model, it can be deployed on a local industrial control computer using TensorRT technology for real-time data analysis.
[0045] For example, the step of inputting the chicken images into a chicken count detection model to obtain chicken count detection results output by the chicken count detection model includes: The images of the chickens are input into the chicken count detection model; The chicken count detection model is used to detect and determine the range of the chicken cage, and then to detect and determine the number of chickens in the cage, which is then output as the chicken count detection result.
[0046] In this embodiment of the application, chicken images are input into a trained chicken number detection model. The chicken number detection model identifies the chicken cage fence, detects and determines the range of the chicken cage, and then detects and determines the number of chickens in the chicken cage, which is then output as the chicken number detection result.
[0047] Specifically, the model for detecting the number of chickens identifies the bounding box of the chicken cage fence in the chicken images and extracts its horizontal coordinates. Then, by calculating the minimum and maximum horizontal coordinates of the fence bounding box, the horizontal spatial range of the chicken cage is accurately defined, and the number of chickens within the chicken cage range is detected and identified. The accuracy of the data is ensured by comparing the detected chicken positions with the chicken cage space threshold.
[0048] Furthermore, in practical applications, the image data acquired by the inspection robot can be processed as a single video stream. Multiple consecutive images of chickens can be input into the chicken count detection model. The trend of the fence count change determines whether the chicken count detection for the current cage is complete. Specifically, when the fence count is stable at 2, the process of real-time updating the chicken count and status is activated. If the fence count temporarily changes to 1, a continuous frame check is performed, and the number of frames in which the fence count temporarily changes to 1 is calculated. If the number of frames in which the fence count temporarily changes to 1 returns to 2 before reaching a preset threshold (e.g., 10 frames), it indicates that there may have been abnormal events such as data fluctuations. The current cage is still being detected. When the number of frames in which the fence count temporarily changes to 1 reaches the preset threshold, it is determined that the chicken count detection process for the current cage has ended, and the current cage data can be saved to begin the detection of the next cage.
[0049] In practical applications, by statistically analyzing the status of each chicken within each cage, the number of chickens in each cage and their status can be determined.
[0050] Specifically, as an optional implementation, the method further includes: Based on the chicken cage number information, determine the chicken count detection results of multi-frame chicken images of the chicken cage; If there are abnormal frames in the chicken number detection results of the multi-frame chicken images in the chicken cage, determine the chicken images of the abnormal frames and the corresponding chicken cage number information, and generate abnormal warning information. If no abnormal frames are found in the chicken count detection results of the multi-frame chicken images in the chicken coop, the chicken count detection result with the highest value among all the multi-frame chicken count detection results is determined as the chicken count detection result of the chicken coop and uploaded to the cloud.
[0051] In this embodiment of the application, during the movement of the inspection robot, the inspection robot can be controlled to acquire continuous frame image data, and the number of fences and chickens in each frame image can be detected by the chicken number detection model. The detection results of each frame are recorded, and the image frames with 2 fences are selected as valid frames. Then, in the valid frames, the number and status of chickens are identified, and the corresponding chicken cage number information is identified by means of QR codes in the image.
[0052] Furthermore, based on the chicken cage number information of each chicken cage in the chicken house, the number of chickens can be detected by obtaining the chicken count results of multi-frame images of chickens in the matching chicken cages.
[0053] Furthermore, it is determined whether there are any abnormal frames in the chicken count detection results of the multi-frame images of chickens in each chicken cage. Specifically, image frames in the chicken count detection results that show abnormal chicken status, abnormal behavior, or other abnormalities can be identified as abnormal frames.
[0054] Furthermore, if there are abnormal frames in the chicken count detection results of multi-frame chicken images in the chicken coop, the abnormal frame chicken image and the corresponding chicken coop number information can be identified and output, and an abnormal warning message can be generated. Then, the remote control terminal receives the relevant abnormal warning message and can notify the relevant management personnel to go to the corresponding location or check the abnormal frame chicken image for secondary detection based on the chicken coop number information it carries. This helps to clean up in a timely manner and prevent abnormal situations such as disease transmission.
[0055] Furthermore, if there are no abnormal frames in the chicken count detection results of the multi-frame images of chickens in the chicken coop, since the chicken count detection results of the images of chickens in the chicken coop may be different from different angles, the chicken count detection result with the highest value among all the multi-frame images of chickens in each chicken coop is selected as the chicken count detection result of that chicken coop, thereby filtering out invalid data and improving the speed of data transmission.
[0056] In practical applications, please refer to Figure 3 , Figure 3 This is a flowchart illustrating the chicken count detection and result processing analysis provided in this application embodiment. For chicken images taken from the target area inside the chicken house, after image preprocessing and image enhancement, the images are input into the chicken count detection model to obtain the chicken count detection results output by the chicken count detection model. Furthermore, a monitoring report including chicken count statistics and abnormal situations can be generated. By annotating the detection information on the chicken images and determining the chicken count detection results obtained from the corresponding output of the chicken images, the results are merged, packaged, and uploaded to the cloud.
[0057] The detection information for each chicken image may include the detection time, image number, and detection object number (e.g., chicken cage number).
[0058] Furthermore, the detection and analysis results of each chicken cage are integrated and uploaded to the cloud via wireless network and the Internet, allowing managers to remotely monitor and manage the equipment.
[0059] Therefore, compared with the traditional manual inspection methods in the prior art, which are cumbersome and have a large workload, and are prone to errors in human subjective judgment leading to poor inventory accuracy, this application can identify the images of chickens obtained by the robot inspection to determine the number and status of chickens, and can automatically, efficiently and accurately monitor the number of chickens, significantly reducing labor costs and inventory pressure, and improving breeding efficiency and management level.
[0060] Specifically, as an optional implementation, the chicken count detection model is trained based on the following steps: Acquire multiple historical images of chickens, and obtain the chicken count detection results corresponding to the multiple historical images of chickens; The training dataset is constructed by taking each of the historical chicken images as samples and taking the chicken count detection results corresponding to each of the historical chicken images as the sample labels. The chicken count detection model is pre-trained using the training dataset.
[0061] In this embodiment, multiple historical chicken images and their corresponding chicken count detection results can be acquired during the historical chicken count detection process. Data augmentation and preprocessing are then performed on the chicken image data to ensure the diversity and quality of the input data. A training sample is then constructed by using any historical chicken image as a sample and its corresponding chicken count detection result as the sample label. Multiple training samples are acquired to build a training dataset, which is then input into the chicken count detection model. The model parameters are adjusted based on each output result of the chicken count detection model, ultimately completing the pre-training process of the chicken count detection model.
[0062] The pre-training process of the chicken count detection model can be considered complete when a predetermined number of pre-training iterations are reached; or it can be considered complete when the training output of the chicken count detection model converges.
[0063] In practical applications, after constructing the training dataset, it can be further divided into a training set, a validation set, and a test set. The training set accounts for 80% of the training dataset, the validation set accounts for 10%, and the test set accounts for 10%. The training set is used for model training, and the validation and test sets are used for model validation.
[0064] For example, the training epochs of the chicken count detection model can be set to 300, the batch size of training can be 16, the initial learning rate can be 1×10-4, the SGD optimizer can be used, and the trained chicken count detection model can be deployed to a Jetson AGX Orin industrial computer through TensorRT to improve its practicality.
[0065] Please see Figure 4 , Figure 4 This is a schematic diagram of a chicken count detection device provided in an embodiment of this application. This application also provides a chicken count detection device that can implement the above-mentioned chicken count detection method. The device includes: Image acquisition module 410 is used to acquire images of chickens in the target area; The chicken detection module 420 is used to input the chicken images captured into the chicken number detection model to obtain the chicken number detection result output by the chicken number detection model; The chicken count detection model is based on the YOLO model and combines a reversible vertical backbone network with an attention mechanism.
[0066] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0067] Please see Figure 5 , Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device includes: The processor 501 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 502 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 502 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 502 and is called and executed by the processor 501 using the methods described in the embodiments of this application. The input / output interface 503 is used to implement information input and output; The communication interface 504 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 505 transmits information between various components of the device (e.g., processor 501, memory 502, input / output interface 503, and communication interface 504); The processor 501, memory 502, input / output interface 503, and communication interface 504 are connected to each other within the device via bus 505.
[0068] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0069] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium 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.
[0070] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0071] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0072] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0073] This application provides a method, apparatus, device, medium, and program product for detecting the number of chickens. By inputting the acquired images of chickens in the target area into a pre-trained chicken number detection model, the model extracts features from the chicken images and automatically identifies and detects the chicken number to obtain the detection result. This method can automatically, efficiently, and accurately monitor the number of chickens, significantly reducing labor costs and inventory pressure, and improving breeding efficiency and management level.
[0074] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0075] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0076] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; 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 embodiment according to actual needs.
[0077] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0078] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. 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 comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0079] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0080] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0081] The units described above as separate components may or may not be physically separate. 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 units can be selected to achieve the purpose of this embodiment according to actual needs.
[0082] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0083] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0084] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for detecting the number of chickens, characterized in that, The method includes the following steps: Acquire images of chickens in the target area; The images of the chickens are input into the chicken count detection model to obtain the chicken count detection results output by the chicken count detection model. The chicken count detection model is based on the YOLO model and combines a reversible vertical backbone network with an attention mechanism.
2. The method according to claim 1, characterized in that, The step of inputting the chicken images into the chicken count detection model to obtain the chicken count detection results output by the chicken count detection model includes: The images of the chickens are input into the chicken count detection model; The chicken count detection model is used to detect and determine the range of the chicken cage, and then to detect and determine the number of chickens in the cage, which is then output as the chicken count detection result.
3. The method according to claim 2, characterized in that, The process of using the chicken count detection model to detect and determine the range of the chicken coop, and then detecting and determining the number of chickens in the coop, as the chicken count detection result and outputting it, includes: Using the chicken count detection model, the bounding box of the chicken cage fence in the chicken photograph is identified, and the minimum and maximum x-coordinates of the bounding box of the chicken cage fence are extracted to define the range of the chicken cage. The system detects and identifies the number and status of chickens within the cage area and outputs the chicken count detection result.
4. The method according to claim 1, characterized in that, The method further includes: Based on the chicken cage number information, determine the chicken count detection results of multi-frame chicken images of the chicken cage; If there are abnormal frames in the chicken number detection results of the multi-frame chicken images in the chicken cage, determine the chicken images of the abnormal frames and the corresponding chicken cage number information, and generate abnormal warning information. If no abnormal frames are found in the chicken count detection results of the multi-frame chicken images in the chicken coop, the chicken count detection result with the highest value among all the multi-frame chicken count detection results is determined as the chicken count detection result of the chicken coop and uploaded to the cloud.
5. The method according to claim 1, characterized in that, After acquiring images of chickens in the target area, the process also includes: The images of the chickens are enhanced and cropped to a preset size. The image enhancement includes adaptive histogram equalization and high-pass filtering.
6. The method according to claim 1, characterized in that, The chicken count detection model was trained based on the following steps: Acquire multiple historical images of chickens, and obtain the chicken count detection results corresponding to the multiple historical images of chickens; The training dataset is constructed by taking each of the historical chicken images as samples and taking the chicken count detection results corresponding to each of the historical chicken images as the sample labels. The chicken count detection model is pre-trained using the training dataset.
7. A chicken count detection device, characterized in that, The device includes: The image acquisition module is used to acquire images of chickens in the target area. The chicken detection module is used to input the chicken images into the chicken number detection model to obtain the chicken number detection result output by the chicken number detection model. The chicken count detection model is based on the YOLO model and combines a reversible vertical backbone network with an attention mechanism.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.