Precise livestock and poultry feeding method, system and equipment based on image recognition

Through the image recognition method, real-time monitoring and analysis of livestock and poultry feeding amount and feed balance, the problems of low feeding efficiency and poor accuracy in the existing technology are solved, precise feeding is achieved, and the healthy growth of livestock and poultry is improved.

CN119580008AActive Publication Date: 2025-03-07ZHEJIANG ACADEMY OF AGRICULTURE SCIENCES

Patent Information

Application Number
CN202411796123.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-03-07
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

The existing livestock and poultry feeding methods are inefficient, have poor accuracy and real-time performance, which are prone to errors and affect the growth of pigs.

Method used

Using an image recognition method, by obtaining image data in the livestock and poultry pen, obtaining individual information of each livestock and poultry, conducting feeding tracking, judging the amount of food and feeding allowance, and sending alert information to the feeder to ensure accurate feeding.

Benefits of technology

It improves feeding efficiency, reduces manual intervention, enhances accuracy and real-timeness, reduces errors, and promotes the healthy growth of pigs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119580008A_ABST
    Figure CN119580008A_ABST
Patent Text Reader

Abstract

The invention discloses a livestock and poultry precise feeding method, system and device based on image recognition, relates to the technical field of livestock and poultry breeding management, and aims to solve the technical problem that an existing livestock and poultry feeding method is low in efficiency. The method comprises the following steps: acquiring image data of a target livestock and poultry pen; based on the image data of the target livestock and poultry circle, obtaining individual information of each livestock and poultry; on the basis of the image data of the target livestock and poultry circle, carrying out feeding tracking on each livestock and poultry individual, judging whether the feeding amount of each livestock and poultry individual meets a feeding amount threshold value or not, and sending alarm information to a feeder on the basis of a judgment result; based on the image data of the target livestock and poultry pen, judging the feed allowance in each feed trough in the target livestock and poultry pen; adding the feed remaining amounts in all the feed troughs, and judging whether the total feed remaining amount is smaller than a remaining amount threshold value or not; if not, no processing is carried out; if yes, the feed adding amount in the feed trough is calculated based on the feed remaining amount in the feed trough.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of livestock and poultry breeding management, and in particular to a livestock and poultry precision feeding method, system and equipment based on image recognition. Background Art

[0002] In the livestock and poultry farming industry, refined management is required to achieve accurate feeding. For example, the lactation period of sows is generally divided into 21 stages, and the feeding amount for each stage is determined according to the stage of lactation. In addition, the feeding amount in the normal stage is determined according to body weight.

[0003] However, existing farm workers still use the traditional method: regular recording and weighing. This method is labor-intensive, inefficient, poor in accuracy and timeliness, prone to errors, and affects the growth of pigs. Summary of the invention

[0004] The present application provides a method, system and equipment for precise livestock and poultry feeding based on image recognition, aiming to solve the technical problem of low efficiency of existing livestock and poultry feeding methods.

[0005] To solve the above technical problems, the present application provides:

[0006] A method for accurate feeding of livestock and poultry based on image recognition comprises the following steps:

[0007] Acquire image data of target livestock and poultry pen;

[0008] Based on the image data of the target livestock and poultry pen, obtaining individual information of each livestock and poultry;

[0009] Based on the image data of the target livestock and poultry pen, the feeding of each individual livestock and poultry is tracked to determine whether the feeding amount of each individual livestock and poultry meets the feeding amount threshold, and based on the determination result, an alarm message is sent to the feeder;

[0010] Based on the image data of the target livestock and poultry pen, determine the feed remaining in each feed trough in the target livestock and poultry pen; add the feed remaining in all feed troughs to determine whether the total feed remaining is less than the remaining threshold; if not, do not process it; if less, calculate the feed addition amount in the feed trough based on the feed remaining in the feed trough.

[0011] As some optional implementations of the present application, the individual information of each livestock and poultry is obtained based on the image data of the target livestock and poultry pen, including:

[0012] Acquire image data of target livestock and poultry pen;

[0013] Based on the image data of the target livestock and poultry pen, contour detection is performed on each livestock and poultry in the target livestock and poultry pen to obtain contour detection results of each livestock and poultry; the contour detection results include all pixel point information of the contour; the pixel point information includes the number information, coordinate information and color information of the pixel points.

[0014] As some optional implementations of the present application, the contour detection results of each of the livestock and poultry are obtained based on the following steps:

[0015] Based on the coordinate information of each pixel in the image, the coordinate distance between two adjacent pixels is obtained;

[0016] Determine whether the coordinate distances are all less than a contour distance threshold;

[0017] If satisfied, connect two adjacent pixels to obtain a pixel straight line;

[0018] It is determined whether the color information of the pixel points on the pixel point straight line meets the color threshold. If so, it is used as the livestock and poultry outline.

[0019] As some optional implementations of the present application, before obtaining the individual information of each livestock and poultry based on the image data of the target livestock and poultry pen, the method further includes:

