A method and device for estimating residual material in a feed trough of a stacked cage laying hen house

Through automated and intelligent residual feed data collection system and feed trough residual feed prediction model, the problems of low feed management efficiency and waste in traditional feeding methods are solved, precise feed management and environmental optimization are achieved, and the production performance and breeding benefits of laying hens are improved.

CN119228898BActive Publication Date: 2025-04-01ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411777035.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-01
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

The traditional laying hen feeding method has problems such as low manual management efficiency, large feed waste, high health risks and difficulty in environmental control. Especially in the cascading cage mode, it is difficult to achieve accurate feed management and residual feed monitoring.

Method used

Using automated and intelligent residual feed data acquisition system and feed trough residual feed prediction model, through video acquisition and deep learning technology, the feed residual amount in the chicken coop trough is monitored and estimated in real time, achieving accurate feed management and reducing waste.

Benefits of technology

It improves the efficiency and accuracy of feed management, reduces feed waste, optimizes the feeding environment of chickens, and improves the production performance and breeding economic benefits of laying hens.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119228898B_ABST
    Figure CN119228898B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for estimating residual feed in a stacked cage laying hen house. The method comprises building a residual feed data collection system, collecting videos of chicken cage troughs at different heights in a stacked cage laying hen house through the residual feed data collection system; constructing a trough residual feed prediction model, training the trough residual feed prediction model using each frame of the chicken cage trough picture, and obtaining a trained trough residual feed prediction model after the training; inputting the chicken cage trough video into the trained trough residual feed prediction model to obtain the position of each cage column and the residual feed area position; obtaining the residual feed ratio of each trough in the trough picture of the chicken cage according to the cage column position and the residual feed area position output by the trough residual feed prediction model. The present invention realizes accurate estimation of the residual feed amount in the trough of the laying hen house through an automated residual feed data collection system and a deep learning model. The device greatly improves the accuracy and efficiency of feed management and reduces human errors and labor intensity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of poultry breeding, and in particular relates to a method and a device for estimating residual material in a feed trough of a stacked cage laying hen house. Background Art

[0002] With the rapid development of the poultry farming industry, the scale of laying hens is constantly expanding, and the traditional artificial breeding method can no longer meet the high efficiency and refined management needs of the modern breeding industry. The stacked cage model has developed rapidly in China and has become the mainstream of laying hen farming due to its advantages of high production efficiency, high space utilization, and stable egg supply. In the process of laying hen breeding, feed management is a key link to ensure the healthy growth and high egg production rate of chickens. However, there are many shortcomings in the traditional feed delivery and management methods: First, the efficiency of manual management is low: it relies on manual regular inspection and feed addition, which is time-consuming and labor-intensive, and it is difficult to achieve precise control. Second, the problem of feed waste: due to the lack of accurate feed delivery and residual feed monitoring, it often leads to excess or insufficient feed, resulting in waste of resources. Third, health risks: unbalanced feed quantity may cause malnutrition or overeating of chickens, affecting the health and production performance of chickens. Fourth, environmental control is difficult: residual feed is easy to rot, affecting the hygiene of the chicken house and increasing the risk of disease transmission. Summary of the invention

[0003] In order to solve the problems existing in the background technology, the purpose of the present invention is to provide a method and device for estimating the remaining feed in the feed trough of a stacked cage laying hen house. The method and device can realize accurate estimation of the remaining feed in the feed trough of the laying hen house. Through automation and intelligent technology, the present invention can improve the efficiency and accuracy of feed management, reduce feed waste, and optimize the chicken breeding environment, thereby improving the production performance of laying hens and the economic benefits of breeding.

[0004] The technical solution adopted by the present invention is as follows, comprising the following steps:

[0005] Step S1, building a residual material data collection system, and collecting videos of chicken cage feed troughs at different heights in a stacked cage chicken house through the residual material data collection system;

[0006] Step S2, constructing a feed trough residual material prediction model for identifying cage columns, feed troughs and residual materials in the feed troughs, training the feed trough residual material prediction model using the chicken cage feed trough video, and obtaining a trained feed trough residual material prediction model after the training is completed;

[0007] Step S3, inputting the chicken cage trough video with the remaining feed ratio to be predicted into the trained trough remaining feed prediction model, and obtaining the position of each cage column, the trough area position and the remaining feed area position in the chicken cage trough video;

[0008] Step S4, according to the cage column position, trough area position and residual material area position output by the trough residual material prediction model, obtain the residual material ratio of each trough in the chicken cage trough video.

[0009] The step S1 is specifically as follows:

[0010] Step S1.1, firstly, a leftover feed data collection system is built in a stacked cage chicken house, wherein the leftover feed data collection system mainly consists of a mobile chassis, an adjustable camera bracket and a camera, wherein the mobile chassis can be horizontally movably placed on the ground, the adjustable camera bracket is vertically installed on the mobile chassis, and the camera can be vertically installed on the adjustable camera bracket;

[0011] Step S1.2, adjusting the angle and position of the camera in real time through the residual feed data acquisition system, and using the camera to obtain real-time videos of chicken cage feed troughs at different heights in the stacked cage chicken house.

[0012] The step S2 is specifically as follows:

[0013] Step S2.1, preprocessing the chicken cage trough video: first, perform image denoising, image contrast adjustment and image size standardization on each frame of the chicken cage trough picture in the chicken cage trough video, and use the picture annotation tool to use the cage column detection frame to mark the cage columns outside the chicken cage to obtain the position information of the cage columns, and then use the picture annotation tool to annotate the chicken cage trough picture to mark the trough area and the leftover feed area in the chicken cage trough picture;

[0014] Step S2.2, then constructing each frame of the chicken cage trough picture and the corresponding label information into a chicken cage trough residual material data set, wherein the label information includes the cage column position information, trough area information and residual material area information in the chicken cage trough picture;

