A method for monitoring the state of livestock farming based on machine vision

Through machine vision technology, the grayscale images of cattle herds are analyzed, the desire to move and fighting factors are obtained, the possibility of fighting among cattle herds is predicted, and the problem of not being able to detect the fighting among cattle herds in time is solved in the existing technology, and intelligent risk monitoring and early warning are achieved.

CN120164166BActive Publication Date: 2025-07-25SHENZHEN CHENGCHENG HIGH-TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510637624.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-07-25
Estimated Expiration
2045-05-19

AI Technical Summary

Technical Problem

The existing cattle herd monitoring technology cannot detect the fighting behavior between the cattle herds in a timely manner, resulting in property losses for farmers.

Method used

Through machine vision technology, the cattle herd's grayscale image timing sequence is obtained, the position changes of matching corner point pairs are analyzed, the degree of movement desire and fighting factors of each cattle are obtained, the possibility of struggle in the cattle herd is predicted, and early warnings are sent to the breeders in a timely manner.

Benefits of technology

It achieves timely prediction and early warning before the cattle herds fight, avoids property losses, and improves the level of intelligent monitoring of the farm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120164166B_ABST
    Figure CN120164166B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image processing, and particularly relates to a method for monitoring the breeding status of livestock based on machine vision, including: obtaining the degree of movement desire of each cow according to the change in the position of the matching corner points of each cow in the gray-scale images of the cattle herd at different adjacent acquisition times; screening all cows according to the degree of movement desire to obtain all cows with strong movement desire; obtaining the fighting factor of each cow according to the distribution of corner points of each cow in the gray-scale image of the cattle herd at the current moment; obtaining the possibility of fighting among the cattle herd by analyzing the positional relationship between the cows with strong movement desire and the surrounding cows in the gray-scale image of the cattle herd at the current acquisition moment, as well as the fighting factor and the degree of movement desire; and monitoring the risk of fighting among the cattle herd in the farm based on the possibility of fighting among the cattle herd. The present invention can predict in advance the fighting among the cattle herd in the farm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and particularly relates to a method for monitoring the livestock breeding status based on machine vision. Background Art

[0002] With the rapid development of the livestock industry, the breeding scale has been continuously expanding. The traditional manual monitoring method has been difficult to meet the management needs of modern livestock husbandry. The automated and intelligent monitoring means have become an inevitable trend in the development of the livestock industry. Moreover, the rapid development of technologies such as computer vision and deep learning has provided a solid technical foundation for the application of image processing in livestock breeding. These technologies can efficiently and accurately process and analyze image data, providing strong technical support for monitoring the livestock breeding status. Since the cattle herd often cannot meet its exercise needs in the captive area, fights may occur among the cattle herd. The existing monitoring technologies for breeding status generally prompt the farmers of the change in the movement position of the cattle herd in the breeding area through the movement information of the cattle herd, and cannot timely detect the fighting behavior among the cattle herd, thus causing certain property losses to the farmers. Summary of the Invention

[0003] In order to solve the above problems, the present invention provides a method for monitoring the livestock breeding status based on machine vision, and the method includes:

[0004] Obtain the time series of grayscale images of the cattle herd in the farm;

[0005] Obtain all pairs of matching corner points between the grayscale images of the cattle herd at adjacent acquisition times; according to the position distribution of the pairs of matching corner points between the grayscale images of the cattle herd at adjacent acquisition times, obtain all pairs of matching corner points of each cattle in the grayscale image of the cattle herd;

[0006] According to the position change of the pairs of matching corner points of each cattle in the grayscale images of the cattle herd at different adjacent acquisition times, obtain the degree of exercise desire of each cattle; screen all the cattle according to the degree of exercise desire to obtain all the cattle with strong exercise desire; record the grayscale image of the cattle herd at the last acquisition time as the grayscale image of the cattle herd at the current time; according to the distribution of corner points of each cattle in the grayscale image of the cattle herd at the current time, obtain the fighting factor of each cattle; according to the analysis of the position relationship between the cattle with strong exercise desire in the grayscale image of the cattle herd at the current acquisition time and the surrounding cattle, as well as the fighting factor and the degree of exercise desire, obtain the possibility of fights occurring in the cattle herd;

[0007] Based on the possibility of fights occurring in the cattle herd, conduct risk fighting monitoring on the cattle herd in the farm.

[0008] Preferably, the method for obtaining all pairs of matching corner points of each cattle in the grayscale image of the cattle herd according to the position distribution of the pairs of matching corner points between the grayscale images of the cattle herd at adjacent acquisition times includes the following specific method:

[0009] According to the position distribution of the matching corner point pairs between the gray-scale images of the cattle herd at adjacent acquisition times, obtain the moving direction and moving distance between each pair of matching corner points;

[0010] For the th acquisition time of the gray-scale image of the cattle herd and the th acquisition time of the gray-scale image of the cattle herd, divide all the matching corner point pairs between them into the matching corner point pairs of several cattle between the gray-scale image of the cattle herd at the th acquisition time and the gray-scale image of the cattle herd at the th acquisition time; the moving directions and moving distances between all the matching corner point pairs of the same cattle in the matching corner point pairs of the several cattle are the same.

[0011] Preferably, the method for obtaining the moving direction and moving distance between each pair of matching corner points according to the position distribution of the matching corner point pairs between the gray-scale images of the cattle herd at adjacent acquisition times includes the following specific steps:

[0012] For the th matching corner point pair between the gray-scale image of the cattle herd at the th acquisition time and the gray-scale image of the cattle herd at the th acquisition time, record the position coordinates of the corner point of the gray-scale image of the cattle herd at the th acquisition time belonging to the th matching corner point pair as the first position coordinate of the th matching corner point pair; record the position coordinates of the corner point of the gray-scale image of the cattle herd at the th acquisition time belonging to the th matching corner point pair as the second position coordinate of the th matching corner point pair; record the straight-line connection direction between the first position coordinate of the th matching corner point pair and the second position coordinate of the th matching corner point pair as the moving direction of the th matching corner point pair; record the Euclidean distance between the first position coordinate of the th matching corner point pair and the second position coordinate of the th matching corner point pair as the moving distance of the th matching corner point pair.

[0013] Preferably, the method for obtaining the degree of movement desire of each cattle according to the position change of the matching corner point pairs of each cattle in the gray-scale images of the cattle herd at different adjacent acquisition times includes the following specific steps:

[0014] Obtain the moving speed and moving direction of each matching corner point pair of each cattle between the gray-scale images of the cattle herd at each adjacent acquisition time;

[0015] The average value of the moving speeds of all matching corner point pairs of the th cow between the bovine gray-scale images at all adjacent acquisition times is denoted as the moving speed of the th cow's movement desire; the variance of the moving directions of all matching corner point pairs of the th cow between the bovine gray-scale images at all adjacent acquisition times is denoted as the movement desire factor of the th cow; the normalized value of the product of the moving speed of the th cow's movement desire and the movement desire factor of the th cow is taken as the movement desire degree of the th cow.

[0016] Preferably, the specific method for obtaining the moving speed and moving direction of each matching corner point pair of each cow between the bovine gray-scale images at each adjacent acquisition time includes:

[0017] For the th cow, for the th acquisition time, the th matching corner point pair between the bovine gray-scale image at the th acquisition time and the bovine gray-scale image at the th acquisition time; the difference between the th acquisition time and the th acquisition time is denoted as the adjacent acquisition time difference; the ratio of the moving distance to the adjacent acquisition time difference is denoted as the moving speed of the th matching corner point pair between the bovine gray-scale image at the th acquisition time and the bovine gray-scale image at the

[0018] Preferably, the specific method for screening all cows with strong movement desire according to the movement desire degree includes:

[0019] Preset a desire threshold parameter , for any cow in the bovine gray-scale image, if the movement desire degree of the any cow is greater than or equal to the desire threshold parameter , the any cow is denoted as a cow with strong movement desire.

[0020] Preferably, the specific method for obtaining the fighting factor of each cow according to the distribution of corner points of each cow in the bovine gray-scale image at the current moment includes:

[0021] Input all the corner points of the th cow in the bovine gray-scale image at the current moment into the trained neural network to obtain the All the head corner points and all the body corner points of the cows in the grayscale image of the herd of cows at the current moment;

[0022] Preset two fighting parameters and , and denote the centroid position of the region formed by all the head corner points of the -th cow in the grayscale image of the herd of cows at the current moment as the head position coordinates of the -th cow; denote the centroid position of the region formed by all the body corner points of the -th cow in the grayscale image of the herd of cows at the current moment as the body position coordinates of the -th cow; if the ordinate of the head position coordinates of the -th cow is greater than or equal to the ordinate of the body position coordinates of the -th cow, take the fighting parameter as the fighting factor of the -th cow; if the ordinate of the head position coordinates of the -th cow is less than the ordinate of the body position coordinates of the -th cow, take the fighting parameter as the fighting factor of the -th cow.