[0020] Based on the video data of the target livestock and poultry enclosure, actual edge information of the target livestock and poultry enclosure is obtained;

[0021] Comparing the actual edge information with the theoretical edge information to determine whether the target livestock and poultry pen contained in the image data is complete;

[0022] If complete, the image data of the target livestock and poultry pen is analyzed to obtain individual information of each livestock and poultry;

[0023] If it is incomplete, the latest video data of the target livestock and poultry pen is acquired again and the above steps are repeated.

[0024] As some optional embodiments of the present application, the method of judging whether the food intake of each livestock and poultry individual meets the food intake threshold and sending an alarm message to the feeder based on the judgment result includes:

[0025] Determine whether the food intake of each livestock and poultry individual meets the food intake threshold;

[0026] If satisfied, no processing will be done;

[0027] If not, the weight of the corresponding livestock and poultry will be analyzed to obtain the weight value of the corresponding livestock and poultry; it is determined whether the weight value of the corresponding livestock and poultry meets the weight threshold. If it is met, no processing is performed; if it is not met, an alarm message is sent to the feeder.

[0028] As some optional implementations of the present application, the weight analysis of the corresponding livestock and poultry is performed to obtain the weight value of the corresponding livestock and poultry, including:

[0029] Inputting the image data of the corresponding livestock and poultry into the weight assessment model, performing weight analysis, and obtaining a first weight value of the corresponding livestock and poultry;

[0030] Inputting the corresponding livestock and poultry eating image data into the food intake recognition model, performing weight analysis, and obtaining a second weight value of the corresponding livestock and poultry;

[0031] The average of the first weight value and the second weight value is calculated to obtain the weight value of the corresponding livestock and poultry.

[0032] As some optional embodiments of the present application, the weight assessment model is obtained by training based on the following steps:

[0033] Obtain an image dataset of target livestock and poultry;

[0034] The key parts of each livestock and poultry in the image data set are marked and actual weight labels are added to obtain a training set; the key parts marked information includes shoulder position information, hip position information and limb position information;

[0035] Training a weight assessment model based on the training set;

[0036] The loss function of the weight assessment model is:

[0037]

[0038] In the formula, N represents the total number of training, y i represents the actual weight of the i-th training sample, Represents the predicted weight of the i-th training sample.

[0039] As some optional embodiments of the present application, the food intake recognition model is obtained by training based on the following steps:

[0040] Acquire a set of target livestock and poultry eating images; the set of eating images includes multiple groups of eating images; each group of eating images includes a feed trough image before eating and a feed trough image after eating;

[0041] Annotating the food intake of each group of the eating images and the weight of the corresponding target livestock and poultry to obtain an eating training image set;

[0042] Training a food intake recognition model based on the food intake training image set;

[0043] The food intake recognition model is a YOLOv5 model; the loss function of the food intake recognition model includes a position loss function, a classification loss function and a confidence loss function;

[0044] The position loss function is:

[0045]

[0046] Where IOU represents the predicted bounding box and the ground-truth bounding box b i The intersection and union ratio of ; N represents the total number of training;

[0047] The classification loss function is:

[0048]

[0049] In the formula, C represents the total number of categories, y ij Represents the true label of the jth class of the i-th sample; represents the predicted label of the jth class of the i-th sample; N represents the total number of training;

[0050] The confidence loss function is:

[0051]

[0052] In the formula, confidencei represents the confidence of the prediction box, that is, the probability that the prediction box contains the object; IOU represents the prediction bounding box and the ground-truth bounding box b i The intersection and ratio of .

[0053] On the other hand, the embodiment of the present application provides: a livestock and poultry precision feeding system based on image recognition, comprising:

[0054] An image acquisition module, used to obtain image data of a target livestock and poultry pen;

[0055] A segmentation module, used to obtain individual information of each livestock and poultry based on the image data of the target livestock and poultry pen;

[0056] A feeding tracking module is used to track the feeding of each individual livestock and poultry based on the image data of the target livestock and poultry pen, determine whether the feeding amount of each individual livestock and poultry meets the feeding amount threshold, and send an alarm message to the feeder based on the judgment result;

[0057] The feed remaining monitoring module is used to determine the feed remaining in each feed trough in the target livestock and poultry pen based on the image data of the target livestock and poultry pen; add the feed remaining in all feed troughs to determine whether the total feed remaining is less than the remaining threshold; if not, no processing is performed; if less, the feed addition amount in the feed trough is calculated based on the feed remaining in the feed trough.

[0058] On the other hand, an embodiment of the present application provides: a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described above.