[0015] Step S2.3, construct a feed trough residual feed prediction model for identifying cage columns, feed troughs and residual feed areas, use the chicken cage feed trough residual feed data set to train the feed trough residual feed prediction model, and obtain the trained feed trough residual feed prediction model after the training is completed.

[0016] The step S4 is specifically as follows:

[0017] Step S4.1, first, according to the input results of each frame of the chicken cage trough image in the chicken cage trough video, the target cage column in the chicken cage trough video is screened out; the input results of each frame of the chicken cage trough image include the cage column position, trough area position and residual material area position output in step S3;

[0018] Step S4.2, then, number the chicken cages in the chicken cage trough video according to the position of the target cage column, and select the target chicken cage from each frame of the chicken cage trough image;

[0019] Step S4.3, finally, a region of interest is divided in the target chicken cage according to the position of the target cage column, and the residual feed ratio of each chicken cage feed trough is obtained according to the region of interest.

[0020] The step S4.1 is specifically as follows:

[0021] Step S4.1.1: First, according to the cage column position output in step S3, the center point P of each cage column in the chicken cage feed trough image is obtained according to the following formula: j Coordinates:

[0022] PX j = x j +w j / 2;PY j = y j +h j / 2

[0023] Among them, PX j and PY j are the center point P of the jth cage column in the chicken cage trough image. j The horizontal and vertical coordinates of x j and j are the horizontal and vertical coordinates of the top left corner vertex of the cage column detection frame corresponding to the jth cage column; w j and h j are the width and height of the cage column detection frame corresponding to the jth cage column, respectively, and j represents the ordinal number of the cage column;

[0024] Step S4.1.2: Next, the rationality of the cage column position is judged according to the horizontal coordinate distance between the center points of two adjacent cage columns, and a target cage column with a reasonable position is obtained. The specific method for obtaining the target cage column is:

[0025] Step S4.1.2.1, first, the first cage column in the chicken cage feed trough image is used as the first target cage column;

[0026] Step S4.1.2.2, then, the custom screening times Z is 2;

[0027] Step S4.1.2.3: Judge the rationality of the current Zth cage column position:

[0028] If the horizontal coordinate distance between the current cage column center point and the previous target cage column center point is greater than the distance threshold X limit , it indicates that the current Zth cage column is the target cage column, and the screening times Z is increased by 1;

[0029] Otherwise, it indicates that the current Zth cage column is not the target cage column, and the screening times Z is increased by 1;

[0030] Step S4.1.2.4: Repeat step S4.1.2.3 until the positions of all cage columns are determined.

[0031] The step S4.2 is specifically as follows:

[0032] Step S4.2.1, number each chicken cage in the chicken cage trough video: In the chicken cage trough video, number each target cage column from small to large in the order of the time axis, and then use the rectangular area between the i-th target cage column and the i+1-th target cage column in the chicken cage trough video as the i-th chicken cage CA of the chicken cage trough video. i , where the height of the chicken cage is a given constant, and i represents the ordinal number of the target cage column / chicken cage;

[0033] Step S4.2.2, select the target chicken cages to be calculated for the remaining feed from each frame of the chicken cage feed trough image:

[0034] For any frame of chicken cage feeder image, if the chicken cage CA i If the horizontal coordinate of the center point is greater than Wp / 3 and less than 2Wp / 3, then the chicken cage CA in the chicken cage trough image of this frame i is the target chicken cage, where Wp represents the width of the chicken cage feed trough image;

[0035] Otherwise, the chicken cage CA in the chicken cage trough image of this frame i Not a target chicken coop.

[0036] The step S4.3 is specifically as follows:

[0037] Step S4.3.1, determine the corner points of the region of interest ROI to be divided according to the position of the target cage column, the region of interest ROI includes a rectangular upper region of interest UROI and a rectangular lower region of interest LROI, the four corner points of the upper region of interest and their coordinates are respectively the upper corner point -Urec1(X i ,Y i )、Urec2(X i+1 ,Y i )、Urec3(X i ,3Hp / 5) and the upper corner point Urec4(X i+1 ,3Hp / 5), the four corner points and corner point coordinates of the lower layer area of ​​interest are respectively the lower layer corner point -Lrec1(X i ,3Hp / 5), lower corner point 2 Lrec2(X i+1 ,3Hp / 5), lower corner point three Lrec3(X i ,Hp) and the lower corner point Lrec4(X i+1 ,Hp);

[0038] Among them, Xi and Y i are the horizontal and vertical coordinates of the center point of the i-th target cage column in the chicken cage trough image; i+1 is the horizontal coordinate of the center point of the i+1th target cage column; Hp represents the height of the chicken cage trough image;

[0039] Step S4.3.2, according to the coordinates of the corner points of the upper region of interest and the lower region of interest, the target chicken cage of each frame of the chicken cage trough image is divided into an upper region of interest and a lower region of interest, wherein the target chicken cage area of ​​each frame of the chicken cage trough image includes two layers of troughs, and the upper trough and the lower trough are respectively located in the upper region of interest and the lower region of interest;

[0040] Step S4.3.3, in the chicken cage feed trough image, segment the leftover feed area in the target chicken cage area and obtain a binary image of the leftover feed area;

[0041] Step S4.3.4, the residual material ratio of the upper trough and the lower trough of each target chicken cage in each frame of the chicken cage trough image is obtained according to the following formula:

[0042] PrecisionU=MaskU / ((X i+1 -X i )(Uyu-Uy l ))

[0043] PrecisionL=MaskL / ((X i+1 -X i )(Lyu-Ly l ))

[0044] Among them, PrecisionU is the proportion of residual feed in the upper trough in the upper area of ​​interest of the target chicken cage; PrecisionL is the proportion of residual feed in the lower trough in the lower area of ​​interest of the target chicken cage; MaskU represents the number of white pixels in the binary image of the residual feed area of ​​the upper trough; MaskL represents the number of white pixels in the binary image of the residual feed area of ​​the lower trough; Uyu represents the ordinate of the upper boundary line of the upper trough; Uy l represents the ordinate of the lower boundary line of the upper trough; Lyu represents the ordinate of the upper boundary line of the lower trough; Ly l Indicates the ordinate of the lower boundary line of the lower trough;

