Livestock breeding state monitoring method based on machine vision
Through machine vision-based technology, the grayscale image timing sequence of cattle herds is analyzed and the risk of cattle herds is predicted, which solves the problem that the existing technology cannot detect cattle herds' fighting behavior in a timely manner, and realizes intelligent monitoring and risk warning of the breeding farm.
Patent Information
- Application Number
- CN202510637624.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-05-19
AI Technical Summary
The existing breeding status monitoring technology cannot detect the fighting between cattle herds in a timely manner, resulting in property losses for farmers.
Using a machine vision-based method, the cattle with strong desire for movement is selected by obtaining the grayscale image timing sequence of the cattle herd, matching the angle pair and the degree of motion desire, and screening out the cattle with strong desire for movement, and analyzing their fighting factors and positional relationships to predict the possibility of struggle in the cattle herd.
Timely prediction and monitoring of the risk of cattle fighting is achieved, property losses caused by cattle fighting is reduced, and the intelligent level of breeding management is improved.
Smart Images

Figure CN120164166A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly relates to a method for monitoring the breeding state of livestock 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 breeding state of livestock. Since the cattle herd often cannot meet its exercise needs in the captive area, fights will occur among the cattle herd. The existing monitoring technologies for breeding state generally only prompt the farmer 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 farmer. Summary of the Invention
[0003] To solve the above problems, the present invention provides a method for monitoring the breeding state of livestock based on machine vision, and the method includes: Obtaining a time series of grayscale images of the cattle herd in the farm; Obtaining 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, obtaining all pairs of matching corner points of each cow in the grayscale image of the cattle herd; According to the position change of the pairs of matching corner points of each cow in the grayscale images of the cattle herd at different adjacent acquisition times, obtaining the degree of exercise desire of each cow; screening all cows according to the degree of exercise desire to obtain all cows with strong exercise desire; recording 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 cow in the grayscale image of the cattle herd at the current time, obtaining the fighting factor of each cow; according to the analysis of the position relationship between the cows with strong exercise desire and the surrounding cows in the grayscale image of the cattle herd at the current acquisition time, as well as the fighting factor and the degree of exercise desire, obtaining the possibility of the cattle herd having a fight; Based on the possibility of the cattle herd having a fight, monitoring the risk of fighting of the cattle herd in the farm.
[0004] Preferably, the method for obtaining all pairs of matching corner points of each cow 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: 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; The gray-scale image of the cattle herd at the th acquisition time and all the matching corner point pairs between the gray-scale images of the cattle herd at the th acquisition time are divided 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
[0005] 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: 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.
[0006] 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: 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; The The average moving speed of all matching corner point pairs of a cow between the gray-scale images of the cattle herd at all adjacent acquisition times is denoted as the moving speed of the movement desire of the cow; the variance of the moving directions of all matching corner point pairs of the th cow between the gray-scale 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 movement desire of the th cow and the movement desire factor of the th cow is used as the movement desire level of the cow.
[0007] Preferably, the specific method for obtaining the moving speed and moving direction of each matching corner point pair of each cow between the gray-scale images of the cattle herd at each adjacent acquisition time includes: For the th cow, for the st acquisition time, the rd 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; the difference between the th acquisition time and the rd 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 rd 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
[0008] Preferably, the specific method for screening all cows according to the movement desire level to obtain all cows with strong movement desire includes: Preset a desire threshold parameter , for any cow in the gray-scale image of the cattle herd, if the movement desire level 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.
[0009] Preferably, the specific method for obtaining the fighting factor of each cow according to the distribution of corner points of the cow in the gray-scale image of the cattle herd at the current time includes: Input all the corner points of the th cow in the gray-scale image of the cattle herd at the current time into the trained neural network to obtain all the head corner points and all the body corner points of the th cow in the gray-scale image of the cattle herd at the current time; Preset two fighting parameters and , for the The centroid position of the region formed by all the head corner points of the cows in the grayscale image of the herd of cows at the current moment is denoted as the head position coordinates of the th cow; 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 is denoted 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, the fighting parameter is taken 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 taken as the fighting factor of the th cow.
[0010] Preferably, the method for obtaining the possibility of a fight occurring in the herd of cows according to the positional relationship between the cows with strong desire for movement 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 desire for movement, includes the following specific steps: By analyzing the positional relationship between the cows with strong desire for movement and the cows around them in the grayscale image of the herd of cows at the current acquisition moment, the target cows of each cow with strong desire for movement are obtained; The actual distance between the th cow with strong desire for movement and its target cow is denoted as the first distance; the ratio of the degree of desire for movement of the th cow with strong desire for movement to the first distance is denoted as the fight possibility factor; the normalized value of the product of the fighting factor, the fight possibility factor of the th cow with strong desire for movement, and the fighting factor of the target cow of the th cow with strong desire for movement is taken as the fight risk of the th cow with strong desire for movement; The average value of the fight risks of all cows with strong desire for movement is taken as the possibility of a fight occurring in the herd of cows.
[0011] Preferably, the method for obtaining the target cows of each cow with strong desire for movement by analyzing the positional relationship between the cows with strong desire for movement and the cows around them in the grayscale image of the herd of cows at the current acquisition moment includes the following specific steps: The Euclidean distance between the body position coordinates of the th cow with strong desire for movement in the grayscale image of the herd of cows at the current acquisition moment and the body position coordinates of any other cow is denoted as the The actual distance between the cows with strong movement desire only; among all the cows in the grayscale image of the cattle herd at the current acquisition moment except for the cows with strong movement desire only, the cow with the minimum actual distance is taken as the target cow of the cows with strong movement desire only.
[0012] Preferably, the risk struggle monitoring of the cattle herd in the farm based on the possibility of struggle among the cattle herd includes the following specific method: Preset a threshold parameter , if the average value of the struggle risk 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 struggle is recorded as an abnormal state.
[0013] The beneficial effects of the technical solution of the present invention are as follows: According to the position change of the matching corner point pairs 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 struggle 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 struggle factor and the movement desire degree, the possibility of struggle among the cattle herd is obtained; the risk struggle monitoring of the cattle herd in the farm is carried out based on the possibility of struggle among the cattle herd; thereby realizing timely sending the risk prediction to the farmer before the struggle event of the cattle herd occurs, so as to avoid the property loss caused by the struggle of the cattle herd to a certain extent and help the farmer monitor the cattle herd more intelligently. Description of the Drawings
[0014] 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, without creative efforts, other drawings can also be obtained based on these drawings.
[0015] Figure 1 It is the step flow chart of a method for monitoring the state of livestock breeding based on machine vision according to the present invention; Figure 2 It is the characteristic relationship flow chart of a method for monitoring the state of livestock breeding based on machine vision according to the present invention. Detailed Embodiments
[0016] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following specifically describes, in conjunction with the accompanying drawings and preferred embodiments, a method for monitoring the state of livestock farming based on machine vision according to the present invention, including its specific implementation manner, structure, features and effects. 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.
[0017] 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.
[0018] The following specifically describes the specific solution of a method for monitoring the state of livestock farming based on machine vision provided by the present invention in conjunction with the accompanying drawings.
[0019] Please refer to Figure 1 , which shows a flowchart of the steps of a method for monitoring the state of livestock farming based on machine vision provided by an embodiment of the present invention. The method includes the following steps: Step S001: Obtain the time series sequence of grayscale images of the cattle herd in the farm.
[0020] It should be noted that traditional methods for monitoring the state of cattle herds can only identify the movement information of the cattle herd and cannot give early warnings before the cattle herd fights, and the fights among the cattle herd often cause a certain degree of property losses; this embodiment analyzes the specific information shown by the cattle herd in the time series image sequence to predict the risk of fights among the cattle herd, so as to give timely warnings to the farmers before the cattle herd fights, thereby avoiding property losses.
[0021] Specifically, first, it is necessary to collect the time series sequence of grayscale images of the cattle herd in the farm. The specific process is as follows: Using the high-definition cameras in the farm, taking each 5 seconds as a collection moment, successively obtain the images of the cattle herd in the farm for a total of 500 seconds; for the cattle herd image at any collection moment, perform median filtering denoising and grayscale conversion operations on the cattle herd image at this collection moment to obtain the grayscale image of the cattle herd at this collection moment; record the sequence composed of all the grayscale images of the cattle herd at each collection moment as the time series sequence of grayscale images of the cattle herd in the farm.
[0022] Among them, median filtering and grayscale conversion operations are existing technologies, and this embodiment will not elaborate too much here.
[0023] So far, the time series sequence of grayscale images of the cattle herd in the farm is obtained through the above method.
[0024] Step S002: 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.
[0025] It should be noted that in the continuously captured grayscale images of the cattle herd, the position of each cattle may change. When monitoring the livestock breeding 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 grayscale images of the cattle herd. 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 determine whether the pairs of matching corner points in the continuously captured grayscale images of the cattle herd are of the same cattle.
[0026] Preferably, in some implementation manners of the embodiments of the present invention, the specific method for obtaining all pairs of matching corner points between the grayscale images of the cattle herd at adjacent acquisition times is as follows: For any pair of adjacent acquisition time grayscale images of the cattle herd in the time sequence of the grayscale images of the cattle herd in the farm; use the SIFT corner point matching algorithm to perform corner point matching on the grayscale images of the cattle herd at the adjacent acquisition times, and obtain a number of pairs of matching corner points.
[0027] Among them, the SIFT corner point matching algorithm is a prior art, and it will not be elaborated here in this embodiment.
[0028] Preferably, in some implementation manners of the embodiments 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 grayscale images of the cattle herd at adjacent acquisition times; therefore, according to the position distribution of the pairs of matching corner points between the grayscale images of the cattle herd at adjacent acquisition times, the specific method for obtaining all pairs of matching corner points of each cattle in the grayscale image of the cattle herd is as follows: For the th pair of matching corner points between the grayscale image of the cattle herd at the th acquisition time and the grayscale image of the cattle herd at the th acquisition time, record the position coordinates of the corner point of the grayscale image of the cattle herd at the th acquisition time belonging to the th pair of matching corner points as the first position coordinates of the th pair of matching corner points; record the position coordinates of the corner point of the grayscale image of the cattle herd at the th acquisition time belonging to the th pair of matching corner points as the second position coordinates of the th pair of matching corner points; record the straight line connection direction between the first position coordinates of the th pair of matching corner points and the second position coordinates of the th pair of matching corner points as the The moving direction of each pair of matching corner points; Denote the Euclidean distance between the first position coordinates of the th pair of matching corner points and the second position coordinates of the th pair of matching corner points as the moving distance of the th pair of matching corner points; Divide all pairs of matching corner points between the gray-scale images of the cattle herd at the th acquisition moment and the gray-scale images of the cattle herd at the th acquisition moment into pairs of matching corner points of several cattle between the gray-scale images of the cattle herd at the th acquisition moment and the gray-scale images of the cattle herd at the th acquisition moment; For all pairs of matching corner points of the same cattle among the pairs of matching corner points of the several cattle, their moving directions and moving distances are the same. That is, among all pairs of matching corner points, obtain pairs of matching corner points with the same moving direction and corresponding same moving distance as the pairs of matching corner points of the same cattle.
[0029] Thus, all pairs of matching corner points of each cattle in the gray-scale images of the cattle herd are obtained through the above method.
[0030] Step S003: 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 moments, obtain the degree of movement desire of each cattle; Screen all cattle according to the degree of movement desire to obtain all cattle with strong movement desire; Denote the gray-scale image of the cattle herd at the last acquisition moment as the gray-scale image of the cattle herd at the current moment; According to the distribution of corner points of each cattle in the gray-scale image of the cattle herd at the current moment, 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 moment, as well as the fighting factor and the degree of movement desire, obtain the possibility of the cattle herd having a fight.
[0031] It should be noted that since the farm pursues breeding cost performance and does not give the cattle herd a large activity space, this may cause the cattle herd to repeatedly perform meaningless movements, such as circling back and forth, to find a larger activity space or try to relieve the anxiety caused by space limitation; However, when the cattle herd circles back and forth, friction and fights may occur, resulting in an increase in the fighting frequency among the cattle herd; When continuously shooting to obtain the gray-scale images of the cattle herd, if some cattle are in a state of continuous movement, it indicates that these cattle have a relatively strong movement desire, which also shows that the possibility of friction and fights among these cattle is greater. Therefore, it is necessary to pay key attention to the cattle with relatively strong movement desire.
[0032] Preferably, in some implementation manners of the embodiments of the present invention, the specific method for obtaining the degree of movement desire of each cattle 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 moments is as follows: For the nth cow, the nth matching corner point pair between the grayscale image of the cattle herd at the mth acquisition moment and the grayscale image of the cattle herd at the kth acquisition moment; the straight-line connection direction between the first position coordinates of the nth matching corner point pair and the second position coordinates of the kth matching corner point pair is denoted as the nth matching corner point pair's moving direction between the grayscale image of the cattle herd at the mth acquisition moment and the grayscale image of the cattle herd at the kth acquisition moment; The Euclidean distance between the first position coordinates of the nth matching corner point pair and the second position coordinates of the kth matching corner point pair is denoted as the nth matching corner point pair's moving distance between the grayscale image of the cattle herd at the mth acquisition moment and the grayscale image of the cattle herd at the kth acquisition moment; the difference between the mth acquisition moment and the kth acquisition moment is denoted as the adjacent acquisition time difference; the ratio of the moving distance to the adjacent acquisition time difference is denoted as the nth matching corner point pair's moving speed between the grayscale image of the cattle herd at the mth acquisition moment and the grayscale image of the cattle herd at the kth acquisition moment; The mean value of the moving speeds of all matching corner point pairs of the nth cow between the grayscale images of the cattle herd at all adjacent acquisition moments is denoted as the nth cow's moving desire moving speed; the variance of the moving directions of all matching corner point pairs of the nth cow between the grayscale images of the cattle herd at all adjacent acquisition moments is denoted as the nth cow's moving desire factor; the normalized value of the product of the nth cow's moving desire moving speed and the nth cow's moving desire factor is used as the nth cow's moving desire degree; The specific formula is: In the formula, represents the nth cow's moving desire degree; represents the mean value of the moving speeds of all matching corner point pairs of the nth cow between the grayscale images of the cattle herd at all adjacent acquisition moments; represents the variance of the moving directions of all matching corner point pairs of the nth cow between the grayscale images of the cattle herd at all adjacent acquisition times; represents the linear normalization function.
[0033] It should be noted that when the speed of a cow's movement is faster within a certain period of time, the angle change is more complex, indicating that the cow is walking or running without any rules and rapidly at this time, which means that the cow has a relatively strong desire to move at this time.
[0034] Preferably, in some implementation manners of the embodiments of the present invention, since most of the fights between cattle herds are actively provoked by cattle with a relatively strong desire to move, it is necessary to focus on analyzing the cattle with a strong desire to move; the specific method for screening all n cows according to the degree of desire to move and obtaining all cattle with a strong desire to move is as follows: Preset a desire threshold parameter , where in this embodiment, is taken as an example for description, and this embodiment does not make specific limitations, where it depends on the specific implementation situation; For any one cow in the grayscale image of the cattle herd, if the degree of desire to move of the any one cow is greater than or equal to the desire threshold parameter , the any one cow is recorded as a cow with a strong desire to move.
[0035] It should be noted that when the desire of the cattle in the farm to move 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 a strong desire to move and the distance between the cows is relatively close, this situation may indicate that a fight is about to occur in the cattle herd; therefore, it is necessary to analyze the positional relationship between the cows with a strong desire to move and the cows around them in the grayscale image of the cattle herd at the current acquisition time to obtain the possibility of a fight in the cattle herd.
[0036] Preferably, in some implementation manners of the embodiments of the present invention, when a fight occurs between cows, they will first go through a confrontation stage. In this stage, the cows will adjust their body postures to show their strength, that is, raise their heads and chests. Therefore, the method for obtaining the fighting factor of each cow according to the distribution of corner points of each cow in the grayscale image of the cattle herd at the last acquisition time is as follows: 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, and input all the corner points of the nth cow in the grayscale image of the cattle herd at the current time into the trained neural network to obtain all the head corner points and all the body corner points of the nth cow in the grayscale image of the cattle herd at the current time; where the neural network used in this embodiment is Resnet50; the method for obtaining the dataset for training this neural network is: Collect all the corner points of each cow in a large number of gray-scale images of the cattle herd. Manually mark the head corner points and body corner points of each cow in each gray-scale image of the cattle herd. That is, the head corner points of the cows in the gray-scale image of the cattle 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 gray-scale image of the cattle herd; collect a large number of gray-scale images of the cattle herd and their corresponding labels to form a data set; use this data set to train a defect recognition neural network, and the loss function used in the training process is a cross loss function; Preset two fighting parameters and , where in this embodiment, and are taken as examples for description. This embodiment does not make specific limitations, where and are determined according to the specific implementation situation; Record the centroid position of the region formed by all the head corner points of the th cow in the gray-scale image of the cattle 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 gray-scale 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.
[0037] Preferably, in some implementation manners of the embodiment 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 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 is as follows: Record the Euclidean distance between the body position coordinates of the th cow 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 cow as the actual distance between the th cow with strong movement desire and the said cow; among all the cows in the gray-scale image of the cattle herd at the current acquisition moment except the th cow with strong movement desire, take the cow with the smallest actual distance as the target cow of the th cow with strong movement desire; Record the actual distance between the th cattle with strong movement desire and its target cattle as the first distance; record the ratio of the movement desire level of the th cattle with strong movement desire to the first distance as the struggle possibility factor; record the normalized value of the product of the struggle factor of the th cattle with strong movement desire, the struggle possibility factor, and the struggle factor of the target cattle of the th cattle with strong movement desire as the struggle risk of the th cattle with strong movement desire; In the formula, represents the struggle risk of the th cattle with strong movement desire; represents the movement desire level of the th cattle with strong movement desire; represents the actual distance between the th cattle with strong movement desire and its target cattle; represents the struggle factor of the th cattle with strong movement desire; represents the struggle factor of the target cattle of the th cattle with strong movement desire;
[0038] Take the mean value of the struggle risks of all cattle with strong movement desire as the possibility of the cattle herd having a struggle; Thus, the possibility of the cattle herd having a struggle is obtained through the above method.
[0039] Step S004: Monitor the risk of struggle of the cattle herd in the breeding farm based on the possibility of the cattle herd having a struggle.
[0040] Preferably, in some implementation manners of the embodiment of the present invention, the specific method for monitoring the risk of struggle of the cattle herd in the breeding farm based on the possibility of the cattle herd having a struggle is: Preset a threshold parameter , where in this embodiment, is taken as an example for description, and this embodiment does not make specific limitations, and is determined according to the specific implementation situation; If the mean value of the struggle risks of all cattle 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 , it indicates that the cattle herd in the breeding farm is about to have a risk of struggle. Record the state of the cattle herd in the breeding farm having a risk of struggle as an abnormal state, and immediately send a warning message to the mobile phone of the farmer.
[0041] Please refer to Figure 2 , which shows a characteristic relationship flowchart of a livestock breeding status monitoring method based on machine vision; Thus, this embodiment is completed.
[0042] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for monitoring livestock breeding status based on machine vision, characterized in that: The method comprises the following steps: Obtain a time series of grayscale images of cattle in a breeding farm; Obtain all matching corner point pairs between grayscale images of cattle herds at adjacent acquisition moments; obtain all matching corner point pairs of each cattle in the grayscale images of cattle herds according to the position distribution of the matching corner point pairs between the grayscale images of cattle herds at adjacent acquisition moments; According to the position change of the matching corner point pair of each cow in the grayscale image of the cattle herd at different adjacent acquisition moments, the degree of movement desire of each cow is obtained; according to the degree of movement desire, all cows are screened to obtain all cows with strong movement desire; the grayscale image of the cattle herd at the last acquisition moment is recorded as the grayscale image of the cattle herd at the current moment; 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 cattle with strong movement desire and the surrounding cattle in the grayscale image of the cattle herd at the current acquisition moment, as well as the fighting factor and the degree of movement desire, the possibility of fighting among the cattle herd is obtained; Among them, the method for selecting cattle with strong desire for exercise is to preset a desire threshold parameter For any cow in the grayscale image of the herd, if the degree of movement desire of any cow is greater than or equal to the desire threshold parameter , any one of the cows is recorded as a cow with strong desire for exercise; Monitoring of cattle herds on farms for risk of fighting based on the likelihood of fighting among cattle.
2. The method for monitoring livestock breeding status based on machine vision according to claim 1, characterized in that: The specific method of obtaining all matching corner point pairs of each cow in the grayscale images of the herd according to the position distribution of the matching corner point pairs between the grayscale images of the herd at adjacent acquisition moments includes: According to the position distribution of the matching corner point pairs between the grayscale images of the cattle herd at adjacent acquisition moments, the moving direction and moving distance between each matching corner point pair are obtained; The first The grayscale image of the cattle herd at the acquisition moment and the All matching corner point pairs between the grayscale images of the cattle herd at the acquisition time are divided into The grayscale image of the cattle herd at the acquisition moment and the Matching corner point pairs of several cattle between the grayscale images of the cattle herd at the acquisition moment; The moving directions and moving distances between all the matching corner point pairs of the same cow among the matching corner point pairs of the plurality of cows are the same.
3. The method for monitoring livestock breeding status based on machine vision according to claim 2, characterized in that: The specific method of obtaining the moving direction and moving distance between each matching corner point pair according to the position distribution of the matching corner point pairs between the grayscale images of the cattle herd at adjacent acquisition moments includes: For The grayscale image of the cattle herd at the acquisition moment and the The grayscale images of the cattle herd at the time of collection Matching corner point pairs, The matching corner point pair belongs to The position coordinates of the corner points of the grayscale image of the cattle herd at the acquisition time are recorded as The first position coordinates of the matching corner point pair; The matching corner point pair belongs to The position coordinates of the corner points of the grayscale image of the cattle herd at the acquisition time are recorded as The second position coordinates of the matching corner point pair; The first position coordinates of the matching corner point pair and the The direction of the straight line connecting the second position coordinates of the matching corner point pairs is recorded as The moving direction of the first matching corner point pair; The first position coordinates of the matching corner point pair and the The Euclidean distance between the second position coordinates of the matching corner point pairs is recorded as The moving distance of each matching corner point pair.
4. The method for monitoring livestock breeding status based on machine vision according to claim 3, characterized in that: The specific method of obtaining the degree of movement desire of each cow according to the position change of the matching corner point pair of each cow in the grayscale image of the herd at different adjacent acquisition moments includes: Obtain the moving speed and moving direction of each matching corner point pair of each cow between the grayscale images of the cattle herd at each adjacent acquisition time; The first The average of the moving speeds of all matching corner point pairs of cattle between the grayscale images of the cattle at all adjacent acquisition times is recorded as The movement speed of the first cow; The variance of the moving directions of all matching corner point pairs of a cow at all adjacent acquisition moments between the grayscale images of the cattle herd is recorded as The exercise desire factor of the first The movement speed of the first cow is similar to that of the second cow. The normalized value of the product of the exercise desire factors of the first The degree of exercise desire of a cow.
5. The method for monitoring livestock breeding status based on machine vision according to claim 4, characterized in that: The specific method of obtaining the moving speed and moving direction of each matching corner point pair of each cow between the grayscale images of the cattle herd at each adjacent acquisition time includes: For The cow is in The grayscale image of the cattle herd at the acquisition moment and the The grayscale images of the cattle herd at the time of collection Matching corner point pairs; The collection time and The difference between the two collection moments is recorded as the adjacent collection time difference; the ratio of the moving distance to the adjacent collection time difference is recorded as The matching corner point pairs are The grayscale image of the cattle herd at the acquisition moment and the The moving speed between the grayscale images of the cattle herd at each acquisition moment.
6. The method for monitoring livestock breeding status based on machine vision according to claim 1, characterized in that: The specific method of obtaining the fighting factor of each cow according to the distribution of corner points in the grayscale image of the herd at the current moment includes: The first All the corner points of the grayscale image of the cattle herd at the current moment are input into the trained neural network to obtain the All the head corner points and all the body corner points of a cow in the grayscale image of the herd at the current moment; Preset two combat parameters and , will The centroid position of the area formed by all the head corner points of the cattle herd grayscale image at the current moment is recorded as The head position coordinates of the first cow; The centroid position of the area formed by all the body corner points of the cattle in the grayscale image of the cattle at the current moment is recorded as The body position coordinates of the first cow; The ordinate of the head position coordinate of the first cow is greater than or equal to The ordinate of the body position of the cow, the fighting parameter As the The fighting factor of the cows; The vertical coordinate of the head position of the first cow is smaller than that of the The ordinate of the body position of the cow, the fighting parameter As the The fighting factor of a cow.
7. The method for monitoring livestock breeding status based on machine vision according to claim 1, characterized in that: The method of obtaining the possibility of fighting among the cattle herd by analyzing the positional relationship between the cattle with strong movement desire and the surrounding cattle in the grayscale image of the cattle herd at the current acquisition moment, as well as the fighting factor and the degree of movement desire, includes the following specific methods: By analyzing the positional relationship between the cattle with strong movement desire and the surrounding cattle in the grayscale image of the cattle herd at the current acquisition moment, the target cattle of each cattle with strong movement desire is obtained; The first The actual distance between the bull with strong desire to exercise and its target bull is recorded as the first distance; The ratio of the movement desire of the cow with the strongest movement desire to the first distance is recorded as the struggle possibility factor; The fighting factors, fighting potential factors and the first The fighting factor of the target bull with strong desire for exercise is the normalized value of the product of these three factors. Only the strong desire for exercise cattle is risky to fight; The average of the fighting risks of all cattle with strong desire for exercise is taken as the possibility of fighting in the herd.
8. The method for monitoring livestock breeding status based on machine vision according to claim 7, characterized in that: The specific method of obtaining the target cow of each cow with strong movement desire by analyzing the position relationship between the cows with strong movement desire and the surrounding cows in the grayscale image of the cow herd at the current acquisition moment includes: The grayscale image of the cattle herd at the current acquisition moment The Euclidean distance between the body position coordinates of the cow with strong desire to exercise and the body position coordinates of any other cow is recorded as The actual distance between the cow with strong desire to move and the cow; in the grayscale image of the herd at the current acquisition time, except for the first For all the cows except the one with the strongest desire to move, the cow with the smallest actual distance is taken as the first Only target cattle with strong desire for exercise.
9. The method for monitoring livestock breeding status based on machine vision according to claim 1, characterized in that: The risk fighting monitoring of cattle in the breeding farm based on the possibility of fighting among cattle includes the following specific methods: Preset a threshold parameter , if the mean value of the fighting risk of all cattle with strong desire to move in the grayscale image of the herd at the current acquisition time is greater than or equal to the threshold parameter , then the state of risk fighting among cattle in the farm is recorded as an abnormal state.
Citation Information
Patent Citations
Target monitoring method and device, storage medium and electronic device
CN113723355A
Beef cattle abnormal behavior video time sequence positioning method based on time offset loss
CN117649699A
Cow abnormal behavior detection method based on remote monitoring
CN117831136A
Method for identifying abnormal behaviors of sheep flock
CN118658210A
Animal health and safety monitoring
US20220159934A1