[0059] Compared with the prior art, the method for accurate feeding of livestock and poultry based on image recognition described in the embodiment of the present application obtains the image data of the target livestock and poultry pen; obtains the individual information of each livestock and poultry based on the image data of the target livestock and poultry pen; tracks the feeding of each individual livestock and poultry based on the image data of the target livestock and poultry pen, determines whether the food intake of each individual livestock and poultry meets the food intake threshold, and sends an alarm message to the feeder based on the judgment result; determines the feed residue in each feed trough in the target livestock and poultry pen based on the image data of the target livestock and poultry pen; adds the feed residue in all feed troughs to determine whether the total feed residue is less than the residue threshold; if not less than, no processing is performed; if less than, the feed addition amount in the feed trough is calculated based on the feed residue in the feed trough. That is, the method described in the present application obtains the real-time information of the feed trough through monitoring video to avoid the phenomenon of wasting feed in an empty trough. Individual identification and labeling of livestock and poultry are realized through video and deep learning models, and their food intake is tracked, and then the association between the deep learning model and its weight is combined to achieve accurate feeding. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the specific implementation of the present application or the technical solution in the prior art, the following is a brief introduction to the drawings required for the specific implementation or the prior art description. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, each element or part is not necessarily drawn according to the actual scale.

[0061] Figure 1 A schematic diagram of the process of the livestock and poultry precision feeding method based on image recognition involved in this application;

[0062] Figure 2 This is a schematic diagram of the structure of the livestock and poultry precision feeding system based on image recognition involved in this application.

[0063] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0064] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0065] The precise feeding method for livestock and poultry based on image recognition of the present application, when judging the food intake and weight of individual livestock and poultry, is not simply judged by setting a threshold, but analyzed and judged by a deep learning model, which can better adapt to the differences between different livestock and poultry individuals, thereby improving the accuracy of judgment. In addition, the precise feeding method for livestock and poultry based on image recognition described in the present application can monitor the feeding situation and weight changes of livestock and poultry in real time. If a problem is found, an alarm message can be sent to the feeder in time, so that measures can be taken in time to ensure the healthy growth of livestock and poultry. It can be seen that the present application greatly improves the breeding efficiency, reduces labor costs, and improves economic benefits through automated monitoring and intelligent judgment.

[0066] It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture. If the specific posture changes, the directional indication will also change accordingly.

[0067] In this application, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0068] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the meaning of "and / or" appearing in the full text includes three parallel schemes. Taking "A and / or B" as an example, it includes scheme A, or scheme B, or a scheme that satisfies both A and B. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in the field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0069] The embodiment of the present application also provides a computer device, which may include: a processor, such as a central processing unit (CPU), a communication bus, a user interface, a network interface, and a memory. Among them, the communication bus is used to realize the connection and communication between these components. The user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory may be a high-speed random access memory (Random Access Memory, RAM) memory, or it may be a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory may also be a storage device independent of the aforementioned processor.

[0070] In the computer device, the network interface is mainly used for data communication with the network server; the user interface is mainly used for data interaction with the user; the processor and memory in the computer device of this embodiment can be set in the computer device, and the computer device calls the livestock and poultry precision feeding system based on image recognition stored in the memory through the processor, and executes the livestock and poultry precision feeding method based on image recognition provided by this embodiment.

[0071] It should be noted that the above-mentioned computer device can be an external hardware device that can run independently, or it can be a hardware device that comes with the livestock and poultry precision feeding system based on image recognition.

[0072] In a specific embodiment, Figure 1 As shown, the embodiment of the present application provides a method for accurate feeding of livestock and poultry based on image recognition, comprising the following steps:

[0073] Step S10: Acquire image data of the target livestock and poultry pen.

[0074] Specifically, the image data of the target livestock and poultry pen is based on high-resolution cameras (such as 4K resolution) at key locations in the livestock and poultry pen to ensure coverage of all feeding areas, feed troughs and activity areas of livestock and poultry. Or use dynamic cameras (such as PTZ cameras) to remotely adjust the viewing angle and focal length to enhance the flexibility of data acquisition. The acquisition cycle can be to set a timed shooting interval (such as taking an image every 10 seconds) to obtain enough data for analysis. Or collect under different lighting conditions (morning, afternoon, night) to ensure data diversity and model robustness. To ensure data security, the collected image data can also be uploaded to cloud storage or a local server to ensure data security and easy access.

[0075] Step S20: obtaining individual information of each livestock and poultry based on the image data of the target livestock and poultry pen.

[0076] In actual application scenarios, the individual information of the livestock and poultry can also be obtained by posture estimation technology (such as OpenPose) to obtain information such as the body shape and posture of each livestock and poultry to help identify individual characteristics, and based on this, a unique ID is assigned to each livestock and poultry to facilitate subsequent tracking and analysis.

[0077] Specifically, the individual information of each livestock and poultry is obtained based on the image data of the target livestock and poultry pen, including:

[0078] Step S21, acquiring image data of a target livestock and poultry pen;

[0079] Step S22: Based on the image data of the target livestock and poultry pen, perform contour detection on each livestock and poultry in the target livestock and poultry pen to obtain contour detection results of each livestock and poultry; the contour detection results include all pixel point information of the contour; the pixel point information includes the number information, coordinate information and color information of the pixel points.