[0045] Step S4.3.5: For the same target chicken cage with the same number in all chicken cage trough images, average the remaining feed ratios of all upper troughs corresponding to the same target chicken cage to obtain the i-th chicken cage CA in the chicken cage trough video. iThe final upper trough residual feed ratio is averaged for all lower trough residual feed ratios corresponding to the same target chicken cage to obtain the CA of the i-th chicken cage in the cage trough video. i The final residual material ratio in the lower trough.

[0046] The device of the present invention comprises a residual material data acquisition system, a trough residual material prediction model and a residual material quantity measuring system; the residual material data acquisition system comprises a mobile chassis, an adjustable camera bracket and a camera, the mobile chassis can be placed on the ground in a horizontally movable manner, the adjustable camera bracket is vertically installed on the mobile chassis, the camera can be installed on the adjustable camera bracket in an upward and downward manner, the mobile chassis and the adjustable camera bracket are used to adjust the position and angle of the camera, the camera is used to collect chicken cage trough videos of different heights in a stacked cage chicken house in real time, and the chicken cage trough videos are input into a trained trough residual material prediction model, the trough residual material prediction model outputs the cage column position, the trough position and the residual material area position of various frames of chicken cage trough images in the chicken cage trough video; the residual material quantity measuring system obtains the residual material ratio of each trough in each frame of the chicken cage trough image according to the cage column position, the trough position and the residual material area position output by the trough residual material prediction model.

[0047] The present invention aims to optimize feed management through automation technology, improve breeding efficiency and economic benefits. The device is specially designed with a residual feed data acquisition system, equipped with a high-definition camera and an adjustable bracket to adapt to feed troughs of different heights and realize comprehensive data acquisition. By accurately measuring the chicken house environment and designing corresponding brackets, the quality of image acquisition and the accuracy of data are ensured. The core of the feed trough residual feed prediction model lies in model training and post-processing, in which a deep learning framework and a Yolov8n-seg model are used to train the collected image data, and accurate recognition and segmentation of the chicken cage edge and residual feed area are achieved. In addition, through object tracking algorithms and continuous frame processing, the system can maintain stable tracking of cage columns and residual feed, ensuring the continuity and accuracy of cage processing and residual feed estimation. The present invention can monitor the residual feed situation in real time in an actual laying hen house, adjust the delivery strategy, and provide data analysis reports to assist breeders in making scientific breeding decisions. The implementation of the present invention not only reduces feed waste, but also improves the chicken breeding environment, which helps to promote the sustainable development of the breeding industry.

[0048] The beneficial effects of the present invention are:

[0049] 1. Improve the accuracy and efficiency of feed management: The present invention uses an automated residual feed data collection system and a deep learning model to accurately estimate the amount of residual feed in the trough of the laying hen house. Compared with traditional manual inspection, the system greatly improves the accuracy and efficiency of feed management, reduces human errors and labor intensity. Automated monitoring and data analysis reduce the reliance on a large number of human resources, while ensuring the timeliness and appropriateness of feed delivery.

[0050] 2. Optimize the chicken breeding environment: By real-time monitoring of feed delivery and surplus, the present invention can effectively avoid the problem of excess or insufficient feed, reduce feed waste, and prevent the sanitation of the chicken house from being affected by feed corruption, thereby optimizing the chicken breeding environment. This not only helps to improve the health level and production performance of laying hens, but also reduces the risk of disease transmission and improves the overall sustainability of the breeding industry.

[0051] 3. Intelligent decision support: The system of the present invention is not limited to real-time monitoring and data reporting, but also provides intelligent decision support. The system can automatically remind the breeder according to the remaining feed amount to achieve refined feeding management. This intelligent decision support mechanism makes breeding management more scientific and flexible, can adapt to the nutritional needs of laying hens at different growth stages, and further improve breeding efficiency and economic benefits. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 This is a schematic diagram of the data acquisition platform system of the present invention;

[0053] Figure 2 It is a schematic diagram of the light source measurement points and lighting environment;

[0054] Figure 3 is the model training result map, where A is the bounding box loss map of the training set, B is the segmentation loss map of the training set, C is the classification loss map of the training set, D is the depth loss map of the training set, E is the bounding box loss map of the test set, F is the segmentation loss map of the test set, G is the classification loss map of the test set, H is the depth loss map of the test set, I is the precision map of the bounding box, J is the recall map of the bounding box, K is the average precision map of the bounding box (threshold is 0.5), L is the average precision map of the bounding box (threshold is 0.5-0.95), M is the precision map of the mask, N is the recall map of the mask, O is the average precision map of the mask (threshold is 0.5), and P is the average precision map of the mask (threshold is 0.5-0.95);

[0055] Figure 4 This is a process flow chart for the system's chicken cage segmentation and leftover material identification;

[0056] Figure 5 This is a processing flow chart for residual material recognition of a single frame image. DETAILED DESCRIPTION

[0057] The present invention is described in detail below in conjunction with specific implementation cases. The following implementation cases will help those skilled in the art to further understand the present invention, but will not limit the present invention in any form.

[0058] like Figure 4 As shown, the embodiment of the present invention includes the following steps:

[0059] Step S1, building a residual material data collection system, and collecting videos of chicken cage feed troughs at different heights in a stacked cage chicken house through the residual material data collection system;

[0060] Step S2, constructing a trough residual material prediction model for identifying cage columns, troughs and residual material in the troughs, training the trough residual material prediction model using the chicken cage trough video, and obtaining a trained trough residual material prediction model after the training is completed;

[0061] Step S3, inputting the chicken cage trough video with the remaining feed ratio to be predicted into the trained trough remaining feed prediction model, obtaining the position of each cage column, the trough area position and the remaining feed area position in each frame of the chicken cage trough image of the chicken cage trough video, and each frame of the chicken cage trough image contains two layers of troughs and two layers of trough cage columns;

