Livestock and poultry breeding abnormal behavior assessment method based on computer vision

By using identification markers in surveillance videos to identify individual livestock and analyze their behavior, the problems of insufficient computing resources and low recognition accuracy in large-scale farms are solved, and efficient and stable livestock behavior monitoring is achieved, which is suitable for application on ordinary hardware platforms.

CN120656127AInactive Publication Date: 2025-09-16JIANGSU AGRI ANIMAL HUSBANDRY VOCATIONAL COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510832339.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-09-16
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing computer vision-based livestock behavior monitoring systems face problems such as insufficient computing resources, low recognition accuracy, and poor environmental adaptability in large-scale farms, making it difficult to achieve high-precision individual differentiation and abnormal behavior identification.

Method used

Identification markers are used to identify individual livestock. By monitoring markers composed of color blocks of different colors, shapes and sizes in the video, combined with HSV color space and simple geometric feature analysis, the behavioral data of livestock in different functional areas are obtained, and an anomaly detection mechanism for macro-behavioral patterns is established.

Benefits of technology

It reduces the requirements for image resolution, reduces the computing burden, improves recognition stability and reliability, is suitable for practical applications in large-scale farms, can run efficiently on ordinary hardware platforms, and reduces usage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120656127A_ABST
    Figure CN120656127A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer vision, and discloses a livestock and poultry breeding abnormal behavior assessment method based on computer vision, which comprises the following steps: collecting monitoring videos of each functional area; identifying the livestock individuals through the identification markers and recording behaviors of the livestock individuals in the functional areas to obtain overall behavior data; acquiring livestock basic information and environment information, and matching corresponding demand standards; judging whether the demand is normal or not according to the current-day overall behavior data and the demand standard; judging whether the behavior is regular or not according to the current day and historical overall behavior data; and when the demand is normal and the behavior is regular, evaluating that the behavior is normal, otherwise, evaluating that the behavior is abnormal and alarming. According to the method, the individual livestock is identified by the specific marker, so that the requirement on the video quality is reduced, and the anti-interference capability is realized; abnormality detection is carried out by monitoring the behavior modes of the livestock in the functional areas, complex calculation such as skeleton key point detection is avoided, and the technology implementation difficulty and resource requirements are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and more specifically, to a method for evaluating abnormal behavior in livestock and poultry farming based on computer vision. Background Art

[0002] With the rapid development of the modern livestock and poultry industry, large-scale, intensive farming has become a mainstream trend. In large-scale farming environments, monitoring livestock health and promptly detecting abnormal behavior are crucial for improving farming efficiency and reducing disease risks. Traditional manual inspection methods are no longer sufficient in large-scale farms, and intelligent monitoring systems based on computer vision have emerged, providing a new technical approach for livestock management.

[0003] However, existing computer vision-based livestock behavior monitoring systems face significant technical challenges in practical application. Current mainstream livestock individual identification methods rely primarily on the recognition of natural features, such as facial features, surface texture, or body shape. These methods require high-resolution image acquisition and are significantly affected by lighting conditions, camera angles, and changes in livestock posture, resulting in unstable recognition accuracy. This is particularly true on large-scale farms, where livestock are numerous and similar in appearance. This makes it difficult for natural feature-based identification methods to achieve high-precision individual differentiation.

[0004] More critically, existing technologies for identifying abnormal livestock behavior primarily rely on skeletal keypoint detection and motion analysis. These methods require precise identification of multiple key skeletal points and analysis of movement trajectories and posture changes to determine whether the behavior is abnormal. This approach requires extremely high image resolution and high-performance computing equipment for real-time processing. Furthermore, the algorithms are complex and challenging to develop. In practical applications, these systems often face challenges such as insufficient computing resources, low recognition accuracy, and poor environmental adaptability, making them difficult to deploy effectively in large-scale livestock farms. Summary of the Invention

[0005] In order to overcome the above problems of the prior art, the present invention proposes a method for evaluating abnormal behavior in livestock and poultry farming based on computer vision to solve the above problems.