[0023] Preferably, the method for obtaining the possibility of a fight occurring in the herd of cows according to the analysis of the positional relationship between the cows with strong movement desire and the cows around them in the grayscale image of the herd of cows at the current acquisition moment, as well as the fighting factor and the degree of movement desire, includes the following specific steps:

[0024] By analyzing the positional relationship between the cows with strong movement desire and the cows around them in the grayscale image of the herd of cows at the current acquisition moment, obtain the target cows of each cow with strong movement desire;

[0025] Denote the actual distance between the -th cow with strong movement desire and its target cow as the first distance; denote the ratio of the degree of movement desire of the -th cow with strong movement desire to the first distance as the fight possible factor; take the normalized value of the product of the fighting factor, the fight possible factor of the -th cow with strong movement desire, and the fighting factor of the target cow of the -th cow with strong movement desire as the fight risk of the -th cow with strong movement desire;

[0026] Take the mean value of the fight risks of all the cows with strong movement desire as the possibility of a fight occurring in the herd of cows.

[0027] Preferably, the method for obtaining the target cows of each cow with strong movement desire by analyzing the positional relationship between the cows with strong movement desire and the surrounding cows in the grayscale image of the cattle herd at the current acquisition moment includes the following specific steps:

[0028] The Euclidean distance between the body position coordinates of the th cow with strong movement desire in the grayscale image of the cattle herd at the current acquisition moment and the body position coordinates of any other cow is denoted as the actual distance between the th cow with strong movement desire and the said cow; among all the cows in the grayscale image of the cattle herd at the current acquisition moment except the th cow with strong movement desire, the cow with the minimum actual distance is taken as the target cow of the th cow with strong movement desire.

[0029] Preferably, the method for monitoring the risk of fighting among the cattle herd in the farm based on the possibility of fighting among the cattle herd includes the following specific steps:

[0030] Preset a threshold parameter , if the average value of the fighting risks of all the cows with strong movement desire in the grayscale image of the cattle herd at the current acquisition moment is greater than or equal to the threshold parameter , then the state of the cattle herd in the farm having a risk of fighting is recorded as an abnormal state.

[0031] The beneficial effects of the technical solution of the present invention are as follows: According to the positional changes of the matching corner points of each cow in the grayscale images of the cattle herd at different adjacent acquisition moments, the movement desire degree of each cow is obtained; all the cows with strong movement desire are obtained by screening all the cows according to the movement desire degree; according to the distribution of the corner points of each cow in the grayscale image of the cattle herd at the current moment, the fighting factor of each cow is obtained; according to the analysis of the positional relationship between the cows with strong movement desire and the surrounding cows in the grayscale image of the cattle herd at the current acquisition moment, as well as the fighting factor and the movement desire degree, the possibility of fighting among the cattle herd is obtained; the risk of fighting among the cattle herd in the farm is monitored based on the possibility of fighting among the cattle herd; thereby, the risk prediction is sent to the farmers in time before the fighting event of the cattle herd occurs, so as to avoid the property losses caused by the fighting of the cattle herd to a certain extent and help the farmers monitor the cattle herd more intelligently. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0033] Figure 1 This is the flowchart of the steps of a method for monitoring the livestock breeding status based on machine vision according to the present invention;

[0034] Figure 2 This is the flowchart of the characteristic relationship of a method for monitoring the livestock breeding status based on machine vision according to the present invention. Specific Embodiments

[0035] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following combines the accompanying drawings and preferred embodiments to specifically describe a method for monitoring the livestock breeding status based on machine vision according to the present invention, including its specific embodiments, structures, characteristics and effects in detail. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.

