Methods, devices, equipment and media for testing chickens in poultry farms
By improving the backbone network and detection head network of the YOLO series algorithms, the problems of missed detection and false detection in densely populated chicken environments have been solved, achieving high-precision and stable chicken detection, which is suitable for farm management.
Patent Information
- Application Number
- CN202510148162.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-02-11
AI Technical Summary
Existing YOLO algorithms are prone to missed detections and false detections in environments with dense chicken populations, resulting in decreased detection accuracy and unstable target tracking.
By updating the C2f module in the backbone network to the C2f_Conv3XC module, the neck network to a multi-scale adaptive feature pyramid network, and employing a dual allocation method in the detection head network, a second chicken detection model is constructed to enhance feature extraction and multi-scale information fusion, thereby optimizing detection stability.
It significantly improves the accuracy of chicken detection, reduces missed and false detections, enhances the stability of target tracking, is suitable for complex farm environments, and improves detection efficiency and accuracy.
Smart Images

Figure CN120014672B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image recognition, and in particular to a method for detecting chickens in a poultry farm, a corresponding device, electronic equipment, and a computer-readable storage medium. Background Technology
[0002] In modern farm environments, chicken detection typically faces challenges such as small target size, complex backgrounds, and frequent occlusion. While the YOLO series of algorithms has achieved good results in general object detection, its limited ability to detect small targets makes it unsuitable for the high-precision requirements of farm applications. Furthermore, the traditional reliance of the YOLO series algorithms on the NMS (Non-Maximum Suppression) post-processing step increases computational burden and impacts real-time detection efficiency.
[0003] Existing target detection algorithms, especially the YOLO series, still have limited detection performance in such scenarios. In particular, they are prone to missed detections and false detections in dense chicken environments, leading to decreased detection accuracy and unstable target tracking.
[0004] In summary, existing technologies for YOLO series algorithms are prone to missed detections and false detections in dense chicken environments, leading to decreased detection accuracy and unstable target tracking. To address these issues, the applicant has made corresponding explorations. Summary of the Invention
[0005] The purpose of this application is to solve the above-mentioned problems by providing a method for detecting chickens in a farm, a corresponding device, electronic equipment, and a computer-readable storage medium.
[0006] To achieve the various objectives of this application, the following technical solution is adopted:
[0007] A method for detecting chickens in a farm, proposed for one of the purposes of this application, includes:
[0008] In response to the instruction to inspect chickens in a farm, the system acquires an image frame of the farm to be inspected, which contains multiple chickens.
[0009] The C2f module in the backbone network of the first chicken detection model is updated to the C2f_Conv3XC module, the path aggregation network in the neck network is updated to the multi-scale adaptive feature pyramid network, and a dual allocation method is adopted in the detection head network to construct the second chicken detection model.
[0010] The image frame of the farm to be detected is input into the second chicken detection model that has been trained to convergence state to determine the number of chickens, so as to complete the detection of chickens in the farm.
[0011] Optionally, the C2f_Conv3XC module includes multiple Bottleneck_Conv3XC sub-modules, wherein each Bottleneck_Conv3XC sub-module performs feature extraction and fusion through Conv3XC convolutional layers.
[0012] Optionally, the Conv3XC convolutional layer includes a first 1x1 convolutional layer, a 3x3 convolutional layer, a second 1x1 convolutional layer, and a skip connection, wherein the first 1x1 convolutional layer is used for channel compression; the 3x3 convolutional layer is used for spatial feature extraction; the second 1x1 convolutional layer is used for channel expansion; and the skip connection is used to add the input features to the output features.
[0013] Optionally, the multi-scale adaptive feature pyramid network enhances its ability to express multi-scale features through adaptive weight allocation and cross-scale feature fusion.
[0014] Optionally, the steps for training the second chicken detection model include:
[0015] The training set is input into the second chicken detection model for forward propagation training, and the backpropagation algorithm is used to update and optimize the second chicken detection model. The training set represents the image frames of the farm to be detected, which contain multiple chickens.
[0016] The second chicken detection model is trained iteratively multiple times using the cross-entropy loss function and the SGD optimizer until it reaches a convergent state, thus obtaining the second chicken detection model that has been trained to a convergent state.
[0017] Optionally, the step of obtaining the training set includes:
[0018] The method involves extracting frames from videos of chickens in a poultry farm environment to obtain images of the poultry farm to be detected, which contain multiple chickens.
[0019] The images of the farm to be detected, which contain multiple chickens, are extracted to construct a dataset, and the dataset is then labeled.
[0020] After data augmentation, the dataset is divided into a training set, a validation set, and a test set in a 6:2:2 ratio. The training set is then input into the second chicken detection model for training, resulting in a second chicken detection model that has been trained to convergence.
[0021] Optionally, the basic network architecture of the first chicken detection model is the original YOLOv10 network model, and the basic network architecture of the second chicken detection model is an improved YOLOv10 network model.
[0022] A detection device for chickens in a farm, provided for another purpose of this application, includes:
[0023] The image frame acquisition module is configured to acquire an image frame of the farm to be detected containing multiple chickens in response to an instruction to detect chickens in the farm.
[0024] The detection model construction module is set to update the C2f module in the backbone network of the first chicken detection model to the C2f_Conv3XC module, update the path aggregation network in the neck network to the multi-scale adaptive feature pyramid network, and use a dual allocation method in the detection head network to construct the second chicken detection model.
[0025] The chicken detection module is configured to input the image frame of the farm to be detected into a second chicken detection model that has been trained to convergence, so as to determine the number of chickens and complete the detection of chickens in the farm.
[0026] An electronic device provided for another purpose of this application includes a central processing unit and a memory, the central processing unit being configured to invoke and run a computer program stored in the memory to perform the steps of the chicken detection method for farms described in this application.
[0027] A computer-readable storage medium is provided for another purpose of this application, which stores, in the form of computer-readable instructions, a computer program implemented according to the chicken detection method in the farm, which, when called by a computer, executes the steps included in the corresponding method.
[0028] Compared to existing technologies, this application addresses the problems in existing technologies where YOLO series algorithms are prone to false positives and false negatives in dense chicken environments, leading to decreased detection accuracy and unstable target tracking. This application provides, but is not limited to, the following beneficial effects:
[0029] Firstly, this application updates the C2f module in the backbone network of the first chicken detection model to a C2f_Conv3XC module. This module can more effectively handle chicken features in complex backgrounds, especially in environments like farms where chickens have a high similarity to the background. The introduction of 3x3 convolutional kernels improves the ability to recognize small targets, resulting in higher detection accuracy and reduced missed detections.
[0030] Secondly, the path aggregation network (PAN) in the neck network is updated to a multi-scale adaptive feature pyramid network. This allows for effective handling of complex backgrounds and chicken detection at different scales through multi-scale feature fusion. Chickens in farms typically have varying sizes and distributions, and traditional single-scale methods struggle to capture these differences. The multi-scale adaptive feature pyramid network can better capture chicken features at different scales, thereby improving detection accuracy and stability.
[0031] Third, the application of the dual-assignment method in the detection head network helps improve the stability of target tracking, especially when there is occlusion or overlap among chickens. By assigning multiple predictions to each detection box, the dual-assignment method effectively handles target occlusion problems and reduces false positives and false negatives caused by target overlap. It allows the model to better distinguish similar targets, ensuring that chickens can be correctly identified even in occlusion or groups.
[0032] Fourth, by updating the backbone network and the detection head network, the model can improve detection accuracy while potentially optimizing efficiency and inference speed. The new network structure reduces redundant computation through multi-scale adaptive feature extraction, enabling the model to process each frame of image quickly, thus achieving real-time detection. This feature is crucial in practical applications, especially in dynamic environments like farms, where rapid response to detection results is essential for management and decision-making.
[0033] In summary, the chicken detection method for farms proposed in this application, by enhancing the model's feature extraction capabilities, improving multi-scale information fusion, refining occlusion handling, and optimizing detection stability, not only significantly improves the accuracy of chicken detection and reduces missed and false detections, but also enhances the stability of target tracking, making it particularly suitable for complex farm environments. These improvements make the model more applicable to practical applications, improving the efficiency and accuracy of farm management. Attached Figure Description
[0034] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0035] Figure 1 This is a flowchart illustrating the chicken detection method in the embodiments of this application;
[0036] Figure 2 This is an exemplary network architecture for the improved YOLOv10 network model in the embodiments of this application;
[0037] Figure 3 This is an exemplary network architecture for the C2f_Conv3XC module in the embodiments of this application;
[0038] Figure 4This is an exemplary network architecture of the multi-scale adaptive feature pyramid network in the embodiments of this application;
[0039] Figure 5 This is a diagram showing the recognition performance of the improved YOLOv10 network model in the embodiments of this application;
[0040] Figure 6 This is a schematic diagram of the chicken detection device in the embodiment of this application;
[0041] Figure 7 This is a schematic diagram of the structure of the computer device in the embodiments of this application. Detailed Implementation
[0042] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0043] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.
[0044] Those skilled in the art will understand that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0045] Those skilled in the art will understand that the terms "client," "terminal," and "terminal device" as used herein include both devices that receive wireless signals, devices that only possess wireless signal receiver capabilities without transmission capabilities, and devices with receiving and transmitting hardware, devices that have receiving and transmitting hardware capable of bidirectional communication over a bidirectional communication link. Such devices may include: cellular or other communication devices such as personal computers or tablets, having single-line displays, multi-line displays, or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service) that can combine voice, data processing, fax, and / or data communication capabilities; PDAs (Personal Digital Assistants) that may include radio frequency receivers, pagers, internet / intranet access, web browsers, notebooks, calendars, and / or GPS (Global Positioning System) receivers; and conventional laptops and / or handheld computers or other devices that have and / or include radio frequency receivers. As used herein, "client," "terminal," and "terminal device" can be portable, transportable, installed in a means of transportation (air, sea, and / or land), or suitable and / or configured to operate locally and / or in a distributed manner, operating in any other location on Earth and / or in space. "Client," "terminal," and "terminal device" as used herein can also be a communication terminal, an internet access terminal, or a music / video playback terminal, such as a PDA, a MID (Mobile Internet Device), and / or a mobile phone with music / video playback capabilities, or a smart TV, set-top box, etc.
[0046] The hardware referred to by the names "server," "client," and "service node" in this application is essentially an electronic device with the equivalent capabilities of a personal computer. It is a hardware device with the necessary components revealed by the von Neumann architecture, such as a central processing unit (including an arithmetic logic unit and a control unit), memory, input devices, and output devices. The computer program is stored in its memory, and the central processing unit loads the program stored in the secondary storage into the main memory to run it, execute the instructions in the program, and interact with the input and output devices to complete specific functions.
[0047] It should be noted that the concept of "server" used in this application can also be extended to the case of server clusters. Based on the network deployment principles understood by those skilled in the art, the servers should be logically divided. Physically, these servers can be independent of each other but accessible through interfaces, or they can be integrated into a single physical computer or a computer cluster. Those skilled in the art should understand this flexibility and should not use it to constrain the implementation of the network deployment method in this application.
[0048] One or more of the technical features of this application, unless explicitly specified herein, can be deployed on a server and accessed by a client remotely calling the online service interface provided by the server, or can be directly deployed and run on a client for access.
[0049] Unless otherwise specified, the neural network models referenced or potentially referenced in this application may be deployed on a remote server and invoked remotely on the client, or deployed on a client with the capability to invoke directly. In some embodiments, when running on the client, the corresponding intelligence may be acquired through transfer learning in order to reduce the requirements on the client's hardware resources and avoid excessive consumption of the client's hardware resources.
[0050] Unless otherwise specified, all data involved in this application may be stored remotely on a server or on a local terminal device, as long as it is suitable for use by the technical solution of this application.
[0051] Those skilled in the art will understand that although the various methods in this application are described based on the same concept and thus present commonality among them, they can be performed independently unless otherwise specified. Similarly, the various embodiments disclosed in this application are all based on the same inventive concept; therefore, concepts expressed in the same way, as well as concepts that are appropriately changed for convenience but are expressed differently, should be understood equivalently.
[0052] Unless otherwise expressly stated, the various embodiments disclosed in this application can be combined in a cross-cutting manner to flexibly construct new embodiments, as long as such combination does not depart from the inventive spirit of this application and can meet the needs of the prior art or solve a certain deficiency in the prior art. Those skilled in the art should be aware of such modifications.
[0053] Please see Figure 1 In one embodiment of the method for detecting chickens in a poultry farm according to this application, the method includes:
[0054] Step S10: In response to the instruction to detect chickens in the farm, obtain an image frame of the farm to be detected containing multiple chickens.
[0055] The poultry detection system in the terminal device can respond to the instruction to detect poultry in the farm and acquire image frames of the farm to be detected containing multiple poultry.
[0056] Specifically, by filming chickens in a poultry farm environment, and using video frame extraction technology to extract still images, we can identify the poultry farm image frames containing multiple chickens. The video frame extraction frequency is set to extract 5 frames per second to ensure that the diversity of chickens from different angles and backgrounds can be captured. The acquired images will serve as the basis for training, validation, and testing datasets.
[0057] Based on the acquired chicken images, data annotation was performed using a labeling tool (LabelImg). The annotation for each image included the chicken's bounding box and its corresponding category label. During data annotation, annotators were required to ensure that each chicken was within the bounding box and to assign an accurate label to each target to guarantee high-quality data.
[0058] After annotation, the dataset is divided into training, validation, and test sets, typically in a 6:2:2 ratio, depending on the actual situation. To improve the model's generalization ability, data augmentation is performed, including but not limited to scaling, mirroring, random occlusion, and color shifting, to increase the diversity of the dataset and help the model adapt to more complex farm environments.
[0059] The augmented dataset will be divided into training (60%), validation (20%), and test (20%) sets. The training set is used to train the model, the validation set is used for parameter tuning and selecting the optimal model, and the test set is used to evaluate the model's performance.
[0060] Step S20: Update the C2f module in the backbone network of the first chicken detection model to the C2f_Conv3XC module, update the path aggregation network in the neck network to the multi-scale adaptive feature pyramid network, and use the dual allocation method in the detection head network to construct the second chicken detection model.
[0061] Please see Figure 2After acquiring image frames of a farm containing multiple chickens, the C2f module in the backbone network of the first chicken detection model is updated to the C2f_Conv3XC module, the path aggregation network in the neck network is updated to the multi-scale adaptive feature pyramid network, and a dual allocation method is used in the detection head network to construct the second chicken detection model. The basic network architecture of the first chicken detection model is the original YOLOv10 network model, and the basic network architecture of the second chicken detection model is the improved YOLOv10 network model, which can be named the YOLO-CD network model.
[0062] Specifically, the backbone network is an improvement on the C2f module in the original YOLOv10 network model, replacing it with the C2f_Conv3XC module, such as... Figure 3 As shown, the C2f_Conv3XC module contains multiple Bottleneck_Conv3XC sub-modules. Each Bottleneck_Conv3XC sub-module uses Conv3XC convolutional layers for feature extraction and fusion. The Conv3XC convolutional layer includes a 1x1 convolutional layer for expanding the number of channels, followed by a 3x3 convolutional layer for spatial feature extraction, and then another 1x1 convolutional layer for channel compression. Skip connections are also used to maintain the integrity of the features.
[0063] like Figure 4 As shown, the Neck network updates the PAFPN (Path Aggregation Network) in the original YOLOv10 network model to MAFPN (Multi-Scale Adaptive Feature Pyramid Network). The MAFPN enhances the ability to express multi-scale features through adaptive weight allocation and cross-scale feature fusion, thereby improving the detection accuracy of small targets (such as chickens).
[0064] The detection head network retains the YOLOv10 design without NMS (non-maximum suppression), and directly outputs high-precision detection results through a dual-assignment method, which greatly reduces computational overhead and improves detection efficiency.
[0065] The improved YOLOv10 network model was used to train the training set. During training, multiple rounds of iterative training were performed using the cross-entropy loss function and the SGD (Stochastic Gradient Descent) optimizer until the model converged. Throughout the training process, the learning rate and batch size were continuously adjusted to ensure stable convergence and the acquisition of optimal parameters.
[0066] In some embodiments, the C2f_Conv3XC module includes multiple Bottleneck_Conv3XC sub-modules, wherein each Bottleneck_Conv3XC sub-module performs feature extraction and fusion through Conv3XC convolutional layers.
[0067] In a further embodiment, the Conv3XC convolutional layer includes a first 1x1 convolutional layer, a 3x3 convolutional layer, a second 1x1 convolutional layer, and a skip connection, wherein the first 1x1 convolutional layer is used for channel compression; the 3x3 convolutional layer is used for spatial feature extraction; the second 1x1 convolutional layer is used for channel expansion; and the skip connection is used to add the input features to the output features.
[0068] In some embodiments, the multi-scale adaptive feature pyramid network enhances its ability to express multi-scale features through adaptive weight allocation and cross-scale feature fusion.
[0069] In some embodiments, the step of training a second chicken detection model includes:
[0070] Step S201: Input the training set into the second chicken detection model for forward propagation training, and use the backpropagation algorithm to update and optimize the second chicken detection model. The training set represents the image frames of the farm to be detected, which contain multiple chickens.
[0071] Step S202: The second chicken detection model is trained iteratively multiple times using the cross-entropy loss function and SGD optimizer until the second chicken detection model reaches a convergent state, thus obtaining the second chicken detection model that has been trained to a convergent state.
[0072] In some embodiments, the step of obtaining the training set includes:
[0073] Step S2001: Obtain the farm image frame containing multiple chickens from the chicken video in the farm environment by extracting video frames.
[0074] Step S2002: Extract the images of the farm to be detected, which contain multiple chickens, to construct a dataset, and label the dataset.
[0075] Step S2003: After data augmentation, the dataset is divided into a training set, a validation set, and a test set in a ratio of 6:2:2. The training set is then input into the second chicken detection model for training, resulting in a second chicken detection model that has been trained to a convergent state.
[0076] Step S30: Input the image frame of the farm to be detected into the second chicken detection model that has been trained to convergence state to determine the number of chickens, so as to complete the detection of chickens in the farm.
[0077] Please see Figure 5 After the second chicken detection model is trained to a convergent state, the image frame of the farm to be detected is input into the second chicken detection model that has been trained to a convergent state to determine the number of chickens and complete the detection of chickens in the farm.
[0078] Specifically, the performance evaluation metrics include evaluating the performance of the target network model after testing using preset performance evaluation metrics, which include precision (P), recall (R), average precision (AP), number of model parameters, model computational cost (FLOPs), model inference speed (FPS), and model size.
[0079] Precision is defined as: P = TP / (TP + FP); Recall is defined as: R = TP / (TP + FN); Average Precision is defined as: AP = The model parameters are defined as: Parameters = C in ×K 2 ×C out The computational cost of the model is defined as: FLOPs = 2 × H × W (C in K 2 +1)C out ;
[0080] Model inference speed is defined as the number of image frames the model processes per second.
[0081] In the above formula, TP represents a true positive, meaning a positive sample is correctly identified as a positive sample; FN represents a false negative, meaning a positive sample is incorrectly identified as a negative sample; TN represents a true negative, meaning a negative sample is correctly identified as a negative sample; and FP represents a false positive, meaning a negative sample is incorrectly identified as a positive sample. C in This represents the number of channels in each convolutional kernel, which is also the number of channels in the input feature map; C out The output feature map has the number of channels; K is the size of the convolution kernel; W and H are the width and height of the output feature map.
[0082] To test the performance improvement of the method in this application for chicken identification, relevant indicators were calculated for the existing detection model and the improved YOLOv10 network model in this application. The comparison results of the relevant indicators of the existing network model and the YOLO-CD network model of this application are shown in Table 1.
[0083] Table 1. Comparison of relevant metrics between existing network models and the YOLO-CD network model of this application.
[0084]
[0085] As shown in Table 1, YOLO-CD has significant advantages over YOLOv5s, YOLOv8s, and YOLOv10n. First, YOLO-CD excels in accuracy, achieving a precision of 96.5%, a recall of 96.8%, and a mAP0.5 of 98.8%, significantly surpassing YOLOv5s (92.3% precision, 91.4% recall, 95.1% mAP0.5) and YOLOv8s (92.1% precision, 92.7% recall, 96.5% mAP0.5), particularly in small target detection and complex backgrounds. Second, YOLO-CD has only 4.7M parameters and a computational cost of 14.8G, lower than YOLOv8s (11.2M and 28.6G), yet it demonstrates superior accuracy, showcasing its advantage in model optimization. Furthermore, YOLO-CD achieves an inference speed of 110 FPS, slightly lower than YOLOv10n's 117 FPS, but still maintains high real-time performance, making it suitable for real-time detection tasks. Combined with improvements to the C2f_Conv3XC module and MAFPN structure, YOLO-CD is particularly effective in small target detection, reducing false negatives and missed detections in complex environments such as farms, thus improving detection accuracy and stability. Overall, YOLO-CD outperforms existing YOLO models in accuracy, efficiency, and real-time performance, making it a highly efficient and accurate target detection method.
[0086] As can be seen from the above embodiments, this application solves the problem that in the prior art, due to the small target size, complex background and frequent occlusion in the farm environment, chicken detection is prone to missed detection and false detection, which affects the detection accuracy and target tracking stability.
[0087] As can be seen from the above embodiments, compared with the prior art, this application addresses the problems in the prior art where YOLO series algorithms are prone to missed detections and false detections in dense chicken environments, leading to decreased detection accuracy and unstable target tracking. This application has, but is not limited to, the following beneficial effects:
[0088] Firstly, this application updates the C2f module in the backbone network of the first chicken detection model to a C2f_Conv3XC module. This module can more effectively handle chicken features in complex backgrounds, especially in environments like farms where chickens have a high similarity to the background. The introduction of 3x3 convolutional kernels improves the ability to recognize small targets, resulting in higher detection accuracy and reduced missed detections.
[0089] Secondly, the path aggregation network (PAN) in the neck network is updated to a multi-scale adaptive feature pyramid network. This allows for effective handling of complex backgrounds and chicken detection at different scales through multi-scale feature fusion. Chickens in farms typically have varying sizes and distributions, and traditional single-scale methods struggle to capture these differences. The multi-scale adaptive feature pyramid network can better capture chicken features at different scales, thereby improving detection accuracy and stability.
[0090] Third, the application of the dual-assignment method in the detection head network helps improve the stability of target tracking, especially when there is occlusion or overlap among chickens. By assigning multiple predictions to each detection box, the dual-assignment method effectively handles target occlusion problems and reduces false positives and false negatives caused by target overlap. It allows the model to better distinguish similar targets, ensuring that chickens can be correctly identified even in occlusion or groups.
[0091] Fourth, by updating the backbone network and the detection head network, the model can improve detection accuracy while potentially optimizing efficiency and inference speed. The new network structure reduces redundant computation through multi-scale adaptive feature extraction, enabling the model to process each frame of image quickly, thus achieving real-time detection. This feature is crucial in practical applications, especially in dynamic environments like farms, where rapid response to detection results is essential for management and decision-making.
[0092] In summary, the chicken detection method for farms proposed in this application, by enhancing the model's feature extraction capabilities, improving multi-scale information fusion, refining occlusion handling, and optimizing detection stability, not only significantly improves the accuracy of chicken detection and reduces missed and false detections, but also enhances the stability of target tracking, making it particularly suitable for complex farm environments. These improvements make the model more applicable to practical applications, improving the efficiency and accuracy of farm management.
[0093] Please see Figure 6A chicken detection device for a poultry farm, provided to meet one of the purposes of this application, includes an image frame acquisition module 1100, a detection model construction module 1200, and a chicken detection module 1300. The image frame acquisition module 1100 is configured to acquire an image frame of the poultry farm containing multiple chickens in response to an instruction to detect chickens in the poultry farm. The detection model construction module 1200 is configured to update the C2f module in the backbone network of a first chicken detection model to a C2f_Conv3XC module, update the path aggregation network in the neck network to a multi-scale adaptive feature pyramid network, and employ a dual-assignment method in the detection head network to construct a second chicken detection model. The chicken detection module 1300 is configured to input the image frame of the poultry farm to be detected into the second chicken detection model, which has been trained to a convergent state, to determine the number of chickens and complete the detection of chickens in the poultry farm.
[0094] Based on any embodiment of this application, please refer to Figure 7 Another embodiment of this application also provides an electronic device, which can be implemented by a computer device, such as... Figure 7 The diagram shows the internal structure of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. The computer-readable storage medium stores an operating system, a database, and computer-readable instructions. The database may store a sequence of control information. When the computer-readable instructions are executed by the processor, the processor can implement a method for detecting chickens in a poultry farm. The processor of the computer device provides computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor can execute the poultry farm detection method of this application. The network interface of the computer device is used for communication with a terminal. Those skilled in the art will understand that… Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0095] In this embodiment, the processor is used to execute... Figure 6 The specific functions of each module are defined within the device, and the memory stores the program code and various data required to execute these modules. A network interface is used for data transmission between the user terminal and the server. In this embodiment, the memory stores the program code and data required to execute all modules in the poultry farm chicken detection device of this application, and the server can call the server's program code and data to execute the functions of all modules.
[0096] This application also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the poultry detection method in any embodiment of this application.
[0097] This application also provides a computer program product, including a computer program / instructions that, when executed by one or more processors, implement the steps of the chicken detection method in any embodiment of this application.
[0098] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. This computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0099] The above description is only a partial embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
[0100] In summary, the chicken detection method for farms proposed in this application, by enhancing the model's feature extraction capabilities, improving multi-scale information fusion, refining occlusion handling, and optimizing detection stability, not only significantly improves the accuracy of chicken detection and reduces missed and false detections, but also enhances the stability of target tracking, making it particularly suitable for complex farm environments. These improvements make the model more applicable to practical applications, improving the efficiency and accuracy of farm management.
Claims
1. A method for detecting chickens in a poultry farm, characterized in that, include: In response to the instruction to inspect chickens in a farm, the system acquires an image frame of the farm to be inspected, which contains multiple chickens. The C2f module in the backbone network of the first chicken detection model is updated to a C2f_Conv3XC module, the path aggregation network in the neck network is updated to a multi-scale adaptive feature pyramid network, and a dual allocation method is used in the detection head network to construct the second chicken detection model. The C2f_Conv3XC module includes multiple Bottleneck_Conv3XC sub-modules, each of which performs feature extraction and fusion through a Conv3XC convolutional layer. The Conv3XC convolutional layer includes a first 1x1 convolutional layer and a 3x1 convolutional layer. The network consists of three convolutional layers, a second 1x1 convolutional layer, and a skip connection. The first 1x1 convolutional layer is used for channel compression; the 3x3 convolutional layer is used for spatial feature extraction; the second 1x1 convolutional layer is used for channel expansion; and the skip connection is used to add the input and output features. The multi-scale adaptive feature pyramid network enhances the expressive power of multi-scale features through adaptive weight allocation and cross-scale feature fusion. The basic network architecture of the first chicken detection model is the original YOLOv10 network model, and the basic network architecture of the second chicken detection model is an improved YOLOv10 network model. The image frame of the farm to be detected is input into the second chicken detection model that has been trained to convergence state to determine the number of chickens, so as to complete the detection of chickens in the farm.
2. The method for detecting chickens in a poultry farm according to claim 1, characterized in that, The steps for training the second chicken detection model include: The training set is input into the second chicken detection model for forward propagation training, and the backpropagation algorithm is used to update and optimize the second chicken detection model. The training set represents the image frames of the farm to be detected, which contain multiple chickens. The second chicken detection model is trained iteratively multiple times using the cross-entropy loss function and the SGD optimizer until it reaches a convergent state, thus obtaining the second chicken detection model that has been trained to a convergent state.
3. The method for detecting chickens in a poultry farm according to claim 2, characterized in that, The steps for obtaining the training set include: The method involves extracting frames from videos of chickens in a poultry farm environment to obtain images of the poultry farm to be detected, which contain multiple chickens. The images of the farm to be detected, which contain multiple chickens, are extracted to construct a dataset, and the dataset is then labeled. After data augmentation, the dataset is divided into a training set, a validation set, and a test set in a 6:2:2 ratio. The training set is then input into the second chicken detection model for training, resulting in a second chicken detection model that has been trained to convergence.
4. A detection device for chickens in a poultry farm, characterized in that, include: The image frame acquisition module is configured to acquire an image frame of the farm to be detected containing multiple chickens in response to an instruction to detect chickens in the farm. The detection model construction module is configured to update the C2f module in the backbone network of the first chicken detection model to a C2f_Conv3XC module, update the path aggregation network in the neck network to a multi-scale adaptive feature pyramid network, and employ a dual-assignment method in the detection head network to construct the second chicken detection model. The C2f_Conv3XC module includes multiple Bottleneck_Conv3XC sub-modules, each of which performs feature extraction and fusion through a Conv3XC convolutional layer. The Conv3XC convolutional layer includes a first 1x1 convolutional layer. The network consists of a first layer, a 3x3 convolutional layer, a second 1x1 convolutional layer, and a skip connection. The first 1x1 convolutional layer is used for channel compression; the 3x3 convolutional layer is used for spatial feature extraction; the second 1x1 convolutional layer is used for channel expansion; and the skip connection is used to add the input features to the output features. The multi-scale adaptive feature pyramid network enhances the expressive power of multi-scale features through adaptive weight allocation and cross-scale feature fusion. The basic network architecture of the first chicken detection model is the original YOLOv10 network model, and the basic network architecture of the second chicken detection model is an improved YOLOv10 network model. The chicken detection module is configured to input the image frame of the farm to be detected into a second chicken detection model that has been trained to convergence, so as to determine the number of chickens and complete the detection of chickens in the farm.
5. An electronic device comprising a central processing unit and a memory, characterized in that, The central processing unit is used to invoke and run a computer program stored in the memory to perform the steps of the method as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, It stores, in the form of computer-readable instructions, a computer program implemented according to any one of claims 1 to 3, which, when invoked by a computer, executes the steps included in the corresponding method.
Citation Information
Patent Citations
Cage rearing broiler chicken state detection and counting system based on deep learning
CN116665129A
Deep learning-based chicken and egg target detection method for chicken farm
CN118537802A