[0006] The present invention provides the following technical solutions: A computer vision-based method for evaluating abnormal behavior in livestock and poultry farming, comprising: Collect surveillance videos from each functional area; identify individual livestock in the surveillance videos by identifying markers, and record the corresponding behavior of individual livestock in each functional area. Based on the corresponding behavior of individual livestock in each functional area every day, obtain the overall daily behavior data of individual livestock; Obtain basic information and environmental information of individual livestock, and match corresponding demand standards based on the basic information and environmental information of individual livestock; Determine whether the individual livestock's needs are normal based on the overall behavior data of the individual livestock on that day and the matching demand standards; Determine whether the individual livestock behavior is regular based on the overall behavior data of the livestock on the day and the overall behavior data in history; When the demand is normal and the behavior is regular, the individual livestock behavior is assessed as normal; otherwise, the individual livestock behavior is assessed as abnormal and an alarm message is sent.

[0007] Preferably, the identification markers include: different identification markers are composed of color blocks of different colors, shapes and sizes in different orders, each identification marker corresponds to an ID, and each ID corresponds to an individual livestock; the functional areas include a feeding area, a drinking area, an activity area and a rest area.

[0008] Preferably, identifying individual livestock in the surveillance video by identifying markers includes: Preprocess each frame of the surveillance video, including color correction and noise filtering; Use HSV color space to perform threshold segmentation on the image and extract the target area including the identification marker; Analyze the extracted target area and calculate the geometric characteristic parameters of different color areas in the target area, including area, perimeter, aspect ratio, and circularity; Determine the relative position relationship between different color areas, including distance, angle and arrangement order; Combining color, geometric features and relative position relationships to form a feature vector as a combined feature for identifying landmarks; According to the combined characteristics, identification markers are matched to obtain the corresponding ID, and the livestock individual is determined by the ID.

[0009] Preferably, the recording of the corresponding behaviors of individual livestock in each functional area includes: In the feeding area, record the entry time, exit time and feeding times of individual livestock; At the watering area, record the entry and exit times of individual livestock and the number of times they drank water; In the activity area, the entry time, exit time and movement distance of individual livestock were recorded; In the rest area, record the entry time, exit time and rest duration of individual livestock; Among them, the number of times of eating is measured by the number of times the distance between the identification marker and the feeding trough changes, the number of times of drinking is measured by the number of times the distance between the identification marker and the drinking equipment changes, the moving distance is calculated by the cumulative change of the position of the identification marker, and the rest time is calculated by calculating the time when the position of the marker remains unchanged.

[0010] Preferably, the overall behavior data includes time series behavior data and demand behavior data; wherein the time series behavior data is a time series established based on 24 hours a day, recording the specific time points of each livestock individual entering and leaving each functional area; Demand behavior data include the total number of times food is eaten in the feeding area, the total number of times water is drunk in the drinking area, the total movement distance in the activity area, and the total rest time in the rest area.

[0011] Preferably, the basic information includes breed, gender, weight and age; the environmental information includes season, temperature, humidity and air pressure; Based on the basic information of individual livestock and environmental information obtained, the closest demand standard is matched from the pre-established standard library; The demand standards include a standard range of times of feeding, a standard range of times of drinking, a standard range of distances moved, and a standard range of duration of rest for individual livestock per day.

[0012] Preferably, judging whether the individual livestock needs are normal based on the overall behavior data of the individual livestock on the day and the matching demand standards includes: Compare the demand behavior data of individual livestock on that day with the matching demand standard range; When the total number of times an individual livestock eats is within the standard range of times of eating, the total number of times it drinks is within the standard range of times of drinking, the total distance it moves is within the standard distance of moving, and the total resting time is within the standard resting time, the individual livestock's needs are judged to be normal; When any demand behavior data exceeds the corresponding standard range, the individual livestock demand is judged to be abnormal, and the specific abnormal item is recorded.

[0013] Preferably, judging whether the individual livestock behavior is regular based on the overall behavior data of the individual livestock on the day and the overall behavior data in history includes: Obtain the historical time series behavior data of livestock individuals in the most recent day as reference time series data; The number of times livestock individuals enter and exit each functional area is counted from the reference time series data, and the time period of each entry and exit is recorded. Each time period includes an entry time point and a corresponding exit time point. The number of times livestock individuals enter and exit each functional area is counted from the daily time series behavior data, and the time period of each entry and exit is recorded. Each time period includes an entry time point and a corresponding exit time point. First, the number of entries and exits in each functional area is compared to see if they are consistent. If the number of entries and exits in any functional area is inconsistent, it is judged that the individual livestock behavior is irregular; If the number of entries and exits in each functional area is the same, then the corresponding deviations of each entry and exit time period of each functional area are compared in turn; Set the time deviation tolerance threshold; When the entry time point deviation and exit time point deviation of each entry and exit time period of all functional areas do not exceed the set time deviation allowable threshold, the individual behavior pattern of livestock is judged; When the entry time point deviation or exit time point deviation of any entry and exit time period in any functional area exceeds the set time deviation allowable threshold, the individual livestock behavior is judged to be irregular, and the specific functional area and time point of the irregularity are recorded.