[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs.

[0037] The following specifically describes the specific solution of a method for monitoring the livestock breeding status based on machine vision provided by the present invention with reference to the accompanying drawings.

[0038] Please refer to Figure 1 , which shows the flowchart of the steps of a method for monitoring the livestock breeding status based on machine vision provided by an embodiment of the present invention. The method includes the following steps:

[0039] Step S001: Obtain the time series sequence of the grayscale images of the cattle herd in the farm.

[0040] It should be noted that traditional methods for monitoring the breeding status of cattle herds can only identify the movement information of the cattle herds and cannot give early warnings before the cattle herds fight, and the fights between cattle herds often cause a certain degree of property losses; this embodiment analyzes the specific information shown by the cattle herds in the time series image sequence to predict the risk of fights between cattle herds, so as to give timely warnings to the farmers before the cattle herds fight, thereby avoiding property losses.

[0041] Specifically, first, it is necessary to collect the time series sequence of the grayscale images of the cattle herd in the farm. The specific process is as follows:

[0042] Using the high-definition cameras in the farm, taking the cattle herd images in the farm at intervals of 5 seconds as a collection moment, and collecting for a total of 500 seconds; for the cattle herd images at any collection moment, performing median filtering denoising and grayscale conversion operations on the cattle herd images at this collection moment to obtain the cattle herd grayscale images at this collection moment; the sequence composed of the cattle herd grayscale images at all collection moments is denoted as the time sequence of the cattle herd grayscale images in the farm.

[0043] Among them, the median filtering and grayscale conversion operations are prior arts, and will not be elaborated here in this embodiment.

[0044] Thus, the time sequence of the cattle herd grayscale images in the farm is obtained through the above method.

[0045] Step S002: Obtain all pairs of matching corner points between the cattle herd grayscale images at adjacent collection moments; according to the position distribution of the pairs of matching corner points between the cattle herd grayscale images at adjacent collection moments, obtain all pairs of matching corner points of each cattle in the cattle herd grayscale images.

[0046] It should be noted that in the continuously captured cattle herd grayscale images, the position of each cattle may change. When monitoring the livestock farming state of the cattle herd, it is necessary to track and identify each cattle. Therefore, it is necessary to perform corner point matching on the cattle herd in the continuously captured cattle herd grayscale images. There is a certain relationship between the moving direction and the moving distance of the corner points on the surface of the cattle in the continuous images, so as to judge whether the pairs of matching corner points in the continuously captured cattle herd grayscale images are the same cattle.

[0047] Preferably, in some implementation manners of the embodiment of the present invention, the specific method for obtaining all pairs of matching corner points between the cattle herd grayscale images at adjacent collection moments is as follows:

[0048] For any pair of adjacent cattle herd grayscale images in the time sequence of the cattle herd grayscale images in the farm; use the SIFT corner point matching algorithm to perform corner point matching on the adjacent cattle herd grayscale images to obtain several pairs of matching corner points.

[0049] Among them, the SIFT corner point matching algorithm is a prior art, and will not be elaborated here in this embodiment.

[0050] Preferably, in some implementation manners of the embodiment of the present invention, since the moving directions and moving distances of the pairs of matching corner points belonging to the same cattle are the same between the cattle herd grayscale images at adjacent collection moments; therefore, according to the position distribution of the pairs of matching corner points between the cattle herd grayscale images at adjacent collection moments, the specific method for obtaining all pairs of matching corner points of each cattle in the cattle herd grayscale images is as follows:

[0051] For the cattle herd grayscale image at the th collection moment and the the th th position coordinates of the corner points of the grayscale image of the cattle herd at the th th collection moment of the grayscale image of the cattle herd, which is denoted as the first position coordinate of the th matching corner point pair; the position coordinates of the corner points of the grayscale image of the cattle herd at the th collection moment of the grayscale image of the cattle herd to which the th matching corner point pair belongs are denoted as the second position coordinate of the th

[0052] matching corner point pair; the straight-line connection direction between the first position coordinate of the th matching corner point pair and the second position coordinate of the th matching corner point pair is denoted as the moving direction of the

[0053] th

[0054] matching corner point pair; the Euclidean distance between the first position coordinate of the

[0055] th matching corner point pair and the second position coordinate of the th

[0052] matching corner point pair is denoted as the moving distance of the th matching corner point pair; All the matching corner point pairs between the grayscale image of the cattle herd at the th

[0053] collection moment and the grayscale image of the cattle herd at the

[0054] th

[0055] collection moment are divided into the matching corner point pairs of several cattle between the grayscale image of the cattle herd at the

[0054] th

[0055] collection moment and the grayscale image of the cattle herd at the

[0054] th

[0055] collection moment; for the matching corner point pairs of the several cattle, the moving directions and moving distances between all the matching corner point pairs of the same cattle are the same, that is, among all the matching corner point pairs, the matching corner point pairs with the same moving direction and corresponding same moving distance are obtained as the matching corner point pairs of the same cattle. Thus, all the matching corner point pairs of each cattle in the grayscale image of the cattle herd are obtained by the above method. Step S003: Obtain the degree of movement desire of each cattle according to the position change of the matching corner point pairs of each cattle in the grayscale images of the cattle herd at different adjacent collection moments; screen all the cattle according to the degree of movement desire to obtain all the cattle with strong movement desire; denote the grayscale image of the cattle herd at the last collection moment as the grayscale image of the cattle herd at the current moment; obtain the fighting factor of each cattle according to the distribution of the corner points of each cattle in the grayscale image of the cattle herd at the current moment; obtain the possibility of the cattle herd having a fight according to the analysis of the position relationship between the cattle with strong movement desire and the surrounding cattle in the grayscale image of the cattle herd at the current collection moment, as well as the fighting factor and the degree of movement desire.

[0055] It should be noted that, in order to pursue breeding cost performance, the breeding farm does not provide a large activity space for the cattle herd. This may cause the cattle herd to repeatedly perform meaningless movements due to stress and discomfort, such as circling back and forth, in search of a larger activity space or to try to relieve the anxiety caused by space constraints. However, when the cattle herd is circling back and forth, friction and fights may occur, leading to an increase in the fighting frequency among the cattle herd. When continuously capturing the grayscale images of the cattle herd, if some cattle are in a constantly moving state, it indicates that these cattle have a stronger desire to move, which also means that the possibility of friction and fights among these cattle is greater. Therefore, it is necessary to pay special attention to the cattle with a stronger desire to move.

[0056] Preferably, in some implementation manners of the embodiments of the present invention, the specific method for obtaining the movement desire degree of each cattle according to the position change of the matching corner point pairs of each cattle in the grayscale images of the cattle herd at different adjacent acquisition moments is as follows:

[0057] For the th cattle, the th matching corner point pair between the grayscale image of the cattle herd at the th acquisition moment and the grayscale image of the cattle herd at the th acquisition moment; Denote the straight-line connection direction between the first position coordinate of the th matching corner point pair and the second position coordinate of the th matching corner point pair as the movement direction of the th matching corner point pair between the grayscale image of the cattle herd at the th acquisition moment and the grayscale image of the cattle herd at the th acquisition moment;

[0058] Denote the Euclidean distance between the first position coordinate of the th matching corner point pair and the second position coordinate of the th matching corner point pair as the movement distance of the th matching corner point pair between the grayscale image of the cattle herd at the th acquisition moment and the grayscale image of the cattle herd at the th acquisition moment; Denote the difference between the th acquisition moment and the th acquisition moment as the adjacent acquisition time difference; Denote the ratio of the movement distance to the adjacent acquisition time difference as the movement speed of the th matching corner point pair between the grayscale image of the cattle herd at the th acquisition moment and the grayscale image of the cattle herd at the th acquisition moment;

[0059] Denote the The average moving speed of all matching corner point pairs of a cow between the grayscale images of the cattle herd at all adjacent acquisition times is denoted as the moving speed of the cow's movement desire; the variance of the moving direction of all matching corner point pairs of a cow between the grayscale images of the cattle herd at all adjacent acquisition times is denoted as the movement desire factor of the cow; the normalized value of the product of the moving speed of the cow's movement desire and the movement desire factor of the cow is used as the degree of the cow's movement desire;

[0060] The specific formula is as follows:

[0061]

[0062] In the formula, represents the degree of the cow's movement desire; represents the average moving speed of all matching corner point pairs of a cow between the grayscale images of the cattle herd at all adjacent acquisition times; represents the variance of the moving direction of all matching corner point pairs of a cow between the grayscale images of the cattle herd at all adjacent acquisition times; represents the linear normalization function.

[0063] It should be noted that when a cow moves faster within a certain period of time and the angle change is more complex, it indicates that the cow is walking or running without any rules and quickly at this time, which means that the cow has a greater movement desire at this time.

[0064] Preferably, in some implementation manners of the embodiment of the present invention, since most of the fights between cattle herds are actively initiated by cows with stronger movement desires, it is necessary to focus on analyzing cows with strong movement desires; the specific method for screening all cows according to the degree of movement desire to obtain all cows with strong movement desires is as follows:

[0065] Preset a desire threshold parameter , where this embodiment takes as an example for description, and this embodiment does not make specific limitations, where is determined according to the specific implementation situation;

[0066] For any cow in the grayscale image of the cattle herd, if the degree of movement desire of the any cow is greater than or equal to the desire threshold parameter , the any cow is recorded as a cow with strong movement desire.

[0067] It should be noted that when the movement desire of the cows in the farm is relatively strong, it is necessary to always pay attention to the positional relationship between this cow and other cows. That is, when there are some cows with strong movement desires and the distance between cows is relatively close, this situation may indicate that a fight is about to occur in the herd. Therefore, it is necessary to analyze the positional relationship between the cows with strong movement desires and the cows around them in the grayscale image of the herd at the current acquisition moment to obtain the possibility of a fight occurring in the herd.

[0068] Preferably, in some implementation manners of the embodiments of the present invention, when cows fight, they will first go through a confrontation stage. In this stage, cows will adjust their body postures to show their strength, that is, raise their heads and chests. Therefore, according to the distribution of corner points of each cow in the grayscale image of the herd at the last acquisition moment, the method for obtaining the fighting factor of each cow is as follows:

[0069] Record the grayscale image of the herd at the last acquisition moment as the grayscale image of the herd at the current moment, and input all the corner points of the th cow in the grayscale image of the herd at the current moment into the trained neural network to obtain all the head corner points and all the body corner points of the th cow in the grayscale image of the herd at the current moment; the neural network used in this embodiment is Resnet50; the method for obtaining the dataset for training this neural network is as follows:

[0070] Collect all the corner points of each cow in a large number of grayscale images of the herd, and manually mark the head corner points and body corner points of each cow in each grayscale image of the herd. That is, the head corner points of the cows in the grayscale image of the herd are marked as 1, and the body corner points of the cows are marked as 0. This marking result is recorded as the label of each grayscale image of the herd; collect a large number of grayscale images of the herd and their corresponding labels to form a dataset; use this dataset to train the defect recognition neural network, and the loss function used in the training process is the cross loss function.

[0071] Preset two fighting parameters and , where this embodiment takes and as an example for description, and this embodiment does not make specific limitations, where and are determined according to the specific implementation situation;

[0072] Record the centroid position of the region formed by all the head corner points of the th cow in the grayscale image of the herd at the current moment as the head position coordinates of the th cow; record the centroid position of the region formed by all the body corner points of the th cow in the grayscale image of the herd at the current moment as the The body position coordinates of the th cow; if the ordinate of the head position coordinates of the th cow is greater than or equal to the ordinate of the body position coordinates of the th cow, the fighting parameter is used as the fighting factor of the th cow; if the ordinate of the head position coordinates of the th cow is less than the ordinate of the body position coordinates of the th cow, the fighting parameter is used as the fighting factor of the

[0073] Preferably, in some implementation manners of the embodiments of the present invention, the specific method for obtaining the possibility of a fight occurring in the cattle herd according to the analysis of the positional relationship between the cattle with strong movement desire and the surrounding cattle in the gray-scale image of the cattle herd at the current acquisition moment, as well as the fighting factor and the degree of movement desire, is as follows:

[0074] The Euclidean distance between the body position coordinates of the th cattle with strong movement desire in the gray-scale image of the cattle herd at the current acquisition moment and the body position coordinates of any other cattle is recorded as the actual distance between the th cattle with strong movement desire and the said cattle; among all the cattle in the gray-scale image of the cattle herd at the current acquisition moment except the th cattle with strong movement desire, the cattle with the smallest actual distance is used as the target cattle of the th cattle with strong movement desire;

[0075] The actual distance between the th cattle with strong movement desire and its target cattle is recorded as the first distance; the ratio of the degree of movement desire of the th cattle with strong movement desire to the first distance is recorded as the fighting possibility factor; the normalized value of the product of the fighting factor of the th cattle with strong movement desire, the fighting possibility factor, and the fighting factor of the th target cattle of the cattle with strong movement desire is used as the fighting risk of the th cattle with strong movement desire;

[0076] The specific formula is:

[0077]

[0078] In the formula, represents the fighting risk of the th cattle with strong movement desire; represents the degree of movement desire of the th cattle with strong movement desire; represents the The actual distance between the cows with only strong exercise desire and their target cows; represent the fighting factor of the th cow with only strong exercise desire; represent the fighting factor of the target cow of the

[0079] Take the mean value of the fighting risks of all cows with only strong exercise desire as the possibility of the cattle herd to fight;

[0080] Thus, the possibility of the cattle herd to fight is obtained through the above method.

[0081] Step S004: Monitor the risk of fighting of the cattle herd in the farm based on the possibility of the cattle herd to fight.

[0082] Preferably, in some implementation manners of the embodiment of the present invention, the specific method for monitoring the risk of fighting of the cattle herd in the farm based on the possibility of the cattle herd to fight is:

[0083] Preset a threshold parameter , where this embodiment takes as an example for description, and this embodiment does not make specific limitations, where is determined according to the specific implementation situation;

[0084] If the mean value of the fighting risks of all cows with only strong exercise desire in the grayscale image of the cattle herd at the current acquisition moment is greater than or equal to the threshold parameter , it indicates that the cattle herd in the farm is about to have a risk of fighting. Record the state of the cattle herd in the farm having a risk of fighting as an abnormal state, and immediately send a warning message to the farmer's mobile phone.

[0085] Please refer to Figure 2 , which shows a characteristic relationship flowchart of a livestock breeding state monitoring method based on machine vision;

[0086] Thus, this embodiment is completed.

[0087] The above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for monitoring the state of livestock farming based on machine vision, characterized in that, The method includes the following steps: Obtain the time series of gray-scale images of the cattle herd in the farm; Obtain all pairs of matching corner points between the gray-scale images of the cattle herd at adjacent acquisition times; according to the position distribution of the pairs of matching corner points between the gray-scale images of the cattle herd at adjacent acquisition times, obtain all pairs of matching corner points of each cattle in the gray-scale images of the cattle herd; According to the position change of the pairs of matching corner points of each cattle in the gray-scale images of the cattle herd at different adjacent acquisition times, obtain the degree of movement desire of each cattle; screen all the cattle according to the degree of movement desire to obtain all the cattle with strong movement desire; record the gray-scale image of the cattle herd at the last acquisition time as the gray-scale image of the cattle herd at the current time; according to the distribution of corner points of each cattle in the gray-scale image of the cattle herd at the current time, obtain the fighting factor of each cattle; according to the analysis of the position relationship between the cattle with strong movement desire and the surrounding cattle in the gray-scale image of the cattle herd at the current acquisition time, as well as the fighting factor and the degree of movement desire, obtain the possibility of the cattle herd having a fight; Among them, the method for obtaining the degree of movement desire of each cow is as follows: obtain the movement speed and movement direction of each pair of matching corner points of each cow between the gray-scale images of the cattle herd at each adjacent acquisition moment; take the average value of the movement speeds of all pairs of matching corner points of the th cow between the gray-scale images of the cattle herd at all adjacent acquisition moments as the movement desire movement speed of the th cow; take the variance of the movement directions of all pairs of matching corner points of the th cow between the gray-scale images of the cattle herd at all adjacent acquisition moments as the movement desire factor of the th cow; take the normalized value of the product of the movement desire movement speed of the th cow and the movement desire factor of the th cow as the degree of movement desire of the th cow; Among them, the screening method for cows with strong exercise desire is: preset a desire threshold parameter , for any cow in the grayscale image of the cattle herd, if the exercise desire level of the any cow is greater than or equal to the desire threshold parameter , record the any cow as a cow with strong exercise desire; Based on the possibility of the cattle herd having a fight, conduct risk fighting monitoring on the cattle herd in the farm.

2. The method for monitoring the livestock breeding status based on machine vision according to claim 1, wherein, The specific method for obtaining all pairs of matching corner points of each cattle in the gray-scale images of the cattle herd according to the position distribution of the pairs of matching corner points between the gray-scale images of the cattle herd at adjacent acquisition times includes: According to the position distribution of the pairs of matching corner points between the gray-scale images of the cattle herd at adjacent acquisition times, obtain the moving direction and moving distance between each pair of matching corner points; Divide all the pairs of matching corner points between the grayscale images of the cattle herd at the -th acquisition moment and the grayscale images of the cattle herd at the -th acquisition moment into pairs of matching corner points of several cattle between the grayscale images of the cattle herd at the -th acquisition moment and the grayscale images of the cattle herd at the -th acquisition moment; The moving direction and moving distance between all pairs of matching corner points of the same cattle among the pairs of matching corner points of several cattle are the same.

3. The method for monitoring the livestock farming status based on machine vision according to claim 2, characterized in that The specific method for obtaining the moving direction and moving distance between each pair of matching corner points according to the position distribution of the pairs of matching corner points between the gray-scale images of the cattle herd at adjacent acquisition times includes: For the th cow herd grayscale image at the th acquisition moment and the th matching corner point pair between the cow herd grayscale images at the th acquisition moment, record the position coordinates of the corner points of the cow herd grayscale image belonging to the th acquisition moment in the th matching corner point pair as the first position coordinate of the th matching corner point pair; record the position coordinates of the corner points of the cow herd grayscale image belonging to the th acquisition moment in the th matching corner point pair as the second position coordinate of the th matching corner point pair; record the straight-line connection direction between the first position coordinate of the th matching corner point pair and the second position coordinate of the th matching corner point pair as the moving direction of the th matching corner point pair; record the Euclidean distance between the first position coordinate of the th matching corner point pair and the second position coordinate of the th matching corner point pair as the moving distance of the th matching corner point pair.

4. The method for monitoring the livestock breeding status based on machine vision according to claim 3, wherein, The specific method for obtaining the moving speed and moving direction of each pair of matching corner points of each cattle between the gray-scale images of the cattle herd at each adjacent acquisition time includes: For the nth cow, the nth cow herd grayscale image at the nth acquisition moment and the nth matching corner point pair between the cow herd grayscale images at the nth acquisition moment; denote the difference between the nth acquisition moment and the nth acquisition moment as the adjacent acquisition time difference; denote the ratio of the moving distance to the adjacent acquisition time difference as the nth matching corner point pair's moving speed between the cow herd grayscale image at the nth acquisition moment and the cow herd grayscale image at the nth acquisition moment.

5. The method for monitoring the livestock breeding state based on machine vision according to claim 1, wherein The specific method for obtaining the fighting factor of each cattle according to the distribution of corner points of each cattle in the gray-scale image of the cattle herd at the current time includes: Input all the corner points of the cows in the grayscale image of the herd at the current moment into the trained neural network to obtain all the head corner points and all the body corner points of the cows in the grayscale image of the herd at the current moment; Preset two fighting parameters and , and denote the centroid position of the region formed by all the head corner points of the th cow in the grayscale image of the cattle herd at the current moment as the head position coordinates of the th cow; denote the centroid position of the region formed by all the body corner points of the th cow in the grayscale image of the cattle herd at the current moment as the body position coordinates of the th cow; if the ordinate of the head position coordinates of the th cow is greater than or equal to the ordinate of the body position coordinates of the th cow, take the fighting parameter as the fighting factor of the th cow; if the ordinate of the head position coordinates of the th cow is less than the ordinate of the body position coordinates of the th cow, take the fighting parameter as the fighting factor of the th cow.

6. The method for monitoring the livestock breeding status based on machine vision according to claim 1, wherein, The specific method for obtaining the possibility of the cattle herd having a fight according to the analysis of the position relationship between the cattle with strong movement desire and the surrounding cattle in the gray-scale image of the cattle herd at the current acquisition time, as well as the fighting factor and the degree of movement desire includes: By analyzing the position relationship between the cattle with strong movement desire and the surrounding cattle in the gray-scale image of the cattle herd at the current acquisition time, obtain the target cattle of each cattle with strong movement desire; Record the actual distance between the th strong-movement-desire cattle and its target cattle as the first distance; Record the ratio of the movement desire level of the th strong-movement-desire cattle to the first distance as the struggle possibility factor; Record the normalized value of the product of the struggle factor of the th strong-movement-desire cattle, the struggle possibility factor, and the struggle factor of the target cattle of the th strong-movement-desire cattle as the struggle risk of the th strong-movement-desire cattle; Take the average value of the fighting risks of all the cattle with strong movement desire as the possibility of the cattle herd having a fight.

7. The method for monitoring the livestock breeding status based on machine vision according to claim 6, wherein, The specific method for obtaining the target cattle of each cattle with strong movement desire by analyzing the position relationship between the cattle with strong movement desire and the surrounding cattle in the gray-scale image of the cattle herd at the current acquisition time includes: The Euclidean distance between the body position coordinates of the th cow with strong movement desire and the body position coordinates of any other cow in the gray-scale image of the cattle herd at the current acquisition moment is denoted as the actual distance between the th cow with strong movement desire and any other cow; among all the cows in the gray-scale image of the cattle herd at the current acquisition moment except the th cows with strong movement desire, the cow with the smallest actual distance is taken as the target cow of the th cow with strong movement desire.

8. The method for monitoring the livestock farming status based on machine vision according to claim 1, characterized in that, The specific method for conducting risk fighting monitoring on the cattle herd in the farm based on the possibility of the cattle herd having a fight includes: Preset a threshold parameter , if the mean value of the fighting risks of all the cows with strong movement desires in the grayscale image of the cattle herd at the current acquisition moment is greater than or equal to the threshold parameter , then record the state of risk fighting among the cattle herd in the farm as an abnormal state.

Citation Information

Patent Citations

  • Target monitoring method and device, storage medium and electronic device

    CN113723355A

  • Method for identifying abnormal behaviors of sheep flock

    CN118658210A