[0080] The contour detection results of the livestock and poultry are obtained based on the following steps:

[0081] Based on the coordinate information of each pixel in the image, the coordinate distance between two adjacent pixels is obtained;

[0082] Determine whether the coordinate distances are all less than a contour distance threshold;

[0083] If satisfied, connect two adjacent pixels to obtain a pixel straight line;

[0084] It is determined whether the color information of the pixel points on the pixel point straight line meets the color threshold. If so, it is used as the livestock and poultry outline.

[0085] In an embodiment of the present application, the livestock and poultry outlines can be detected based on the following steps:

[0086] Image preprocessing: Convert the image into a grayscale image to simplify subsequent processing steps; apply Gaussian filtering and other methods to smooth the image and reduce the impact of noise on contour detection.

[0087] Use the Canny edge detection algorithm to identify the edges in the image. The algorithm finds the edge location by calculating the grayscale gradient of the image. Using the edge detection results, use a contour extraction algorithm (such as the findContours function in OpenCV) to obtain the contour of the livestock. This function returns a set of points for the contour.

[0088] For each detected contour, extract the coordinate information of all pixels on the contour and obtain the pixel color value of the contour area to help distinguish livestock and poultry from the background.

[0089] For each pair of adjacent pixels in the contour, calculate their coordinate distance. For example, using the Euclidean distance formula:

[0090]

[0091] Where d represents the Euclidean distance value, (x1, y1) is the first pixel point, and (x2, y2) is the second pixel point.

[0092] Compare the calculated coordinate distance to see if it is less than the preset contour distance threshold. If the distance is less than the threshold, it is considered that these points are connected in a straight line.

[0093] The color information of the pixels on the straight line is checked to confirm whether their color is within the set color threshold range. If the color information meets the conditions, the pixels on the straight line are taken as part of the outline, and finally a complete livestock and poultry outline is formed.

[0094] For example, there is an image of a livestock pen containing multiple pigs. The specific operation process is as follows:

[0095] Image preprocessing: Convert the image to grayscale and apply Gaussian filtering to remove image noise; apply the Canny algorithm to extract the edges of the pigs in the image; use findContours to extract the contours of the edges and obtain a set of contour points for each pig.

[0096] Pixel point information extraction: record the coordinates and color information of each pig's contour points; calculate the distance between adjacent contour points, and if it is less than the set threshold, connect these points to form a contour line; confirm whether the color information of these points conforms to the characteristic color of the pig.

[0097] Contour confirmation: Connect all eligible contour points to obtain the complete contour of each pig and mark the contour.

[0098] Through the above refinement steps, the contour information of each livestock and poultry can be accurately detected and obtained from the image data, laying the foundation for subsequent individual identification and behavior analysis.

[0099] It should be noted that before obtaining the individual information of each livestock and poultry based on the image data of the target livestock and poultry pen, the method also includes: obtaining the actual edge information of the target livestock and poultry pen based on the video data of the target livestock and poultry pen; comparing the actual edge information with the theoretical edge information to determine whether the target livestock and poultry pen contained in the image data is complete; if complete, analyzing the image data of the target livestock and poultry pen to obtain the individual information of each livestock and poultry; if incomplete, re-obtaining the latest video data of the target livestock and poultry pen and repeating the above steps.

[0100] Assume that, in a pig farm, to monitor the pigsty, we first need to determine the actual edge information of the pigsty to ensure that the acquired image data is complete. That is, the following steps are included:

[0101] Install a high-resolution camera to capture a video stream of the entire pigsty. Set the frequency and time of video acquisition (for example, record a video every 5 minutes) to ensure coverage of the entire area of ​​the pigsty. Convert each frame of the video stream to a grayscale image; use methods such as Gaussian filtering to smooth the image and remove noise. Apply the Canny edge detection algorithm or the Sobel operator to extract the edge information of the pigsty. Extract the edge data in each frame of the image to form a time series of edge information. Summarize the edge information in all frames to generate a complete actual edge model. Generate an edge map to represent the actual edges of the pigsty.

[0102] Based on the design drawing of the pigpen or previously recorded data, a theoretical edge model is established. The theoretical edge model may be a rectangle, circle or other geometric shape that represents the ideal boundary of the pigpen. The actual edge model is compared with the theoretical edge model. Use image registration technology to compare the edge data of the two and calculate the overlap between the actual edge and the theoretical edge. Error metrics (such as overlap, edge difference) are used to evaluate the integrity of the edge information. If the actual edge matches the theoretical edge to a high degree (such as an overlap of more than 90%), the target livestock and poultry pen in the image data is judged to be complete. If the actual edge matches the theoretical edge to a low degree, it is considered that there may be problems with the image data (such as partial area coverage, poor image quality, etc.).