[0014] The present invention provides a method for evaluating abnormal behavior in livestock and poultry farming based on computer vision, which has the following beneficial effects: By using identification markers composed of blocks of different colors, shapes, and sizes, this technical solution overcomes the traditional reliance on high-definition images and complex feature extraction for individual livestock identification. This marker recognition method exhibits significant anti-interference capabilities, maintaining high recognition rates even under varying lighting conditions, poor camera angles, or changes in livestock posture. Compared to traditional methods that require precise identification of livestock's natural features, this solution significantly reduces image resolution requirements, alleviates computational burdens, and improves operational stability and reliability, making it particularly suitable for practical applications in large-scale livestock farms.

[0015] By recording livestock behavioral data in different functional areas, an anomaly detection mechanism based on macroscopic behavioral patterns was established, effectively avoiding the traditional methods' reliance on skeletal key point detection and microscopic motion analysis. By monitoring the entry and exit times and frequency of livestock movements in feeding, drinking, activity, and resting areas, combined with simple spatial position calculations, valuable behavioral indicators can be obtained. This method does not require complex posture estimation and motion recognition algorithms, significantly reducing the technical implementation difficulty and computing resource requirements. It can run efficiently on common hardware platforms, greatly reducing the cost of use. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 The figure is a flow chart of a method for evaluating abnormal behavior in livestock and poultry farming based on computer vision according to the present invention. DETAILED DESCRIPTION

[0017] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0018] Example 1

[0019] See also Figure 1 In this embodiment, a method for evaluating abnormal behavior in livestock and poultry farming based on computer vision includes: S1. Collect surveillance videos of each functional area; identify individual livestock in the surveillance videos by identifying markers, and record the corresponding behavior of the individual livestock in each functional area. Based on the corresponding behavior of the individual livestock in each functional area every day, obtain the overall behavior data of the individual livestock on a daily basis; The identification markers include: different identification markers are formed by color blocks of different colors, shapes and sizes in different orders, each identification marker corresponds to an ID, and each ID corresponds to an individual livestock; the functional areas include a feeding area, a drinking area, an activity area and a rest area.

[0020] The identifying of livestock individuals in the surveillance video by identifying markers includes: Preprocess each frame of the surveillance video, including color correction and noise filtering; Use HSV color space to perform threshold segmentation on the image and extract the target area including the identification marker; Analyze the extracted target area and calculate the geometric characteristic parameters of different color areas in the target area, including area, perimeter, aspect ratio, and circularity; Determine the relative position relationship between different color areas, including distance, angle and arrangement order; Combining color, geometric features and relative position relationships to form a feature vector as a combined feature for identifying landmarks; According to the combined characteristics, identification markers are matched to obtain the corresponding ID, and the livestock individual is determined by the ID.

[0021] In this embodiment, the specific implementation method for collecting surveillance video from each functional area and identifying individual livestock can be as follows: First, high-definition cameras are installed in the feeding area, drinking area, activity area, and rest area. A number of cameras are installed in each functional area based on its size to ensure comprehensive surveillance coverage. All cameras are connected to a central processing server for real-time video transmission and processing.

[0022] Each animal is equipped with an identification marker, worn around the neck or ear. The identification marker consists of blocks of color, shape, and size. For example, a cow numbered 001 might wear a red circle, a blue square, and a yellow triangle, arranged from left to right. This combination can generate enough unique identifiers to meet the identification needs of all livestock in the farm. It should be noted that in today's livestock farming process, animals often wear electronic ear tags, and identification markers can be combined with electronic ear tags in the form of paint, stickers, etc.

[0023] When processing captured surveillance video, each frame undergoes preprocessing. This includes color correction and noise filtering. Color correction adjusts the image's white balance to ensure consistent color under varying lighting conditions. Noise filtering uses a Gaussian filter to remove random noise from the image, improving the accuracy of subsequent processing.

[0024] After preprocessing, the image is converted from RGB color space to HSV color space, which makes it easier to separate different colors. In HSV space, a threshold range is set for each predefined color (such as red, blue, green, yellow, etc.), and the target area that may contain the landmark is extracted through threshold segmentation.

