Chicken cage food consumption prediction method in cage rearing mode
By combining computer vision and machine learning technology, real-time monitoring and prediction of chicken cage feed intake, the problem of difficult monitoring of feed intake intake in the stacked cage breeding mode is solved, precise prediction and nutrition management are achieved, and chicken flock health and productivity are improved.
Patent Information
- Application Number
- CN202411600368.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-03-11
AI Technical Summary
Under the stacked cage breeding mode, it is difficult to monitor and predict the cage feed intake of chickens. The existing methods are prone to ignore the nutritional needs of individual chickens, which affects the health and production performance of chicken flocks.
Combining computer vision technology and machine learning technology, we collect video images of chicken cages in real time, identify chicken behaviors, and use pre-trained object detection models and fitted mathematical models to accurately predict the feed intake of each cage.
Accurate prediction of the feed intake of chickens in different cages is achieved, feed utilization is improved, waste is reduced, and it ensures that each cage is only equipped with appropriate nutrition, maintains the overall health of the flock, and prevents diseases, improves productivity and economic benefits.
Smart Images

Figure CN119599454A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent livestock and poultry breeding, and in particular to a method for predicting feed intake of chickens in a cage breeding mode. Background Art
[0002] Feed intake is crucial to the health and production performance of chickens. In the prior art, the feed intake of individual chickens is often estimated by dividing the total feed consumption of the entire house by the total number of chickens. This method is simple and easy to use, but it is easy to ignore the nutritional needs of some chickens. Whether it is excess or insufficient, it may affect the overall health and production performance of the flock. With the widespread use of stacked cage farming in large-scale chicken farming, this farming method raises more chickens and has a wider spatial distribution, making it more difficult to monitor individual feed intake. Refining the concept of average feed intake of the entire house to the cage level, that is, monitoring feed intake per cage, is a practical and forward-looking solution.
[0003] Therefore, it is of great significance to study the method of predicting feed intake per cage position in the (stacked) cage farming model. Summary of the invention
[0004] The present invention provides a method for predicting the feed intake of chickens in cages under a cage-raising mode, which can combine computer vision technology and machine learning technology, identify the behavior of chickens in each chicken cage based on images of each chicken cage collected in real time, and then accurately predict the feed intake of each cage in the current period based on the chicken behavior.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] In a first aspect, the present application provides a method for predicting feed intake of chickens in a cage mode, the method comprising:
[0007] S1, collecting video images of each cage position within a preset time period in the cage breeding mode;
[0008] S2, converting the collected video images into continuous image frames, and inputting each image frame into a pre-trained target detection model to identify the feeding status of the chickens in each image frame of each cage, including the feeding status and the non-feeding status;
[0009] S3, according to the feeding status of the chickens in all continuous image frames corresponding to each cage position, based on a preset strategy, determining the total feeding time and the number of feeding times of the chickens corresponding to each cage position within a preset time period;
[0010] S4, the total feeding time and the number of feeding times of the chickens in each cage position within the preset time period are input into a pre-built fitting mathematical model or machine learning model, and the feed intake of each cage position corresponding to the preset time period is output.
[0011] In one implementation, the method, before S1, further includes the step of training a target detection model;
[0012] The training target detection model comprises:
[0013] Collect sample images of each cage, annotate the heads of the chickens inside the feeding trough in the sample images, and construct a data set for identifying the heads of the chickens;
[0014] Divide the data set into training set, validation set and test set according to the preset ratio;
[0015] The target detection model is trained based on the dataset.
[0016] In one implementation, the target detection model outputs a detection frame including the chicken's head in each image frame of each cage position, and the detection frame is labeled with the cage position number.
[0017] In one implementation, in S2, the feeding state and the non-feeding state are determined by:
[0018] A threshold line covering the feeding trough area is set in each image frame of each cage position;
[0019] The feeding state of the chicken is determined according to the relative relationship between the central coordinates of the detection frame of the chicken's head in each image frame identified by the target detection model and the threshold line. When the central coordinates of the detection frame are within the threshold line, the feeding state of the chicken is determined to be the feeding state. When the central coordinates of the detection frame are outside the threshold line, the feeding state of the chicken is determined to be the non-feeding state.
[0020] In one implementation, the threshold line includes at least an upper boundary and a lower boundary of the feeding trough.
[0021] In one implementation, in S3, based on a preset strategy, determining the total feeding time of the chickens corresponding to each cage position within a preset time period includes:
[0022] According to a conversion method of converting a video image into a continuous image frame, determining the number of continuous image frames in each second;
[0023] According to the feeding status of the chickens in each cage in each image frame, the number of chickens eating in each image frame is calculated, and the number of chickens eating in all image frames is accumulated to obtain the total number of chickens eating;
[0024] According to the total number of chickens eating and the number of continuous image frames in each second, the total feeding time of the chickens in each cage position within the preset time period is calculated.
[0025] In one implementation, in S3, based on a preset strategy, determining the number of times the chickens eat food in each cage within a preset time period includes:
[0026] Initialize the number of times the chickens eat;
[0027] When the target detection model detects chickens in a non-continuous feeding state in the image frame, and the non-continuous interval period is not less than the reference time, the number of times the chickens feed is accumulated by 1.
[0028] In one implementation, the reference time is 3 seconds.
[0029] In one implementation, in S4, when selecting the fitting mathematical model, the method further includes:
[0030] Obtain a sample set of the total feeding time, feeding frequency and feeding amount of the chickens in each cage within a preset time period by manual collection;
[0031] The total feeding time and feeding times of the chickens were taken as independent variables, and the feeding amount was taken as the function to fit the data and determine the functional relationship between the three.
[0032] In a second aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to control the method for predicting feed intake of chickens per cage in the cage breeding mode described in the first aspect of the device where the processor is located.
[0033] Compared with the prior art, the method proposed in the technical solution of the present invention can more accurately obtain the feed intake of chickens in different cages. Applying this method in a chicken house can not only improve feed utilization and reduce waste, but also ensure that each cage of chickens obtains appropriate nutrition, thereby maintaining the overall health of the chickens. In addition, by early detection and intervention of the problem of unbalanced nutritional intake, the occurrence of diseases can be effectively prevented, and production efficiency and economic benefits can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of a flow chart of a method for predicting feed intake of chickens per cage in a cage-raising mode provided by an embodiment of the present invention;
[0035] Figure 2 A schematic diagram of cage position numbers and markings provided in an example of the present invention;
[0036] Figure 3 A flow chart for calculating feeding time and feeding frequency provided in one embodiment of the present invention;
[0037] Figure 4 This is the test result of the feed intake estimation model provided in one example of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.
[0039] In view of the defects and problems of the prior art, the present application provides a method for predicting the feed intake of chickens in cages under a cage-raising mode. The method, for example Figure 1 ,include:
[0040] S1, collecting video images of each cage position within a preset time period in the cage breeding mode;
[0041] Specifically, in the embodiment of the present invention, the chicken raising mode is a stacked cage raising mode, which fully utilizes the space of the breeding farm. The number of chickens raised in each cage is not limited.
[0042] In the embodiment of the present invention, the preset time period may be 1 hour, 2 hours, 1 day, etc. In the example, 1 hour may be taken as an example.
[0043] The acquisition speed of the video image is the first speed, which is not limited in the present invention, and can be, for example, 25 frames per second.
[0044] S2, converting the collected video images into continuous image frames, and inputting each image frame into a pre-trained target detection model to identify the feeding status of the chickens in each image frame of each cage, including the feeding status and the non-feeding status;
[0045] Specifically, the captured video images may be converted into continuous image frames at a first speed. Considering the recognition speed and computational overhead of the target detection model, the video images may be selectively converted into continuous image frames at a relatively slower second speed, which may be, for example, 12 frames per second.
[0046] Before S1, it also includes the step of training the target detection model;
[0047] The training target detection model comprises:
[0048] Collect sample images of each cage, annotate the heads of the chickens inside the feeding trough in the sample images, and construct a data set for identifying the heads of the chickens;
[0049] Divide the data set into training set, validation set and test set according to the preset ratio;
[0050] The target detection model is trained based on the dataset.
[0051] More specifically, the target detection model outputs a detection frame including the chicken's head in each image frame of each cage position, and the detection frame is labeled with the cage position number.
[0052] S3, according to the feeding status of the chickens in all continuous image frames corresponding to each cage position, based on a preset strategy, determining the total feeding time and the number of feeding times of the chickens corresponding to each cage position within a preset time period;
[0053] Specifically, based on the preset strategy, the total feeding time of the chickens in each cage position within the preset time period is determined, including:
[0054] According to a conversion method of converting a video image into a continuous image frame, determining the number of continuous image frames in each second;
[0055] According to the feeding status of the chickens in each cage in each image frame, the number of chickens eating in each image frame is calculated, and the number of chickens eating in all image frames is accumulated to obtain the total number of chickens eating;
[0056] According to the total number of chickens eating and the number of continuous image frames in each second, the total feeding time of the chickens in each cage position within the preset time period is calculated.
[0057] Furthermore, based on the preset strategy, the number of times the chickens eat food in each cage position within the preset time period is determined, including:
[0058] Initialize the number of times the chickens eat;
[0059] When the target detection model detects chickens in a non-continuous feeding state in the image frame, and the non-continuous interval period is not less than the reference time, the number of times the chickens feed is accumulated by 1.
[0060] In a more specific example, the reference time may be set to 3 seconds.
[0061] S4, the total feeding time and the number of feeding times of the chickens in each cage position within the preset time period are input into a pre-built fitting mathematical model or a machine learning model, and the feeding amount of each cage position corresponding to the preset time period is output.
[0062] The above method flow is described in the following more detailed examples in conjunction with more drawings of the present invention.
[0063] The video required for this example is recorded by two cameras, one of which shoots 3 cages of chickens and the other shoots 4 cages of chickens, with two chickens in each cage. The video format is mp4, the resolution is 1920 pixels × 1080 pixels, and the frame rate is 25 frames per second. In order to obtain the actual feed intake of the cage, plastic partitions are added between the feed troughs of different chicken cages. At 7 am every day, all the feed in the trough is manually cleaned, and then 100g of feed is placed in each cage. The weight of the remaining feed in the trough is measured every 1 hour, and the feed intake of the chickens in different cages within 1 hour is calculated respectively. When weighing, it is found that the amount of feed in a cage is less than 50g, and it is added back to 100g.
[0064] The collected video was extracted at a frame rate per second and stored as a jpg format image. After manually checking and deleting similar images, 2043 images were obtained. The images were labeled using Labelmg software, and only the heads of the chickens in the feeding trough were labeled. Figure 2 As shown, labeling needs to distinguish chickens in different cages, so the chicken head category is labeled according to the artificially specified cage number. For example, the head of the chicken in cage No. 1 will be labeled as "1". The data set is divided into training set, validation set and test set in a ratio of 8:1:1. In order to prevent the low generalization ability of the model and increase the diversity of the scene, the training set and validation set are enhanced by random rotation, flipping, changing brightness and Gaussian blur. The expanded training set and validation set contain 3268 and 408 images respectively, and the test set contains 204 images. This patent does not impose any restrictions on the target detection model for detecting chicken heads. This embodiment uses the improved YOLOv8n model. The mAP of this model on the test set 0.5 The parameter amount, floating-point operation amount and detection time are 1.94M, 4G and 3.6ms respectively, which meet the needs of real-time detection.
[0065] This embodiment converts the original 25 frames / second video into a 12 frames / second video. Figure 3 The calculation process for feeding time and feeding frequency in different cages. Convert the feeding video per hour into a continuous sequence of image frames. Use the model to detect the target in each frame and output the detection frame result containing the coordinates and cage category. In order to further improve the accuracy of chicken feeding behavior recognition, a threshold line of the feeding area is set in the feeding trough. When the center point of the chicken head detection frame is in the feeding area, it is determined that the feeding behavior is in progress. The specific steps are as follows: Use a While loop to traverse the detection results of each frame of the image. Use a For loop again to traverse the information of all detection frames in each frame. First, determine which detection frames have their center points located in the feeding area, and correspond these detection frames to the cage category counter F. inside Increase by 1. Next, check the current frame counter F totalThe frame counter L at the end of the last feeding frame Is the difference between the two greater than 36 frames (i.e., more than 3 seconds)? If so, it is considered that the next feeding behavior occurred in this cage, so the feeding count is increased by 1. Finally, the L of this cage is updated. frame is the current frame counter F total The feeding time of each cage position is calculated by accumulating F inside The total is calculated by dividing by 12 frames / second. The number of feedings is calculated by direct accumulation.
[0066] A week's worth of video and actual feed intake were used to establish a model for estimating feed intake. Each video was about 1 hour long, and the method proposed in this embodiment was used to obtain the number of times each cage was fed and the duration of feeding within 1 hour. At the same time, the actual feed intake of chickens in different cages within 1 hour was obtained by manual measurement. After eliminating unavailable data due to power outages in the chicken house and human operational errors, a total of 185 samples were obtained. These samples were divided into a training set and a test set in a ratio of 8:2.
[0067] This example uses the feeding frequency and feeding time as independent variables and adopts the multivariate linear regression analysis method to construct a mathematical model for estimating the feeding amount of cage positions. As can be seen from Table 1, at a confidence level of 95%, all coefficients in the model passed the significance test (P<0.05). The t values of the regression coefficients are all higher than the critical value t of the t test. 0.05,231 =1.970, indicating that the coefficients in the model are highly statistically significant, thus confirming the reliability of the model. The feed intake estimation model derived from the regression coefficients is:
[0068] FI=0.09738FF+0.012178FD
[0069] Among them, FI is the feed intake, g; FF is the number of feeding times, g; FD is the feeding time, s.
[0070]
[0071] Table 1
[0072] The performance of the feed intake estimation model on the training set and the test set is shown in Figure 4 As shown. Estimating the R of the model on the training set 2 The RSE and RMSE are 0.9 and 6.45g respectively, indicating that the model can fit the training data well. 2The RMSE and RMSE were 0.9 and 5.91g, respectively, indicating that the model has strong generalization ability. The above results show that the model has good fitting effect and prediction accuracy in estimating feed intake by cage position. The model can be used to estimate the feed intake of chickens in different cage positions in the recorded video, and can also estimate the feed intake by calculating the image detection results transmitted by the camera video stream in real time.
[0073] In the several embodiments provided by the present invention, it should be understood that the disclosed method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0074] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (Processor) to perform some steps of the above-mentioned method of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0075] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for predicting feed intake of chickens in cages under cage-raising mode, characterized in that: The method comprises: S1, collecting video images of each cage position within a preset time period in the cage breeding mode; S2, converting the collected video images into continuous image frames, and inputting each image frame into a pre-trained target detection model to identify the feeding status of the chickens in each image frame of each cage, including the feeding status and the non-feeding status; S3, according to the feeding status of the chickens in all continuous image frames corresponding to each cage position, based on a preset strategy, determining the total feeding time and the number of feeding times of the chickens corresponding to each cage position within a preset time period; S4, the total feeding time and the number of feeding times of the chickens in each cage position within the preset time period are input into a pre-built fitting mathematical model or a machine learning model, and the feeding amount of each cage position corresponding to the preset time period is output.
2. The method for predicting feed intake of chickens in cages under cage-raising mode according to claim 1, characterized in that: The method, before S1, further includes the step of training a target detection model; The training target detection model comprises: Collect sample images of each cage, annotate the heads of the chickens inside the feeding trough in the sample images, and construct a data set for identifying the heads of the chickens; Divide the data set into training set, validation set and test set according to the preset ratio; The target detection model is trained based on the dataset.
3. The method for predicting feed intake of chickens in cages under cage-raising mode according to claim 2, characterized in that: The target detection model outputs a detection frame including the chicken's head in each image frame of each cage position, and the detection frame is marked with the cage position number.
4. The method for predicting feed intake of chickens in cages under the cage-raising mode according to claim 3, characterized in that: In S2, the feeding state and the non-feeding state are determined by: A threshold line covering the feeding trough area is set in each image frame of each cage position; The feeding state of the chicken is determined according to the relative relationship between the central coordinates of the detection frame of the chicken's head in each image frame identified by the target detection model and the threshold line. When the central coordinates of the detection frame are within the threshold line, the feeding state of the chicken is determined to be the feeding state. When the central coordinates of the detection frame are outside the threshold line, the feeding state of the chicken is determined to be the non-feeding state.
5. The method for predicting feed intake of chickens in cages under cage-raising mode according to claim 4, characterized in that: The threshold line includes at least the upper boundary and the lower boundary of the feeding trough.
6. The method for predicting feed intake of chickens in cages under cage-raising mode according to claim 4, characterized in that: In S3, based on the preset strategy, the total feeding time of the chickens corresponding to each cage position within the preset time period is determined, including: According to a conversion method of converting a video image into a continuous image frame, determining the number of continuous image frames in each second; According to the feeding status of the chickens in each cage in each image frame, the number of chickens eating in each image frame is calculated, and the number of chickens eating in all image frames is accumulated to obtain the total number of chickens eating; According to the total number of chickens eating and the number of continuous image frames in each second, the total feeding time of the chickens in each cage position within the preset time period is calculated.
7. The method for predicting feed intake of chickens in cages under cage-raising mode according to claim 6, characterized in that: In S3, based on the preset strategy, the number of times the chickens feed in each cage position within the preset time period is determined, including: Initialize the number of times the chickens eat; When the target detection model detects chickens in a non-continuous feeding state in the image frame, and the non-continuous interval period is not less than the reference time, the number of times the chickens feed is accumulated by 1.
8. The method for predicting feed intake of chickens in cages under the cage-raising mode according to claim 7, characterized in that: The reference time is 3s.
9. The method for predicting feed intake of chickens in cages under cage-raising mode according to claim 1, characterized in that: In S4, when the fitting mathematical model is selected, the method further includes: Obtain a sample set of the total feeding time, feeding frequency and feeding amount of the chickens in each cage within a preset time period by manual collection; The total feeding time and feeding times of the chickens were taken as independent variables, and the feeding amount was taken as the function to fit the data and determine the functional relationship between the three.
10. A computer-readable storage medium, characterized in that: A computer program is stored, and the computer program is executed by a processor to control the device where the processor is located to implement the method for predicting the feed intake of chickens in cages under the cage breeding mode according to any one of claims 1 to 9.
Citation Information
Patent Citations
Pig ingestion monitoring method and device
CN112931289A
YOLOv5-based cattle individual ingestion behavior tracking method
CN116597490A
Method, device and equipment for detecting ingestion frequency of caged poultry and medium
CN118411735A
Augmenting detected regions in image or video data
US20190222776A1