[0103] If the actual edge information of the pigpen matches the theoretical edge information, image data analysis is performed to obtain individual information. Image data is extracted from the complete video stream and image preprocessing (such as grayscale, noise removal) is performed to improve analysis accuracy. The position and outline of each pig are identified using object detection and contour detection algorithms. The individual information of each pig, such as eating behavior and weight, is analyzed in combination with a machine learning model.

[0104] If the actual edge information of the pigpen does not match the theoretical edge information, reacquire the latest video data. Adjust the camera position or increase the number of cameras to obtain more viewing angles and more complete image data. Re-record the video and extract the actual edge information according to the above steps. Perform edge detection on the new video data to obtain the latest actual edge information. Compare the new actual edge information with the theoretical edge model to determine whether it meets the integrity requirements.

[0105] Image data analysis begins only after the actual edge matches the theoretical edge information to ensure the accuracy and reliability of the data.

[0106] Through the above detailed steps, the integrity and accuracy of the image data can be verified before the individual information analysis of livestock and poultry is carried out. This method helps to improve the quality of data processing and ensure the reliability of subsequent analysis.

[0107] Step S30: Based on the image data of the target livestock and poultry pen, the feeding of each individual livestock and poultry is tracked to determine whether the feeding amount of each individual livestock and poultry meets the feeding amount threshold, and based on the determination result, an alarm message is sent to the feeder.

[0108] In actual application scenarios, video frame difference technology or deep learning models (such as 3D convolutional networks) can be used to identify the eating behavior of livestock and poultry. Determine the eating time period and calculate the amount of food consumed by each livestock and poultry in a given time period. Then, based on the size and change of the eating area output by the target detection model, estimate the actual food intake of each livestock and poultry. Set a food intake threshold (such as the minimum daily food intake required) and compare it with the actual food intake. If the food intake of livestock and poultry is lower than the threshold, generate an alarm message to notify the feeder. Design an alarm mechanism (such as SMS, email, APP notification) to ensure that the feeder receives the information in time and takes action.

[0109] Specifically, the step of judging whether the food intake of each livestock and poultry individual meets the food intake threshold and sending an alarm message to the feeder based on the judgment result includes:

[0110] Step S31, determining whether the food intake of each livestock and poultry individual meets the food intake threshold;

[0111] Assume that in a pig farm, the food intake of each pig needs to be monitored to ensure that its food intake meets the preset standard. Then step S31 includes the following steps:

[0112] Install an electronic scale or sensor in the feed trough to monitor the food intake of each pig in real time. After each pig eats, the sensor will record the specific amount of food it eats. Upload the eating data of each pig to a data storage system (such as a database or cloud platform). Define the daily food intake threshold for each pig. For example, set each pig to eat at least 3 kilograms of feed every day. Calculate the actual food intake of each pig and compare it with the set food intake threshold. If the food intake of a pig is lower than the set threshold, go to step S33.

[0113] Step S32: If satisfied, no processing is performed;

[0114] That is, if the actual food intake of a pig is equal to or higher than 3 kg, it is considered to meet the food intake threshold. The food intake records of pigs that meet the threshold are updated to the system and marked as "normal". For pigs whose food intake meets the requirements, the system does not perform additional processing and does not trigger an alarm.

[0115] Step S33: If not, perform a weight analysis on the corresponding livestock and poultry to obtain the weight value of the corresponding livestock and poultry; determine whether the weight value of the corresponding livestock and poultry meets the weight threshold, if yes, do not process it; if not, send an alarm message to the feeder.

[0116] That is, for pigs that do not meet the food intake standard, their weight needs to be further analyzed to assess their health status. For example, a weighing scale or sensor is installed to measure the weight of the pigs regularly; the weight data of each pig is recorded to ensure the accuracy and timeliness of the data. A healthy weight range is set for each pig, for example, a healthy weight is set to 100 kg to 150 kg. The weight of each pig is compared with the set weight threshold. If the weight is within the healthy range, the system does not process it. If the weight is below the healthy range, the alarm phase is entered.

[0117] That is, if the weight is lower than the set threshold and the food intake is not up to standard, the system will send an alarm message to the feeder. The alarm message should include the identification of the specific pig, the current food intake, weight data, and recommended follow-up measures (such as increasing the amount of feed, health check, etc.).

[0118] Through these detailed steps, we can ensure that the feeding and weight of each livestock and poultry are monitored and managed, and potential problems can be detected and dealt with in time.

[0119] In a specific embodiment, the step of performing weight analysis on the corresponding livestock and poultry to obtain the weight value of the corresponding livestock and poultry includes:

[0120] 1) Inputting the image data of the corresponding livestock and poultry into the weight assessment model, performing weight analysis, and obtaining the first weight value of the corresponding livestock and poultry; the weight assessment model is trained based on the following steps: obtaining an image data set of target livestock and poultry; annotating key parts of each livestock and poultry in the image data set and adding actual weight labels to obtain a training set; the information annotated with the key parts includes shoulder position information, hip position information, and limb position information; and training the weight assessment model based on the training set;

[0121] The loss function of the weight assessment model is:

[0122]