[0025] For the extracted target area, the geometric characteristic parameters of different color regions are calculated. These parameters include area (the number of pixels contained in the region), perimeter (the length of the region's boundary), aspect ratio (the ratio of the length to the width of the region's minimum bounding rectangle), and circularity (a measure of how closely the region's shape approximates a circle). These parameters can be used to determine the shape characteristics of each color block.

[0026] Next, the relative positions of the different color regions are determined. This involves calculating the distance between adjacent color blocks (Euclidean distance between the center points of the color blocks), the angle (the angle between the line connecting the color blocks and the horizontal line), and the arrangement order (the color blocks are sorted from left to right based on their horizontal position).

[0027] The color information, geometric features, and relative position relationship are combined to form a feature vector, which is used as the combined feature of the marker. This feature vector contains all the key information of the marker and can be used for unique identification.

[0028] Finally, the extracted feature vectors are matched against a pre-established database that stores the mapping between each marker's feature vector and its corresponding livestock ID. By calculating similarity, the best matching record is found, thereby obtaining the ID corresponding to the marker and identifying the individual livestock in the surveillance video.

[0029] The recording of the corresponding behaviors of individual livestock in each functional area includes: In the feeding area, record the entry time, exit time and feeding times of individual livestock; At the watering area, record the entry and exit times of individual livestock and the number of times they drank water; In the activity area, the entry time, exit time and movement distance of individual livestock were recorded; In the rest area, record the entry time, exit time and rest duration of individual livestock; Among them, the number of times of eating is measured by the number of times the distance between the identification marker and the feeding trough changes, the number of times of drinking is measured by the number of times the distance between the identification marker and the drinking equipment changes, the moving distance is calculated by the cumulative change of the position of the identification marker, and the rest time is calculated by calculating the time when the position of the marker remains unchanged.

[0030] The overall behavior data includes time series behavior data and demand behavior data; wherein the time series behavior data is a time series established based on 24 hours a day, recording the specific time points of each livestock individual entering and leaving each functional area; Demand behavior data include the total number of times food is eaten in the feeding area, the total number of times water is drunk in the drinking area, the total movement distance in the activity area, and the total rest time in the rest area.

[0031] In this embodiment, after the livestock individuals are identified, their behavior data in each functional area is further recorded. The specific implementation method can be as follows: Once the individual livestock is identified by identifying the marker, the system begins recording its behavioral parameters in each functional area. In the feeding area, the entry and exit times of the individual livestock are recorded. When the marker first appears in the camera view of the feeding area, the current time is automatically recorded as the entry time; when the marker leaves the camera view, the current time is recorded as the exit time. Feeding times are also counted by monitoring the change in distance between the marker and the trough. Each time the distance between the marker and the trough changes from far to near (below a preset threshold, such as 50 cm) and then back to far (above a preset threshold), it is counted as a feeding event. This distance-based counting method is simpler and more reliable than analyzing head movements and is not limited by changes in the animal's posture or camera angle.

[0032] At the drinking area, the entry and exit times of individual livestock are also recorded. Drinking times are measured by the number of changes in the distance between the marker and the drinking device. A drinking event is recorded when an animal approaches the drinking device (within a preset distance threshold), remains for a certain period of time (e.g., more than three seconds), and then leaves. This method avoids the need to identify complex behavioral features such as swallowing movements, thereby improving recognition accuracy.

[0033] In the activity area, the time when livestock enter and exit is recorded, and the distance traveled is calculated by tracking the changes in the position of markers. The coordinates of the markers are recorded at fixed intervals (e.g., 1 second). The displacement between two adjacent time points is then calculated and accumulated to obtain the total distance traveled. This method is more direct and effective than analyzing complex features such as gait, and is not affected by differences in livestock size or camera mounting height.

[0034] In rest areas, the entry and exit times of livestock are recorded, and rest duration is calculated. When the position of a marker changes minimally (displacement less than a preset threshold) within a certain period (e.g., 30 seconds), the animal is considered resting. These periods are then accumulated to calculate the total rest duration. This method, based on position stability, is more objective and quantifiable than analyzing lying posture or sleeping status.

[0035] The various behavioral data recorded above are integrated into two types of overall behavioral data: time-series behavioral data and demand-based behavioral data. Time-series behavioral data establishes a time series based on a 24-hour period, recording in detail the specific times when individual livestock enter and exit each functional area throughout the day, forming a complete activity timeline. Demand-based behavioral data counts the total amount of behavior over the day, including the total number of times livestock eat in the feeding area, the total number of times they drink in the watering area, the total distance traveled in the activity area, and the total rest time in the rest area.

[0036] Compared with methods that require precise capture of complex features such as livestock bones, joint movements, or subtle expressions, only the identification of landmarks and the calculation of simple spatial position relationships greatly reduces the difficulty of technical implementation and improves the stability and robustness of operation. Livestock's daily behavior patterns, such as the frequency, duration, and regularity of eating, drinking, activity, and rest, are important indicators for assessing their health status. By monitoring changes in these macro-behavioral indicators, abnormal conditions of livestock can be detected in a timely manner. For example, a significant decrease in the number of feedings may indicate a digestive disease, too long or too short a rest period may indicate pain or discomfort, and a sudden change in activity distance may reflect movement problems or emotional changes.

[0037] Furthermore, livestock behavior patterns are often highly regular, and healthy animals tend to exhibit stable daily routines. Any deviation from these patterns could be an early sign of health problems. This monitoring method, based on behavioral regularity, is more objective than relying solely on visual observation. It can capture subtle changes that might be overlooked by manual observation, providing livestock managers with a scientific basis for decision-making.

[0038] S2. Obtain basic information and environmental information of individual livestock, and match corresponding demand standards based on the basic information and environmental information of individual livestock; The basic information includes breed, gender, weight and age; the environmental information includes season, temperature, humidity and air pressure; Based on the basic information of individual livestock and environmental information obtained, the closest demand standard is matched from the pre-established standard library; The demand standards include a standard range of times of feeding, a standard range of times of drinking, a standard range of distances moved, and a standard range of duration of rest for individual livestock per day.

[0039] In this embodiment, the specific implementation method of obtaining basic information and environmental information of individual livestock and matching corresponding demand standards can be as follows: First, basic information about individual livestock is obtained, including breed, sex, weight, and age. Breed information can be obtained from livestock records and linked to the identified livestock ID. Gender information is also extracted from livestock records. Weight data can be obtained through regular weighing records or in real time using automated weighing systems installed in specific areas. Age information is calculated based on the livestock's date of birth.

[0040] Environmental information, including season, temperature, humidity, and air pressure, is also collected. Season is automatically determined based on the current date. Temperature, humidity, and air pressure data are collected in real time via a network of environmental sensors installed in various functional areas of the livestock farm. These sensors collect data every 10 minutes and transmit it to a central server. For each animal, the data from the corresponding sensor is selected based on its activity area to calculate the daily average temperature, humidity, and air pressure.

[0041] After obtaining the above information, the closest demand standard is matched from a pre-established standard library. This standard library is a dataset containing behavioral demand parameters for different livestock breeds under different physiological states and environmental conditions. For example, for a 3-year-old, 600 kg Holstein cow in an average summer temperature of 28°C, 65% relative humidity, and 101 kPa air pressure, the matching standards may include: standard feeding frequency range of 8-12 times / day, standard water frequency range of 6-10 times / day, standard movement distance range of 1.5-3 kilometers / day, and standard rest time range of 10-14 hours / day.

[0042] The matching process uses a weighted nearest neighbor algorithm. First, the distance between the feature vector of the livestock being evaluated and the feature vectors of each record in the standard database is calculated. The feature vector contains normalized parameters such as breed, sex, weight, age, season, temperature, humidity, and air pressure. Different parameters are assigned different weights; for example, breed and weight are given higher weights, while air pressure is given lower weights. After calculating the weighted Euclidean distance, the record with the smallest distance is selected as the matching result.

[0043] In this way, personalized requirements are established for each animal, providing a scientific basis for subsequent behavioral normality assessments. This matching method, based on individual animal characteristics and environmental factors, is more accurate than using a uniform standard. It can take into account physiological differences between individual animals and the influence of environmental factors, thereby improving the accuracy of behavioral abnormality detection.

[0044] S3. judging whether the individual livestock's needs are normal based on the overall behavior data of the individual livestock on that day and the matching demand standards; The determination of whether the individual livestock needs are normal based on the overall behavior data of the individual livestock on the day and the matching demand standards includes: Compare the demand behavior data of individual livestock on that day with the matching demand standard range; When the total number of times an individual livestock eats is within the standard range of times of eating, the total number of times it drinks is within the standard range of times of drinking, the total distance it moves is within the standard distance of moving, and the total resting time is within the standard resting time, the individual livestock's needs are judged to be normal; When any demand behavior data exceeds the corresponding standard range, the individual livestock demand is judged to be abnormal, and the specific abnormal item is recorded.

[0045] In this embodiment, the specific implementation method for determining whether the individual livestock needs are normal based on the overall daily behavior data of the individual livestock and the matching demand standards can be as follows: First, the daily demand behavior data of individual livestock were obtained, including the total number of times they ate, the total number of times they drank water, the total distance they moved, and the total rest time.

[0046] The acquired demand behavior data is then compared with the demand standard range obtained in the previous step. The comparison process uses a simple range check method, that is, to determine whether each behavior data falls within the corresponding standard range.

[0047] In practice, the system first checks whether the total number of feeds consumed falls within the standard range. For example, if the total number of feeds consumed by livestock on a given day is 10, while the standard range is 8 to 12 times per day, the feed intake is considered normal. If the total number of feeds consumed is 6, which is below the standard lower limit of 8, the feed intake is considered abnormal.

[0048] Similarly, check whether the total number of water drinks is within the standard water drink number range, whether the total movement distance is within the standard movement distance range, and whether the total rest time is within the standard rest time range.

[0049] When all four indicators are within the corresponding standard range, the individual livestock needs are judged to be normal and the assessment result is recorded as normal.

[0050] If any indicator exceeds the corresponding standard range, the individual livestock's needs are considered abnormal and the specific abnormality is recorded. For example, if the total number of water intakes is below the standard lower limit, but the other three indicators are normal, the assessment result is recorded as abnormal: insufficient water intake. If multiple indicators are abnormal, all abnormalities are recorded, such as abnormal: too few feed intakes or too short movement distance.

[0051] This range comparison-based method is simple and intuitive, has a low computational burden, is suitable for real-time processing of large amounts of livestock behavioral data, and can quickly identify potential problems.

[0052] S4. Determine whether the individual livestock behavior is regular based on the overall behavior data of the individual livestock on the day and the overall behavior data in history; The determining whether the individual livestock behavior is regular based on the overall behavior data of the day and the overall behavior data in history includes: Obtain the historical time series behavior data of livestock individuals in the most recent day as reference time series data; The number of times livestock individuals enter and exit each functional area is counted from the reference time series data, and the time period of each entry and exit is recorded. Each time period includes an entry time point and a corresponding exit time point. The number of times livestock individuals enter and exit each functional area is counted from the daily time series behavior data, and the time period of each entry and exit is recorded. Each time period includes an entry time point and a corresponding exit time point. First, the number of entries and exits in each functional area is compared to see if they are consistent. If the number of entries and exits in any functional area is inconsistent, it is judged that the individual livestock behavior is irregular; If the number of entries and exits in each functional area is the same, then the corresponding deviations of each entry and exit time period of each functional area are compared in turn; Set the time deviation tolerance threshold; When the entry time point deviation and exit time point deviation of each entry and exit time period of all functional areas do not exceed the set time deviation allowable threshold, the individual behavior pattern of livestock is judged; When the entry time point deviation or exit time point deviation of any entry and exit time period in any functional area exceeds the set time deviation allowable threshold, the individual livestock behavior is judged to be irregular, and the specific functional area and time point of the irregularity are recorded.

[0053] In this embodiment, the specific implementation method for determining whether the behavior of an individual livestock is regular based on the overall behavior data of the individual livestock on the day and the overall behavior data in the past can be as follows: First, the historical time series behavior data of individual livestock in the most recent day is obtained as reference time series data.

[0054] Count the number of times livestock enter and exit each functional area from the reference time series data, and record the time period for each entry and exit. For example, the reference data might reveal that the cow entered and exited the feeding area five times, with time periods of [07:05-07:35], [10:15-10:45], [13:20-13:50], [16:30-17:00], and [19:45-20:15]; and entered and exited the drinking area four times, with time periods of [07:40-07:45], [13:55-14:00], [17:05-17:10], and [20:20-20:25]. Similarly, record the time periods for entry and exit of the activity and rest areas.

[0055] Similarly, the number of times individual livestock entered and exited each functional area was counted from the daily time-series behavioral data, and the time period of each entry and exit was recorded.

[0056] Next, the numbers of entries and exits in each functional area are compared for consistency. For example, if the reference data shows a cow entering and exiting the feeding area five times, but the data for that day shows only four or six times, the behavior is considered irregular and recorded as abnormal: five times in the reference data, four times on that day.

[0057] If the number of entries and exits in each functional area is consistent, the corresponding deviations in the entry and exit time periods of each functional area are compared in sequence. A time deviation tolerance threshold is set, for example, 30 minutes. This means that the entry and exit times of livestock in the same functional area in the corresponding order are allowed to be advanced or delayed by up to 30 minutes.

[0058] The specific comparison method is to compare the reference data with the entry and exit time periods of the same functional area and the same order in the current day's data. The deviation of the entry time point (the current day's entry time minus the reference entry time) and the deviation of the exit time point (the current day's exit time minus the reference exit time) are calculated.

[0059] For example, if the reference data shows that the cow first entered the feeding area at 07:05, and the cow first entered the feeding area at 07:25 on the same day, the entry time deviation is 20 minutes, which does not exceed the 30-minute threshold and is considered normal. If the reference data shows that the cow left the drinking area for the third time at 17:10, and the cow left the drinking area for the third time on the same day at 17:50, the departure time deviation is 40 minutes, which exceeds the 30-minute threshold and is considered abnormal.

[0060] When the entry time point deviation and the exit time point deviation of each entry and exit time period of all functional areas do not exceed the set time deviation allowable threshold, the individual livestock behavior pattern is judged and the evaluation result is recorded as a pattern.

[0061] If any entry or exit time deviations exceed the set time deviation threshold for any functional area, the animal is deemed to have irregular behavior and the specific functional area and time point of the irregularity are recorded. For example, irregular behavior: the third exit from the drinking area is delayed by 40 minutes, or irregular behavior: the second entry into the rest area is advanced by 45 minutes.

[0062] This time-series comparison method can effectively detect changes in livestock behavior patterns, providing an important basis for early detection of health problems. Livestock typically develop stable daily behavioral rhythms, and significant deviations from these patterns often indicate potential health abnormalities or environmental disturbances.

[0063] S5. When the demand is normal and the behavior is regular, the individual behavior of the livestock is assessed as normal; otherwise, the individual behavior of the livestock is assessed as abnormal and an alarm message is sent.

[0064] In this embodiment, when the demand is normal and the behavior is regular, the assessment is normal; otherwise, it is assessed as abnormal and an alarm is sent. This judgment method combines the demand standard matching and behavioral regularity analysis in the aforementioned technical steps. It takes into account both the degree to which the behavioral data of individual livestock in each functional area matches the standard demand range with their physiological characteristics and environmental conditions, and the temporal stability of their behavioral patterns, forming a comprehensive and scientific assessment system. When an abnormality is found in the assessment, the alarm information can be sent to the breeding management personnel through various means, including mobile phone text messages, mobile application push notifications, emails, etc. Providing timely and accurate early warning information for breeding management can help to detect potential health problems early, reduce the incidence of disease, and improve breeding efficiency.

[0065] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only one type. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0066] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be covered by the scope of protection of the present invention.