[0062] Step S4, the residual feed amount measurement system obtains the residual feed ratio of each trough in the chicken cage trough video according to the cage column position, trough area position and residual feed area position output by the trough residual feed prediction model.

[0063] Application of the estimation system: The trained prediction model is deployed to the actual feeding trough monitoring system of the laying hen house. The system can monitor the feed delivery and surplus in real time, automatically adjust the feed delivery strategy, and ensure that the laying hens get the appropriate nutritional supply. At the same time, the system can also provide data analysis reports to farmers to assist them in making more scientific breeding decisions.

[0064] Model deployment: The trained model is deployed to the inspection system of the actual laying hen house, which includes a high-definition camera, a data processing unit, a control unit and a user interface; Real-time monitoring: The system captures the image of the feed trough in real time through a high-definition camera, analyzes the image using the deployed model, and monitors the feed delivery and remaining situation in real time; Data analysis report: The system generates a data analysis report, including the feed consumption trend, residual feed prediction and nutrient intake assessment of each chicken cage, etc., to provide a scientific basis for decision-making for farmers; User interface interaction: Through the user interface, farmers can view feed monitoring data and analysis reports in real time, make manual adjustments or confirm the adjustment suggestions of the system; Intelligent decision support: The system provides intelligent decision support, such as automatically reminding farmers when the remaining feed is lower than the preset threshold, or automatically adjusting the feed formula under specific conditions; System performance: The deployed model and system design take into account the compatibility with existing breeding equipment to ensure seamless integration into laying hen houses of various sizes. The system design has good scalability and can flexibly add monitoring points or adjust the system configuration according to the expansion or change of the breeding scale. The system takes into account the changes in lighting conditions under different breeding environments, and ensures stable operation under various environmental conditions through algorithm optimization.

[0065] Step S1 is specifically as follows:

[0066] Step S1.1, firstly, a leftover feed data collection system is built in a stacked cage chicken house, the leftover feed data collection system mainly consists of a mobile chassis, an adjustable camera bracket and a camera, the mobile chassis can be horizontally movably placed on the ground, the adjustable camera bracket is vertically installed on the mobile chassis, and the camera is installed on the adjustable camera bracket so as to be movable up and down;

[0067] Step S1.2, adjusting the angle and position of the camera in real time through the residual feed data acquisition system, and using the camera to obtain real-time videos of chicken cage feed troughs at different heights in the stacked cage chicken house.

[0068] In the specific implementation, the residual material data collection system is as follows: Figure 1 As shown, the residual material data acquisition system is mainly composed of a mobile chassis, a plurality of adjustable camera brackets and cameras to adapt to the different heights of the feed troughs in the stacked cage chicken house, ensuring flexibility and adaptability. By using measuring tools such as a tape measure, key data such as the gap between the chicken house passages, the installation position of the electric lights, the distance between the layers of the chicken cages, and the height of the chicken cages can be accurately obtained. One camera adjustable bracket has a height exceeding the second-layer chicken cage so as to collect the residual material data of the first and second-layer feed troughs. Another camera adjustable bracket can raise the camera to a height exceeding the fourth-layer chicken cage through motor control to realize the collection of residual material data of the third and fourth-layer feed troughs. Through this design, the residual material data acquisition system of the present invention can cover all levels of feed troughs, providing a comprehensive and efficient solution for residual material estimation.

[0069] The camera is installed as follows: First, manually adjust the camera's adjustable bracket to the appropriate height according to the height of the chicken coop to accommodate the troughs at different levels. Install the high-precision camera on the camera's adjustable bracket and connect it to the control computer using a data cable to ensure the stability and real-time data transmission. Use the camera's preview function to carefully adjust the camera's installation angle and height. During the camera angle and height adjustment process, ensure that the trough in the picture remains horizontal and parallel to the long axis of the picture to improve the accuracy and efficiency of image processing. The camera's adjustable bracket can adjust the camera to the appropriate angle and height to ensure the stability and real-time performance of image acquisition.

[0070] At the same time, a light meter is used to measure the light intensity in the chicken house, and an auxiliary light source is designed to ensure the stability and consistency of the image acquisition environment. A light meter is used to measure the light intensity at different sampling points in the chicken house, including the area directly below the high and low lights and between the two lights, such as Figure 2As shown. For areas with insufficient light intensity, design and match appropriate auxiliary light sources to ensure the stability and consistency of the image acquisition environment. According to the results of the illuminance meter measurement, select a suitable fill light intensity between the highest and lowest values ​​of the light intensity to ensure that the camera can obtain clear images under various lighting conditions. After determining the fill light intensity, install the auxiliary light source on the mobile chassis and ensure that the camera and the auxiliary light source work together to obtain the best image acquisition effect. Even in the trough area with insufficient light, the quality and stability of image acquisition can be guaranteed.

[0071] When collecting trough image data, operate the residual material data collection system to move parallel to the trough at the specified distance to ensure that the coverage and angle of video collection meet the requirements. Before collecting the video, debug the camera. After initializing the camera, adjust the camera resolution aspect ratio to 1920×1080 and the frame rate to 60FPS to ensure the clarity and smoothness of the video. To meet different storage and processing requirements, set the video encoding format to MP4V for subsequent video writing and processing. After completing the camera settings, start collecting trough residual material videos to ensure stability and continuity during the collection process. After collecting the video, use the open source computer vision library OpenCV to open the video file and read the image data frame by frame from the video file. From the continuous video frames, extract and save the current frame every 60 frames as the image sample of the trough residual material, providing high-quality trough image data for subsequent data analysis and model training.

[0072] Using the data collected in step S1, a high-precision data model is trained. The data model can analyze the relationship between feeding behavior and feed consumption and accurately estimate the amount of remaining feed in the trough. Through machine learning algorithms, the model will be continuously optimized to improve the accuracy of the estimation.

[0073] Step S2 is specifically as follows:

[0074] Step S2.1, preprocessing the chicken cage trough video: first, perform image denoising, image contrast adjustment and image size standardization on each frame of the chicken cage trough picture in the chicken cage trough video collected in step S1, so that the chicken cage trough picture is set to a preset contrast and a preset size to improve the image quality, and use the rectangular annotation tool in the picture annotation tool (labelme) to use the cage column detection frame to mark the cage columns outside the chicken cage to obtain the position information of the cage columns and the trough position information, and then use the polygon annotation tool in the picture annotation tool (labelme) to annotate the chicken cage trough picture to segment the trough area and the residual material area in the chicken cage trough picture;

[0075] Step S2.2, then construct each frame of the chicken cage trough picture and the corresponding label information into a chicken cage trough residual material data set, the label information includes the cage column position information, the trough area information and the residual material area information in the chicken cage trough picture, wherein the rectangular cage column detection frame is used to mark the cage column position, the cage column detection frame is set on the periphery of the cage column, and the cage column position information specifically refers to the position information of the cage column detection frame;

[0076] Step S2.3, construct a feed trough residual feed prediction model for identifying cage columns, feed troughs and residual feed areas, use the chicken cage feed trough residual feed data set to train the feed trough residual feed prediction model, and obtain the trained feed trough residual feed prediction model after the training is completed.

[0077] In step S2.3, the feed trough residual feed prediction model includes a recognition module and a segmentation model connected in sequence. In the recognition module, the deep learning framework PyTorch is used to recognize the chicken cage feed trough picture. In the segmentation model, the convolutional neural network structure Yolov8n-seg is used to segment the chicken cage feed trough picture. During the model training process, the deep learning framework PyTorch and the convolutional neural network structure Yolov8n-seg model are used for training, and the model weights are updated through forward propagation and back propagation to optimize the model performance.

[0078] In the specific implementation: First, the collected chicken cage trough leftover data set is split into training set, validation set and test set in a ratio of 8:1:1 to ensure the effectiveness and generalization ability of model training. In the data set, the feed in the cage column and the leftover area is clearly defined as two different categories, and the cage column and feed are represented by type 1 class0 and type 2 class1 respectively to support the recognition and segmentation functions of the model. The deep learning framework PyTorch is selected, and the convolutional neural network structure Yolov8n-seg is used as the basic framework to build a trough leftover prediction model. Configure the training environment of the model and install necessary dependent libraries, such as cross-platform computer vision OpenCV, numerical calculation extension library Numpy, drawing library matplotlib, etc., to support model training and verification. Initialize the model parameters, calculate the predicted output through forward propagation, use the loss function to evaluate the difference between the prediction and the true label, and update the model weight through back propagation. After each training cycle, evaluate the performance of the model on the validation set, implement early stopping strategy or save model checkpoints, and adjust the learning rate and hyperparameters according to performance feedback. After the training cycle is completed, use the test set to evaluate the generalization ability of the model and make necessary fine-tuning. To ensure the performance of the model in practical applications, closely monitor the model training process to avoid overfitting or underfitting, and flexibly adjust the training strategy based on training feedback.

[0079] Then evaluate the model training results, including loss assessment, precision and recall analysis, and mean average precision (mAP) curve drawing, to ensure that the model reaches the expected accuracy level. Figure 3 As shown, the accuracy evaluation method of the model is as follows: 1) Training and validation loss evaluation: During the model training process, key indicators such as bounding box loss box_loss, segmentation loss seg_loss, classification loss cls_loss, and depth loss dfl_loss of the training set train and the test set are recorded. Figure 3 A is the bounding box loss map of the training set, Figure 3 B is the segmentation loss map of the training set, Figure 3 C is the classification loss graph of the training set, Figure 3 D is the depth loss map of the training set, Figure 3 E is the bounding box loss map of the test set, Figure 3 F is the segmentation loss graph of the test set, Figure 3 G is the classification loss graph of the test set, Figure 3 H is the depth loss graph of the test set; 2) Precision and recall analysis: evaluate the precision and recall of the bounding box and mask of the model on the training set and test set to measure the recognition accuracy and completeness of the model. 3) Average precision mAP curve drawing: draw the mAP50 (average precision value, threshold IoU is 0.5) and mAP50-95 (average precision mean, threshold IoU range is 0.5 to 0.95) curves of the model on the training set and validation set to comprehensively evaluate the performance of the model under different threshold IoU. Among them, Figure 3 I is the precision map of the bounding box, Figure 3 J is the recall map of the bounding box, Figure 3 K is the average precision of the bounding box (threshold is 0.5), Figure 3 L is the average precision of the bounding box (threshold is 0.5-0.95) Figure 3 M is the accuracy graph of the mask, Figure 3 N is the recall rate map of the mask, Figure 3 O is the average precision of the mask (threshold is 0.5). Figure 3 P is the average precision of the mask (threshold is 0.5-0.95) Figure 1. Preliminary performance evaluation: Through comprehensive analysis of the above indicators, the recognition performance of the model is preliminarily evaluated to ensure that the model achieves the expected accuracy level in the tasks of chicken house cage sorting and leftover feed segmentation.

[0080] like Figure 5 As shown, step S4 is specifically as follows:

[0081] Step S4.1, first, according to the input results of each frame of the chicken cage trough image in the chicken cage trough video, the target cage column in each frame of the chicken cage trough image is screened out; the input results of each frame of the chicken cage trough image include the cage column position, trough area position and residual material area position output in step S3;

[0082] Step S4.2, then, number the chicken cages in the chicken cage trough image according to the position of the target cage column, and select the target chicken cage from each frame of the chicken cage trough image;

[0083] Step S4.3, finally, a region of interest is divided in the target chicken cage according to the position of the target cage column, and the residual feed ratio of each chicken cage feed trough is obtained according to the region of interest.

[0084] Step S4.1 is specifically as follows:

[0085] Step S4.1.1: First, according to the cage column position output in step S3, the center point P of each cage column in the chicken cage feed trough image is obtained according to the following formula: j Coordinates:

[0086] PX j = x j +w j / 2;PY j = y j +h j / 2

[0087] Among them, PX j and PY j They are the center points P of the jth cage column from left to right in the image of the chicken cage trough. j The horizontal and vertical coordinates of x j and j are the horizontal and vertical coordinates of the top left corner vertex of the cage column detection frame corresponding to the jth cage column in the chicken cage trough image; w j and h j are the width and height of the cage column detection frame corresponding to the jth cage column, respectively. Specifically, the method of the present invention takes the upper left corner of the chicken cage trough image as the origin to establish an XY coordinate system, and the horizontal and vertical coordinates of the coordinate system are parallel to the width direction and height direction of the chicken cage trough image, respectively, and the positive direction of the horizontal coordinate is to the right, and the positive direction of the vertical coordinate is downward;

[0088] Step S4.1.2: Next, the rationality of the cage column position is judged according to the horizontal coordinate distance between the center points of two adjacent cage columns, and a target cage column with a reasonable position is obtained. The specific method for obtaining the target cage column is:

[0089] Step S4.1.2.1, first, the first cage column in the chicken cage feed trough image is used as the first target cage column;

[0090] Step S4.1.2.2, then, the custom screening times Z is 2;

[0091] Step S4.1.2.3: Judge the rationality of the current Zth cage column position:

[0092] If the horizontal coordinate distance between the center point of the current cage column and the center point of the previous target cage column adjacent to the cage column is greater than the given distance threshold X limit , it indicates that the current Zth cage column is the target cage column, and the screening times Z is increased by 1;

[0093] Otherwise, it indicates that the current Zth cage column is not the target cage column, and the screening times Z is increased by 1;

[0094] Step S4.1.2.4: Repeat step S4.1.2.3 until the position of all cage columns in the chicken cage trough image is determined.

[0095] The rationality of the cage column position is judged to exclude the cage columns with duplicate numbers in order to obtain the actual cage column position.

[0096] Step S4.2.1, number each chicken cage in the chicken cage trough video: In the chicken cage trough video, number each target cage column from small to large in the order of the time axis, and then use the rectangular area between the i-th target cage column and the i+1-th target cage column in the chicken cage trough video as the i-th chicken cage CA of the chicken cage trough video. i , where the height of the chicken cage is a given constant, and i represents the ordinal number of the target cage column / chicken cage;

[0097] Step S4.2.2, select the target chicken cages to be calculated for the remaining feed from each frame of the chicken cage feed trough image:

[0098] For any frame of chicken cage feeder image, if the chicken cage CA i If the horizontal coordinate of the center point is greater than Wp / 3 and less than 2Wp / 3, then the chicken cage CA in the chicken cage trough image of this frame i The target chicken cage is the chicken cage CA in the chicken cage trough image. i Calculation of the residual feed ratio, where Wp represents the width of the chicken cage feed trough image;

[0099] Otherwise, the chicken cage CA in the chicken cage trough image of this frame i It is not the target chicken cage, and CA of this chicken cage is not performed in the chicken cage trough image of this frame. i Calculation of the residual material ratio.

[0100] Step S4.3 is specifically as follows:

[0101] Step S4.3.1, determine the corner points of the region of interest ROI to be divided according to the position of the target cage column, the region of interest ROI includes a rectangular upper region of interest UROI and a rectangular lower region of interest LROI, the four corner points and the corner point coordinates of the upper region of interest are respectively the upper corner point -Urec1(X i ,Y i )、Urec2(X i+1 ,Y i )、Urec3(X i ,3Hp / 5) and the upper corner point Urec4(X i+1 ,3Hp / 5), the four corner points and corner point coordinates of the lower layer area of ​​interest are respectively the lower layer corner point -Lrec1(X i ,3Hp / 5), lower corner point 2 Lrec2(X i+1 ,3Hp / 5), lower corner point three Lrec3(X i ,Hp) and the lower corner point Lrec4(X i+1 ,Hp);

[0102] Among them, X i and Y i are the horizontal and vertical coordinates of the center point of the i-th target cage column from left to right in the chicken cage trough image; i+1 is the horizontal coordinate of the center point of the i+1th target cage column; Hp represents the height of the chicken cage trough image;

[0103] Step S4.3.2, according to the coordinates of the corner points of the upper region of interest and the lower region of interest, the target chicken cage of each frame of the chicken cage trough image is divided into an upper region of interest and a lower region of interest, respectively, and the target chicken cage area of ​​each frame of the chicken cage trough image includes two layers of troughs, and the upper trough and the lower trough are respectively located in the upper region of interest and the lower region of interest;

[0104] Step S4.3.3, mask binarization: In the chicken cage feed trough image, perform segmentation masking on the leftover feed area in the target chicken cage area output in step S3 to obtain a binary image of the leftover feed area;

[0105] Step S4.3.4, the residual material ratio of the upper trough and the lower trough of each target chicken cage in each frame of the chicken cage trough image is obtained according to the following formula, and the residual material area includes the residual material area of ​​the upper trough and the residual material area of ​​the lower trough:

[0106] PrecisionU=MaskU / ((X i+1 -X i )(Uyu-Uy l ))

[0107] PrecisionL=MaskL / ((X i+1 -X i )(Lyu-Ly l ))

[0108] Among them, PrecisionU is the proportion of residual feed in the upper trough in the upper area of ​​interest of the target chicken cage; PrecisionL is the proportion of residual feed in the lower trough in the lower area of ​​interest of the target chicken cage; MaskU represents the number of white pixels in the binary image of the residual feed area of ​​the upper trough; MaskL represents the number of white pixels in the binary image of the residual feed area of ​​the lower trough; Uyu represents the ordinate of the upper boundary line of the upper trough; Uy l represents the ordinate of the lower boundary line of the upper trough; Lyu represents the ordinate of the upper boundary line of the lower trough; Ly l Represents the ordinate of the lower boundary line of the lower layer trough, wherein the upper / lower boundary line of the upper / lower layer trough is determined according to the position of the trough area.