[0123] In the formula, N represents the total number of training, y i represents the actual weight of the i-th training sample, Represents the predicted weight of the i-th training sample.

[0124] 2) Inputting the eating image data of the corresponding livestock and poultry into the food intake recognition model, performing weight analysis, and obtaining the second weight value of the corresponding livestock and poultry; the food intake recognition model is trained based on the following steps: obtaining a set of eating images of the target livestock and poultry; the eating image set includes multiple groups of eating images; each group of the eating images includes a feed trough image before eating and a feed trough image after eating; marking the food intake of each group of the eating images, and marking the corresponding weight of the target livestock and poultry, to obtain an eating training image set; training the food intake recognition model based on the eating training image set; the food intake recognition model is a YOLOv5 model; the loss function of the food intake recognition model includes a position loss function, a classification loss function, and a confidence loss function;

[0125] The position loss function is:

[0126]

[0127] Where IOU represents the predicted bounding box and the ground-truth bounding box b i The intersection and union ratio of ; N represents the total number of training;

[0128] The classification loss function is:

[0129]

[0130] In the formula, C represents the total number of categories, y ij Represents the true label of the jth class of the i-th sample; Represents the predicted label of the jth class of the i-th sample;

[0131] The confidence loss function is:

[0132]

[0133] In the formula, confidencei represents the confidence of the prediction box, that is, the probability that the prediction box contains the object; IOU represents the prediction bounding box and the ground-truth bounding box b i The intersection and ratio of .

[0134] 3) Calculating an average of the first weight value and the second weight value to obtain a weight value of the corresponding livestock and poultry.

[0135] It can be seen that this solution combines the weight assessment model and the food intake recognition model, obtains the weight value of livestock and poultry through two different methods, and calculates their average value to obtain the final weight value. The following are the main advantages of this solution:

[0136] Comprehensive multi-source data improves accuracy: By marking key parts of livestock and poultry (such as shoulders, hips, and limbs), the weight assessment model can make more accurate weight estimates based on these features. The key data of these parts helps to accurately infer the overall body shape and weight of livestock and poultry; by analyzing the images of the feed trough before and after eating, the food intake recognition model can directly measure the food intake of livestock and poultry, which is directly helpful for judging the weight changes of livestock and poultry. The YOLOv5 model has high accuracy and real-time performance in detecting food intake and livestock and poultry weight. Combining these two data sources helps to improve the accuracy of weight measurement and avoid the errors that may be caused by a single method.

[0137] Diversity and comprehensiveness of training data: By labeling key parts and actual weight labels, the training data contains rich information about livestock and poultry body shapes, which helps the model to effectively predict the weight of livestock and poultry of different body shapes in practical applications. The eating image set includes comparison data before and after eating, which enhances the model's sensitivity to changes in food intake and helps improve the understanding of the relationship between food intake and weight. Diversified training data enhances the generalization ability of the model and makes weight estimation more accurate.

[0138] Model fusion optimization results: Obtaining weight values ​​through the weight assessment model and the food intake recognition model respectively and calculating their average values ​​can reduce the errors that may exist in a single model. The weight assessment model may be affected by changes in body shape, while the food intake recognition model may be affected by factors such as uneven feed distribution. By taking the average value, these two errors can be comprehensively considered to obtain more reliable weight data.

[0139] Efficient and real-time monitoring: As an advanced target detection model, YOLOv5 can recognize and process feeding image data in real time, providing fast and accurate feeding amount analysis. This efficient processing capability is suitable for real-time monitoring systems, which can quickly provide feedback on the feeding status of livestock and poultry.

[0140] Automation and reduction of manual intervention: Automatically estimate weight through image data and training models, reducing the manual measurement and recording work required in traditional methods. This not only improves work efficiency, but also reduces human errors and ensures data accuracy. Through comprehensive analysis of weight and food intake, health problems or malnutrition of livestock and poultry can be detected early. This early warning helps to adjust feeding strategies in time, improve animal welfare, and optimize breeding benefits.

[0141] In summary, the scheme described in this application improves the accuracy and real-time performance of weight measurement by integrating the advantages of the weight assessment model and the food intake recognition model, optimizes the data processing process, reduces manual intervention, and provides an effective animal health monitoring tool. This multi-model fusion method improves the overall performance and reliability of the system.

[0142] Step S40: based on the image data of the target livestock and poultry pen, determine the feed remaining in each feed trough in the target livestock and poultry pen; add the feed remaining in all feed troughs to determine whether the total feed remaining is less than the remaining threshold; if not, do not process it; if less, calculate the feed addition amount in the feed trough based on the feed remaining in the feed trough.