[0067] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for evaluating abnormal behavior in livestock and poultry farming based on computer vision, characterized in that: include: Collect surveillance videos of various functional areas; Identify individual livestock in the surveillance video by identifying markers, and record the corresponding behavior of individual livestock in each functional area. Based on the corresponding behavior of individual livestock in each functional area every day, obtain the overall behavior data of individual livestock on a daily basis; Obtain basic information and environmental information of individual livestock, and match corresponding demand standards based on the basic information and environmental information of individual livestock; Determine whether the individual livestock's needs are normal based on the overall behavior data of the individual livestock on that day and the matching demand standards; Determine whether the individual livestock behavior is regular based on the overall behavior data of the livestock on the day and the overall behavior data in history; When the demand is normal and the behavior is regular, the individual livestock behavior is assessed as normal; otherwise, the individual livestock behavior is assessed as abnormal and an alarm message is sent.

2. The method for evaluating abnormal behavior in livestock and poultry farming based on computer vision according to claim 1, characterized in that: The identification markers include: different identification markers are formed by color blocks of different colors, shapes and sizes in different orders, each identification marker corresponds to an ID, and each ID corresponds to an individual livestock; the functional areas include a feeding area, a drinking area, an activity area and a rest area.

3. The method for evaluating abnormal behavior in livestock and poultry farming based on computer vision according to claim 2, characterized in that: The identifying of livestock individuals in the surveillance video by identifying markers includes: Preprocess each frame of the surveillance video, including color correction and noise filtering; Use HSV color space to perform threshold segmentation on the image and extract the target area including the identification marker; Analyze the extracted target area and calculate the geometric characteristic parameters of different color areas in the target area, including area, perimeter, aspect ratio, and circularity; Determine the relative position relationship between different color areas, including distance, angle and arrangement order; Combining color, geometric features and relative position relationships to form a feature vector as a combined feature for identifying landmarks; According to the combined characteristics, identification markers are matched to obtain the corresponding ID, and the livestock individual is determined by the ID.