[0109] Step S4.3.5: For the same target chicken cage with the same number in all chicken cage trough images, average the remaining feed ratios of all upper troughs corresponding to the same target chicken cage to obtain the i-th chicken cage CA in the chicken cage trough video. i The final upper trough residual feed ratio is averaged for all lower trough residual feed ratios corresponding to the same target chicken cage to obtain the CA of the i-th chicken cage in the cage trough video. i The final residual material ratio in the lower trough.

[0110] like Figure 1 and Figure 2 As shown, the device includes building a residual feed data acquisition system, a feed trough residual feed prediction model and a residual feed quantity measurement system; the residual feed data acquisition system includes a mobile chassis, a camera adjustable bracket and a camera, the mobile chassis can be placed on the ground horizontally, the camera adjustable bracket is vertically installed on the mobile chassis, the camera can be installed on the camera adjustable bracket up and down, the mobile chassis and the camera adjustable bracket are used to adjust the position and angle of the camera, the camera is used to collect chicken cage trough videos of different heights in a stacked cage chicken house in real time, and the chicken cage trough video is input into a trained feed trough residual feed prediction model, the feed trough residual feed prediction model outputs the cage column position, the feed trough position and the residual feed area position of various frames of the chicken cage trough image in the chicken cage trough video; the residual feed quantity measurement system obtains the residual feed ratio of each feed trough in each frame of the chicken cage trough image in the chicken cage trough video according to the cage column position, the feed trough position and the residual feed area position output by the feed trough residual feed prediction model.