[0143] In actual application scenarios, the target detection model can be used to detect the feed residue in each feed trough, and the feed layer height or volume of each feed trough can be calculated through image analysis. Combined with image segmentation technology, the amount of feed remaining in the feed trough can be accurately measured. The feed residue data in all feed troughs are summarized to calculate the total residue. Set a residue threshold (for example, less than 50 kg) to decide whether to add feed. If the total residue is lower than the threshold, calculate the amount of feed required to be added based on the residue. Use historical data or model predictions to estimate the most suitable amount of addition to ensure that the feed is sufficient and not wasted. If supported by the system, automatically control the feed delivery device to perform the feeding operation. Record the log of the feeding operation to ensure the traceability and accuracy of feed management. Through the above steps, it is ensured that the system can efficiently and accurately acquire, analyze and process the image data of livestock and poultry to realize intelligent feeding management.

[0144] like Figure 2 As shown, the embodiment of the present application also provides a livestock and poultry precision feeding system based on image recognition, based on the same inventive concept as the above embodiment, the system includes:

[0145] An image acquisition module, used to obtain image data of a target livestock and poultry pen;

[0146] A segmentation module, used to obtain individual information of each livestock and poultry based on the image data of the target livestock and poultry pen;

[0147] A feeding tracking module is used to track the feeding of each individual livestock and poultry based on the image data of the target livestock and poultry pen, determine whether the feeding amount of each individual livestock and poultry meets the feeding amount threshold, and send an alarm message to the feeder based on the judgment result;

[0148] The feed remaining monitoring module is used to determine the feed remaining in each feed trough in the target livestock and poultry pen based on the image data of the target livestock and poultry pen; add the feed remaining in all feed troughs to determine whether the total feed remaining is less than the remaining threshold; if not, no processing is performed; if less, the feed addition amount in the feed trough is calculated based on the feed remaining in the feed trough.

[0149] It should be noted that, since the steps executed by the device of this embodiment are the same as the steps of the aforementioned method embodiment, its specific implementation method and the technical effects that can be achieved can refer to the aforementioned embodiment and will not be repeated here.

[0150] In addition, in one embodiment, an embodiment of the present disclosure further provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory, and the computer program implements the steps of the method in the aforementioned embodiment when executed by the processor.

[0151] In addition, in one embodiment, an embodiment of the present disclosure further provides a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method in the aforementioned embodiment are implemented.

[0152] In some embodiments, the computer readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories. The computer may be various computing devices including intelligent terminals and servers.

[0153] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0154] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0155] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0156] It should be noted that, in this article, the terms "include", "may include" or any other variations thereof are intended to cover non-exclusive inclusions, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0157] The serial numbers of the above-mentioned embodiments of the present disclosure are only for description and do not represent the advantages or disadvantages of the embodiments.

[0158] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a multimedia terminal device (which can be a mobile phone, a computer, a television receiver, or a network device, etc.) to execute the methods described in each embodiment of the present disclosure.

[0159] The above descriptions are only optional embodiments of the present disclosure, and are not intended to limit the patent scope of the present disclosure. All equivalent structural transformations made using the contents of the present disclosure and the drawings under the inventive concept of the present disclosure, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present disclosure.

Claims

1. A method for precise feeding of livestock and poultry based on image recognition, characterized in that: The following steps are involved: Acquire image data of target livestock and poultry pen; Based on the image data of the target livestock and poultry pen, obtaining individual information of each livestock and poultry; Based on the image data of the target livestock and poultry pen, the feeding of each individual livestock and poultry is tracked to determine whether the feeding amount of each individual livestock and poultry meets the feeding amount threshold, and based on the determination result, an alarm message is sent to the feeder; Based on the image data of the target livestock and poultry pen, determine the feed remaining in each feed trough in the target livestock and poultry pen; add the feed remaining in all feed troughs to determine whether the total feed remaining is less than the remaining threshold; if not, do not process it; if less, calculate the feed addition amount in the feed trough based on the feed remaining in the feed trough.

2. The method for accurate livestock and poultry feeding based on image recognition according to claim 1, characterized in that: The obtaining of individual information of each livestock and poultry based on the image data of the target livestock and poultry pen includes: Acquire image data of target livestock and poultry pen; Based on the image data of the target livestock and poultry pen, contour detection is performed on each livestock and poultry in the target livestock and poultry pen to obtain contour detection results of each livestock and poultry; the contour detection results include all pixel point information of the contour; the pixel point information includes the number information, coordinate information and color information of the pixel points.

3. The method for accurate livestock and poultry feeding based on image recognition according to claim 2, characterized in that: The contour detection results of each of the livestock and poultry are obtained based on the following steps: Based on the coordinate information of each pixel in the image, the coordinate distance between two adjacent pixels is obtained; Determine whether the coordinate distances are all less than a contour distance threshold; If satisfied, connect two adjacent pixels to obtain a pixel straight line; It is determined whether the color information of the pixel points on the pixel point straight line meets the color threshold. If so, it is used as the livestock and poultry outline.