4. The method for evaluating abnormal behavior in livestock and poultry farming based on computer vision according to claim 3, characterized in that: The recording of the corresponding behaviors of individual livestock in each functional area includes: In the feeding area, record the entry time, exit time and feeding times of individual livestock; At the watering area, record the entry and exit times of individual livestock and the number of times they drank water; In the activity area, the entry time, exit time and movement distance of individual livestock were recorded; In the rest area, record the entry time, exit time and rest duration of individual livestock; Among them, the number of times of eating is measured by the number of times the distance between the identification marker and the feeding trough changes, the number of times of drinking is measured by the number of times the distance between the identification marker and the drinking equipment changes, the moving distance is calculated by the cumulative change of the position of the identification marker, and the rest time is calculated by calculating the time when the position of the marker remains unchanged.

5. The method for evaluating abnormal behavior in livestock and poultry farming based on computer vision according to claim 4, characterized in that: The overall behavior data includes time series behavior data and demand behavior data; wherein the time series behavior data is a time series established based on 24 hours a day, recording the specific time points of each livestock individual entering and leaving each functional area; Demand behavior data include the total number of times food is eaten in the feeding area, the total number of times water is drunk in the drinking area, the total movement distance in the activity area, and the total rest time in the rest area.

6. The method for evaluating abnormal behavior in livestock and poultry farming based on computer vision according to claim 5, characterized in that: The basic information includes breed, gender, weight and age; the environmental information includes season, temperature, humidity and air pressure; Based on the basic information of individual livestock and environmental information obtained, the closest demand standard is matched from the pre-established standard library; The demand standards include a standard range of times of feeding, a standard range of times of drinking, a standard range of distances moved, and a standard range of duration of rest for individual livestock per day.