[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for estimating residual material in a stacked cage laying hen house, characterized in that: The following steps are involved: Step S1, building a residual material data collection system, and collecting videos of chicken cage feed troughs at different heights in a stacked cage chicken house through the residual material data collection system; Step S2, constructing a feed trough residual material prediction model for identifying cage columns, feed troughs and residual materials in the feed troughs, training the feed trough residual material prediction model using the chicken cage feed trough video, and obtaining a trained feed trough residual material prediction model after the training is completed; Step S3, inputting the chicken cage trough video with the remaining feed ratio to be predicted into the trained trough remaining feed prediction model, and obtaining the position of each cage column, the trough area position and the remaining feed area position in the chicken cage trough video; Step S4, according to the cage column position, trough area position and residual material area position output by the trough residual material prediction model, obtain the residual material ratio of each trough in the chicken cage trough video.

2. A method for estimating residual material in a stacked cage laying hen house according to claim 1, characterized in that: The step S1 is specifically as follows: Step S1.1, firstly, a leftover feed data collection system is built in a stacked cage chicken house, wherein the leftover feed data collection system mainly consists of a mobile chassis, an adjustable camera bracket and a camera, wherein the mobile chassis can be horizontally movably placed on the ground, the adjustable camera bracket is vertically installed on the mobile chassis, and the camera can be vertically installed on the adjustable camera bracket; Step S1.2, adjusting the angle and position of the camera in real time through the residual feed data acquisition system, and using the camera to obtain real-time videos of chicken cage feed troughs at different heights in the stacked cage chicken house.

3. The method for estimating residual material in a stacked cage laying hen house according to claim 1, characterized in that: The step S2 is specifically as follows: Step S2.1, preprocessing the chicken cage trough video: first, perform image denoising, image contrast adjustment and image size standardization on each frame of the chicken cage trough picture in the chicken cage trough video, and use the picture annotation tool to use the cage column detection frame to mark the cage columns outside the chicken cage to obtain the position information of the cage columns, and then use the picture annotation tool to annotate the chicken cage trough picture to mark the trough area and the leftover feed area in the chicken cage trough picture; Step S2.2, then constructing each frame of the chicken cage trough picture and the corresponding label information into a chicken cage trough residual material data set, wherein the label information includes the cage column position information, trough area information and residual material area information in the chicken cage trough picture; Step S2.3, construct a feed trough residual feed prediction model for identifying cage columns, feed troughs and residual feed areas, use the chicken cage feed trough residual feed data set to train the feed trough residual feed prediction model, and obtain the trained feed trough residual feed prediction model after the training is completed.

4. The method for estimating residual material in a stacked cage laying hen house according to claim 1, characterized in that: The step S4 is specifically as follows: Step S4.1, first, according to the input results of each frame of the chicken cage trough image in the chicken cage trough video, the target cage column in the chicken cage trough video is screened out; the input results of each frame of the chicken cage trough image include the cage column position, trough area position and residual material area position output in step S3; Step S4.2, then, number the chicken cages in the chicken cage trough video according to the position of the target cage column, and select the target chicken cage from each frame of the chicken cage trough image; Step S4.3, finally, a region of interest is divided in the target chicken cage according to the position of the target cage column, and the residual feed ratio of each chicken cage feed trough is obtained according to the region of interest.

5. A method for estimating residual material in a stacked cage laying hen house according to claim 4, characterized in that: The step S4.1 is specifically as follows: Step S4.1.1: First, according to the cage column position output in step S3, the center point P of each cage column in the chicken cage feed trough image is obtained according to the following formula: j Coordinates: PX j = x j +w j / 2;PY j = y j +h j / 2 Among them, PX j and PY j are the center point P of the jth cage column in the chicken cage trough image. j The horizontal and vertical coordinates of x j and j are the horizontal and vertical coordinates of the top left corner vertex of the cage column detection frame corresponding to the jth cage column; w j and h j are the width and height of the cage column detection frame corresponding to the jth cage column, respectively, and j represents the ordinal number of the cage column; Step S4.1.2: Next, the rationality of the cage column position is judged according to the horizontal coordinate distance between the center points of two adjacent cage columns, and a target cage column with a reasonable position is obtained. The specific method for obtaining the target cage column is: Step S4.1.2.1, first, the first cage column in the chicken cage feed trough image is used as the first target cage column; Step S4.1.2.2, then, the custom screening times Z is 2; Step S4.1.2.3: Judge the rationality of the current Zth cage column position: If the horizontal coordinate distance between the current cage column center point and the previous target cage column center point is greater than the distance threshold X limit , it indicates that the current Zth cage column is the target cage column, and the screening times Z is increased by 1; Otherwise, it indicates that the current Zth cage column is not the target cage column, and the screening times Z is increased by 1; Step S4.1.2.4: Repeat step S4.1.2.3 until the positions of all cage columns are determined.

6. A method for estimating residual material in a stacked cage laying hen house according to claim 4, characterized in that: The step S4.2 is specifically as follows: Step S4.2.1, number each chicken cage in the chicken cage trough video: In the chicken cage trough video, number each target cage column from small to large in the order of the time axis, and then use the rectangular area between the i-th target cage column and the i+1-th target cage column in the chicken cage trough video as the i-th chicken cage CA of the chicken cage trough video. i , where the height of the chicken cage is a given constant, and i represents the ordinal number of the target cage column / chicken cage; Step S4.2.2, select the target chicken cages to be calculated for the remaining feed from each frame of the chicken cage feed trough image: For any frame of chicken cage feeder image, if the chicken cage CA i If the horizontal coordinate of the center point is greater than Wp / 3 and less than 2Wp / 3, then the chicken cage CA in the chicken cage trough image of this frame i is the target chicken cage, where Wp represents the width of the chicken cage trough image; Otherwise, the chicken cage CA in the chicken cage trough image of this frame i Not a target chicken coop.

7. A method for estimating residual material in a stacked cage laying hen house according to claim 4, characterized in that: The step S4.3 is specifically as follows: Step S4.3.1, determine the corner points of the region of interest ROI to be divided according to the position of the target cage column, the region of interest ROI includes a rectangular upper region of interest UROI and a rectangular lower region of interest LROI, the four corner points of the upper region of interest and their coordinates are respectively the upper corner point -Urec1(X i ,Y i )、Urec2(X i+1 ,Y i )、Urec3(X i ,3Hp / 5) and the upper corner point Urec4(X i+1 ,3Hp / 5), the four corner points and corner point coordinates of the lower layer area of ​​interest are respectively the lower layer corner point -Lrec1(X i ,3Hp / 5), lower corner point 2 Lrec2(X i+1 ,3Hp / 5), lower corner point three Lrec3(X i ,Hp) and the lower corner point Lrec4(X i+1 ,Hp); Among them, X i and Y i are the horizontal and vertical coordinates of the center point of the i-th target cage column in the chicken cage trough image; i+1 is the horizontal coordinate of the center point of the i+1th target cage column; Hp represents the height of the chicken cage trough image; Step S4.3.2, according to the coordinates of the corner points of the upper region of interest and the lower region of interest, the target chicken cage of each frame of the chicken cage trough image is divided into an upper region of interest and a lower region of interest, wherein the target chicken cage area of ​​each frame of the chicken cage trough image includes two layers of troughs, and the upper trough and the lower trough are respectively located in the upper region of interest and the lower region of interest; Step S4.3.3, in the chicken cage feed trough image, segment the residual feed area in the target chicken cage area and obtain a binary image of the residual feed area; Step S4.3.4, the residual material ratio of the upper trough and the lower trough of each target chicken cage in each frame of the chicken cage trough image is obtained according to the following formula: AccuracyU=MaskU / ((X i+1 -X i )(Here-Here l )) PrecisionL=MaskL / ((X i+1 -X i )(Lyu-Ly l )) Among them, PrecisionU is the proportion of residual feed in the upper trough in the upper area of ​​interest of the target chicken cage; PrecisionL is the proportion of residual feed in the lower trough in the lower area of ​​interest of the target chicken cage; MaskU represents the number of white pixels in the binary image of the residual feed area of ​​the upper trough; MaskL represents the number of white pixels in the binary image of the residual feed area of ​​the lower trough; Uyu represents the ordinate of the upper boundary line of the upper trough; Uy l represents the ordinate of the lower boundary line of the upper trough; Lyu represents the ordinate of the upper boundary line of the lower trough; Ly l Indicates the ordinate of the lower boundary line of the lower trough; Step S4.3.5: For the same target chicken cage with the same number in all chicken cage trough images, average the remaining feed ratios of all upper troughs corresponding to the same target chicken cage to obtain the i-th chicken cage CA in the chicken cage trough video. i The final upper trough residual feed ratio is averaged for all lower trough residual feed ratios corresponding to the same target chicken cage to obtain the CA of the i-th chicken cage in the cage trough video. i The final residual material ratio in the lower trough.

8. A device for implementing the method according to any one of claims 1 to 7, characterized in that: The invention comprises building a residual feed data collection system, a residual feed trough prediction model and a residual feed quantity measurement system; the residual feed data collection system comprises a mobile chassis, an adjustable camera bracket and a camera, the mobile chassis can be placed on the ground in a horizontally movable manner, the adjustable camera bracket is vertically installed on the mobile chassis, the camera can be installed on the adjustable camera bracket in an up-and-down movable manner, the mobile chassis and the adjustable camera bracket are used to adjust the position and angle of the camera, the camera is used to collect videos of chicken cage troughs at different heights in a stacked cage chicken house in real time, and the videos of chicken cage troughs are input into a trained residual feed trough prediction model, the residual feed trough prediction model outputs the cage column position, the trough position and the residual feed area position of the chicken cage trough images in various frames in the chicken cage trough video; the residual feed quantity measurement system obtains the residual feed ratio of each trough in each frame of the chicken cage trough image according to the cage column position, the trough position and the residual feed area position output by the residual feed trough prediction model.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method for predicting net energy demand of commercial pigs at different weight stages and application

    CN113361747A

  • Method and system for monitoring egg laying of stacked caged laying hen zone based on computer vision

    CN117351430A