4. The method for accurate livestock and poultry feeding based on image recognition according to claim 1, characterized in that: Before obtaining the individual information of each livestock and poultry based on the image data of the target livestock and poultry pen, the method further includes: Based on the video data of the target livestock and poultry enclosure, actual edge information of the target livestock and poultry enclosure is obtained; Comparing the actual edge information with the theoretical edge information to determine whether the target livestock and poultry pen contained in the image data is complete; If complete, the image data of the target livestock and poultry pen is analyzed to obtain individual information of each livestock and poultry; If it is incomplete, the latest video data of the target livestock and poultry pen is acquired again and the above steps are repeated.

5. The method for accurate livestock and poultry feeding based on image recognition according to claim 1, characterized in that: The step of judging whether the food intake of each livestock and poultry individual meets the food intake threshold and sending an alarm message to the feeder based on the judgment result includes: Determine whether the food intake of each livestock and poultry individual meets the food intake threshold; If satisfied, no processing will be done; If not, the weight of the corresponding livestock and poultry will be analyzed to obtain the weight value of the corresponding livestock and poultry; it is determined whether the weight value of the corresponding livestock and poultry meets the weight threshold. If it is met, no processing is performed; if it is not met, an alarm message is sent to the feeder.

6. The method for accurate livestock and poultry feeding based on image recognition according to claim 5, characterized in that: The step of performing weight analysis on the corresponding livestock and poultry to obtain the weight value of the corresponding livestock and poultry includes: Inputting the image data of the corresponding livestock and poultry into the weight assessment model, performing weight analysis, and obtaining a first weight value of the corresponding livestock and poultry; Inputting the corresponding livestock and poultry eating image data into the food intake recognition model, performing weight analysis, and obtaining a second weight value of the corresponding livestock and poultry; The average of the first weight value and the second weight value is calculated to obtain the weight value of the corresponding livestock and poultry.

7. The method for accurate livestock and poultry feeding based on image recognition according to claim 6, characterized in that: The weight assessment model is trained based on the following steps: Obtain an image dataset of target livestock and poultry; The key parts of each livestock and poultry in the image data set are marked and actual weight labels are added to obtain a training set; the key parts marked information includes shoulder position information, hip position information and limb position information; Training a weight assessment model based on the training set; The loss function of the weight assessment model is: In the formula, N represents the total number of training, represents the actual weight of the i-th training sample, Represents the predicted weight of the i-th training sample.

8. The method for accurate livestock and poultry feeding based on image recognition according to claim 6, characterized in that: The food intake recognition model is trained based on the following steps: Acquire a set of target livestock and poultry eating images; the set of eating images includes multiple groups of eating images; each group of eating images includes a feed trough image before eating and a feed trough image after eating; Annotating the food intake of each group of the eating images and the weight of the corresponding target livestock and poultry to obtain an eating training image set; Training a food intake recognition model based on the food intake training image set; The food intake recognition model is a YOLOv5 model; the loss function of the food intake recognition model includes a position loss function, a classification loss function and a confidence loss function; The position loss function is: Where IOU represents the predicted bounding box and the ground-truth bounding box The intersection-and-union ratio of ; N represents the total number of training; The classification loss function is: In the formula, C represents the total number of categories, Represents the true label of the jth class of the i-th sample; represents the predicted label of the jth class of the i-th sample; N represents the total number of training; The confidence loss function is: In the formula, confidence i means The confidence of the prediction box, that is, the probability that the prediction box contains the object; IOU represents the predicted bounding box and the ground-truth bounding box The intersection and ratio of .

9. A livestock and poultry precision feeding system based on image recognition, characterized in that: include: An image acquisition module, used to obtain image data of a target livestock and poultry pen; A segmentation module, used to obtain individual information of each livestock and poultry based on the image data of the target livestock and poultry pen; A feeding tracking module is used to track the feeding of each individual livestock and poultry based on the image data of the target livestock and poultry pen, determine whether the feeding amount of each individual livestock and poultry meets the feeding amount threshold, and send an alarm message to the feeder based on the judgment result; The feed remaining monitoring module is used to determine the feed remaining in each feed trough in the target livestock and poultry pen based on the image data of the target livestock and poultry pen; add the feed remaining in all feed troughs to determine whether the total feed remaining is less than the remaining threshold; if not, no processing is performed; if less, the feed addition amount in the feed trough is calculated based on the feed remaining in the feed trough.

10. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Livestock health condition automatic analysis method and system

    CN107752987A

  • Feeding method, feeding system, feeding device, feeding equipment and computer readable storage medium

    CN111264405A

  • Sheep weight detection system and method

    CN113483869A

  • Hog house environment management method and system

    CN114946686A

  • Intelligent and precise sow feeding method and device, electronic equipment and storage medium

    CN115914560A

Cited By

  • Method for constructing intelligent breeding multi-mode Internet of Things information collection and early warning model

    CN116760719A

  • Multi-layer caged waterfowl feeding method, system and device based on behavior feedback

    CN120283691A

  • Pet food adding method and device, pet feeder and storage medium

    CN120391353A

  • Intelligent livestock feeding system and method

    CN120898731A