7. The method for evaluating abnormal behavior in livestock and poultry farming based on computer vision according to claim 6, characterized in that: The determination of whether the individual livestock needs are normal based on the overall behavior data of the individual livestock on the day and the matching demand standards includes: Compare the demand behavior data of individual livestock on that day with the matching demand standard range; When the total number of times an individual livestock eats is within the standard range of times of eating, the total number of times it drinks is within the standard range of times of drinking, the total distance it moves is within the standard distance of moving, and the total resting time is within the standard resting time, the individual livestock's needs are judged to be normal; When any demand behavior data exceeds the corresponding standard range, the individual livestock demand is judged to be abnormal, and the specific abnormal item is recorded.

8. The method for evaluating abnormal behavior in livestock and poultry farming based on computer vision according to claim 7, characterized in that: The determining whether the individual livestock behavior is regular based on the overall behavior data of the day and the overall behavior data in history includes: Obtain the historical time series behavior data of livestock individuals in the most recent day as reference time series data; The number of times livestock individuals enter and exit each functional area is counted from the reference time series data, and the time period of each entry and exit is recorded. Each time period includes an entry time point and a corresponding exit time point. The number of times livestock individuals enter and exit each functional area is counted from the daily time series behavior data, and the time period of each entry and exit is recorded. Each time period includes an entry time point and a corresponding exit time point. First, the number of entries and exits in each functional area is compared to see if they are consistent. If the number of entries and exits in any functional area is inconsistent, it is judged that the individual livestock behavior is irregular; If the number of entries and exits in each functional area is the same, then the corresponding deviations of each entry and exit time period of each functional area are compared in turn; Set the time deviation tolerance threshold; When the entry time point deviation and exit time point deviation of each entry and exit time period of all functional areas do not exceed the set time deviation allowable threshold, the individual behavior pattern of livestock is judged; When the entry time point deviation or exit time point deviation of any entry and exit time period in any functional area exceeds the set time deviation allowable threshold, the individual livestock behavior is judged to be irregular, and the specific functional area and time point of the irregularity are recorded.