A method and device for recognizing a limping behavior of sheep based on an indoor camera
By using an indoor camera-based method for recognizing lameness in sheep, image processing and motion analysis are employed to automatically identify lameness behavior. This solves the problems of low efficiency, low accuracy, and difficulty in wearing sensors in traditional methods, achieving efficient and accurate monitoring of lameness in sheep.
Patent Information
- Application Number
- CN202510686513.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2045-05-27
AI Technical Summary
Existing methods for detecting lameness in sheep are inefficient and inaccurate, and the sensors are prone to falling off and require regular maintenance, making it difficult to achieve real-time and accurate monitoring in large-scale farming scenarios.
An indoor camera-based method for recognizing lameness in sheep is adopted. By collecting gait image sequences, motion blur suppression processing and key motion point recognition are performed. The landing interval of the left and right limbs and the symmetry index are calculated to achieve automated recognition.
It improves the efficiency and accuracy of sheep lameness identification, avoids the problems caused by wearing sensors, and realizes efficient, contactless automated monitoring of sheep.
Smart Images

Figure CN120635979B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a method and apparatus for recognizing lameness in sheep based on an indoor camera. Background Technology
[0002] With the development of large-scale sheep farming, lameness in sheep has become a key factor restricting farming efficiency due to its potential to trigger chain reactions such as stunted growth and decreased fertility. Traditional sheep lameness detection relies on manual inspection, with farmers judging by observing the sheep's walking posture and hoof appearance. This method is not only inefficient and labor-intensive, but also susceptible to the influence of human experience and subjective factors, making it difficult to achieve real-time and accurate monitoring.
[0003] Existing technologies assess lameness by collecting limb movement data using devices such as pressure sensors and inertial sensors attached to sheep's legs. Some studies have used accelerometers to monitor sheep's movement, but these methods suffer from problems such as sensor detachment, the need for regular maintenance, and stress on sheep, making them unsuitable for large-scale farming. Therefore, there is an urgent need to develop an automated identification method that is suitable for indoor farming environments, highly efficient, and highly accurate. Summary of the Invention
[0004] This invention provides a method and device for recognizing lame behavior in sheep based on an indoor camera, the main purpose of which is to solve the problems of low efficiency and low accuracy of existing sheep lame behavior recognition methods.
[0005] To achieve the above objectives, the present invention provides a method for recognizing lameness behavior in sheep based on an indoor camera, comprising:
[0006] Using a pre-set indoor camera, gait images of the target sheep are collected at pre-set time intervals to obtain a gait image sequence;
[0007] The gait image sequence is subjected to motion blur suppression processing to obtain a blurred image sequence;
[0008] Motion key point recognition is performed on the blurred and suppressed image sequence to obtain key point recognition data;
[0009] Based on the key point recognition data, the left and right limbs landing intervals are identified in the blurred and suppressed image sequence to obtain a landing interval time series.
[0010] The symmetry index is calculated based on the aforementioned time series of drop-off intervals.
[0011] Based on the symmetry index, the lameness behavior of the target sheep is identified, and the identification result is obtained.
[0012] Optionally, the step of performing motion keypoint recognition on the blurred and suppressed image sequence to obtain keypoint recognition data includes:
[0013] The blurred and suppressed image sequence is subjected to limb edge recognition to obtain limb edge data;
[0014] Based on the limb edge data, the bottom edges of the blurred and suppressed image sequence are marked to obtain a bottom edge image sequence;
[0015] Set the same ground reference line for each image in the bottom edge image sequence, and obtain the vertical distance between the bottom edge of each image in the bottom edge image sequence and the ground reference line to obtain a distance data sequence;
[0016] Motion key point identification is performed on the bottom edge image sequence based on the distance data sequence.
[0017] Optionally, the step of performing motion keypoint recognition on the bottom edge image sequence based on the distance data sequence includes:
[0018] The bottom edge image sequence is divided into four limb regions to obtain four sets of single limb bottom edge image sequences;
[0019] Based on the distance data sequence, identify the region in each group of single limb bottom edge image sequences in which the vertical distance between the bottom edge and the ground reference line remains continuously unchanged, and obtain multiple groups of ground contact image sequences;
[0020] The first frame of each ground-touch image sequence is identified as the ground-touch key point image, and the last frame of each ground-touch image sequence is identified as the ground-lift key point image.
[0021] All images of ground-contact key points and images of ground-free key points are combined to obtain the key point recognition data.
[0022] Optionally, the step of identifying the left and right limb landing intervals in the blurred and suppressed image sequence based on the key point recognition data to obtain a landing interval time series includes:
[0023] The blurred image sequence is divided into gait cycles based on a preset periodic interval to obtain gait cycle sequence data.
[0024] Based on the key point recognition data and the gait cycle sequence data, the left and right limb low-interval identification is performed on the blurred suppressed image sequence to obtain the left limb low-interval sequence and the right limb low-interval sequence.
[0025] The time difference between the left and right limbs is calculated based on the left limb landing low-interval sequence and the right limb landing interval sequence to obtain the time difference sequence.
[0026] Calculate the variance of the time difference sequence to obtain the sequence variance;
[0027] Determine whether the variance of the sequence is greater than a preset variance threshold;
[0028] If the sequence variance is greater than the variance threshold, then the preset period interval is adjusted, and the step of dividing the blur-suppressed image sequence into gait periods based on the preset period interval to obtain gait period sequence data is returned.
[0029] If the variance of the sequence is less than or equal to the variance threshold, then the left limb landing low interval sequence and the right limb landing interval sequence are summarized to obtain gait cycle sequence data.
[0030] Optionally, calculating the symmetry index based on the landing-to-ground interval time series includes:
[0031] Based on the time sequence of hoof landing intervals, the time interval between each hoof landing of the target sheep was identified, resulting in four sets of hoof landing interval sequences.
[0032] The left and right limb coordination index was calculated based on the four sets of sheep hoof drop-off interval sequences.
[0033] The symmetry index is calculated based on the left and right limb coordination index.
[0034] Optionally, the formula for calculating the left and right limb coordination index is as follows:
[0035]
[0036] Among them, K LR The left-right limb coordination index is denoted by M, where M represents the number of samples in each of the four hoof-drop interval sequences, and T represents the number of samples in each hoof-drop interval sequence. LF,i T represents the i-th time interval in the left forelimb drop-off interval sequence included in the four sets of hoof drop-off interval sequences. RB,i T represents the i-th time interval in the right hind limb drop-off interval sequence included in the four sets of hoof drop-off interval sequences. RF,i T represents the i-th time interval in the right forelimb drop-off interval sequence included in the four sets of hoof drop-off interval sequences. LB,i This represents the i-th time interval in the left hind limb drop-off interval sequence included in the four sets of hoof drop-off interval sequences.
[0037] Optionally, the formula for calculating the symmetry index is as follows:
[0038]
[0039] Where M is the symmetry index, K LR K is the left-right limb coordination index. max α is the preset maximum left-right limb coordination index, γ is the preset coordination index weight, γ is the preset periodic variance weight, N is the sample size of a single hoof-drop interval sequence in the four sets of hoof-drop interval sequences, and T is the maximum left-right limb coordination index. j,k This represents the j-th hoof-drop interval data in the k-th hoof-drop interval sequence of the four sets of hoof-drop interval sequences. This represents the mean of the k-th hoof-drop interval sequence among the four hoof-drop interval sequences.
[0040] Optionally, the step of identifying lameness behavior in the target sheep based on the symmetry index to obtain the identification result includes:
[0041] The symmetry index is normalized to obtain the normalized symmetry index;
[0042] Determine whether the normalized symmetry exponent is greater than a preset exponent threshold;
[0043] If the normalized symmetry index is greater than the index threshold, then it is confirmed that the target sheep does not exhibit lameness behavior.
[0044] If the normalized symmetry index is less than or equal to the index threshold, then the fuzzy suppressed image sequence is subjected to sheep lame gait period recognition to obtain the recognition result.
[0045] Optionally, the step of performing sheep lameness gait periodicity recognition on the blurred and suppressed image sequence to obtain the recognition result includes:
[0046] The landing-off interval time series is divided into multiple periods to obtain multiple sets of landing-off interval periodic series;
[0047] Calculate the symmetry index of each set of periodic sequences with varying distances from the ground to obtain the symmetry index of the periodic sequences;
[0048] The periodic sequence of sheep lameness at ground level was confirmed based on the symmetry index of the periodic sequence.
[0049] Based on the periodic sequence of sheep lameness distance from the ground, the blurred suppressed image sequence is used to perform sheep lameness frame image recognition to obtain the recognition result.
[0050] To address the aforementioned problems, this invention also provides a sheep lameness recognition device based on an indoor camera. The device includes a data acquisition module, a data calculation module, an edge detection module, an edge fitting module, and a quantity generation module, wherein:
[0051] The image acquisition module is used to acquire gait images of the target sheep at preset time intervals using a preset indoor camera, and obtain a gait image sequence.
[0052] The blur suppression module is used to perform motion blur suppression processing on the gait image sequence to obtain a blur suppressed image sequence;
[0053] The key point recognition module is used to perform motion key point recognition on the blurred and suppressed image sequence to obtain key point recognition data;
[0054] The landing interval recognition module is used to recognize the left and right limb landing intervals of the blurred and suppressed image sequence based on the key point recognition data, so as to obtain a landing interval time series.
[0055] The sheep lameness behavior recognition module is used to calculate a symmetry index based on the time series of the time interval between the fall and the ground, and to recognize the lameness behavior of the target sheep based on the symmetry index, thereby obtaining the recognition result.
[0056] This invention acquires gait image sequences of target sheep using an indoor camera, and combines motion blur suppression technology to effectively eliminate image blur caused by the sheep's rapid movement, improving image clarity and key point recognition accuracy. By calibrating with ground reference lines and marking the bottom edges of the limbs, it accurately identifies touch-and-leave key frames, generating key point data and achieving a quantitative conversion from image to motion parameters. Based on the time series of the left and right limbs' landing and leaving the ground, a symmetry index calculation model is proposed, combining the left and right limb coordination index with period variance weights to objectively quantify the symmetry of limb movement, overcoming the subjective limitations of traditional manual observation. By adjusting the gait period division threshold in a closed loop, the stability of the time series is ensured, further improving recognition reliability. This invention does not require contact with the sheep, avoiding stress reactions and equipment maintenance problems. Through fully automated processing, it significantly improves the efficiency and accuracy of lameness recognition. Attached Figure Description
[0057] Figure 1 This is a flowchart illustrating a method for recognizing lameness in sheep based on an indoor camera, according to an embodiment of the present invention.
[0058] Figure 2 This is a functional block diagram of a sheep lameness recognition device based on an indoor camera, provided in an embodiment of the present invention.
[0059] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0060] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0061] This application provides a method for recognizing lameness in sheep based on an indoor camera. The executing entity of this method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cluster of cloud servers. The server can be an independent server or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0062] Reference Figure 1 The diagram shown is a flowchart illustrating a sheep lameness recognition method based on an indoor camera according to an embodiment of the present invention. In this embodiment, the sheep lameness recognition method based on an indoor camera includes:
[0063] S1. Use a preset indoor camera to collect gait images of the target sheep at preset time intervals to obtain a gait image sequence.
[0064] In this embodiment of the invention, the target sheep refers to the sheep selected as the monitoring object, and its identity information is confirmed when gait images are collected by wearing an identification ring.
[0065] In this embodiment of the invention, the preset time interval can be 0.1 seconds.
[0066] In detail, the preset time interval needs to be set according to the recognition accuracy requirements. The shorter the time interval, the higher the accuracy of the obtained gait image sequence, and the higher the accuracy of subsequent sheep lameness recognition, but the higher the requirements for device performance and storage space.
[0067] In this embodiment of the invention, a preset indoor camera is used to collect gait images of a target sheep at preset time intervals to obtain a gait image sequence. The gait images of the target sheep can be obtained when the target sheep passes through a preset passage in the farm.
[0068] Specifically, each sheep wears an identification ring, and the identity of the target sheep can be confirmed by scanning the identification ring when passing through the preset channel.
[0069] S2. Perform motion blur suppression processing on the gait image sequence to obtain a blurred image sequence.
[0070] In this embodiment of the invention, the motion blur suppression processing of the gait image sequence to obtain a blurred image sequence can be performed using a blind deconvolution algorithm based on deep learning. First, a dataset containing a large number of normal and blurred gait image pairs is constructed. A convolutional neural network (CNN) is used to train a model, enabling it to learn the mapping relationship from blurred images to clear images. The trained model can process the gait image sequence frame by frame, adaptively adjusting the deblurring parameters by analyzing the motion trajectory and blur level of pixels in the image, quickly restoring image details. Alternatively, a method combining nonlocal mean filtering and sparse representation can be used. First, nonlocal mean filtering is used to perform preliminary noise reduction on the blurred image, and then the sparse representation model extracts image features to reconstruct a clear image. The combination of these two methods can effectively remove motion blur caused by the rapid movement of sheep, preserving image edge and texture information, resulting in a blurred image sequence, providing high-quality image data for subsequent sheep lameness recognition.
[0071] In detail, the deep learning-based blind deconvolution algorithm trains a convolutional neural network (CNN) model using a dataset consisting of a large number of normal and blurred gait image pairs. This model learns the mapping relationship from blurred to clear images, analyzes pixel motion trajectories and blur levels during image processing, adaptively adjusts deblurring parameters, and restores image details.
[0072] In this embodiment of the invention, by performing motion blur suppression processing on the gait image sequence to obtain a blurred and suppressed image sequence, the accuracy of subsequent sheep lameness behavior recognition can be improved.
[0073] S3. Perform motion key point recognition on the blurred and suppressed image sequence to obtain key point recognition data.
[0074] In this embodiment of the invention, the motion key point recognition refers to identifying the key time points when the target sheep's limbs touch the ground and the key time points when it leaves the ground in the blurred and suppressed image sequence.
[0075] In this embodiment of the invention, the step of performing motion keypoint recognition on the blurred and suppressed image sequence to obtain keypoint recognition data includes:
[0076] The blurred and suppressed image sequence is subjected to limb edge recognition to obtain limb edge data;
[0077] Based on the limb edge data, the bottom edges of the blurred and suppressed image sequence are marked to obtain a bottom edge image sequence;
[0078] Set the same ground reference line for each image in the bottom edge image sequence, and obtain the vertical distance between the bottom edge of each image in the bottom edge image sequence and the ground reference line to obtain a distance data sequence;
[0079] Motion key point identification is performed on the bottom edge image sequence based on the distance data sequence.
[0080] In detail, the limb edge recognition of the blurred and suppressed image sequence refers to identifying the edge contours of the sheep's limbs in the blurred and suppressed image sequence and obtaining limb edge data for subsequent analysis.
[0081] In this embodiment of the invention, the step of identifying motion key points in the bottom edge image sequence based on the distance data sequence includes:
[0082] The bottom edge image sequence is divided into four limb regions to obtain four sets of single limb bottom edge image sequences;
[0083] Based on the distance data sequence, identify the region in each group of single limb bottom edge image sequences in which the vertical distance between the bottom edge and the ground reference line remains continuously unchanged, and obtain multiple groups of ground contact image sequences;
[0084] The first frame of each ground-touch image sequence is identified as the ground-touch key point image, and the last frame of each ground-touch image sequence is identified as the ground-lift key point image.
[0085] All images of ground-contact key points and images of ground-free key points are combined to obtain the key point recognition data.
[0086] In detail, the division of the four limbs refers to dividing the bottom edge image sequence into four intervals according to the sheep's four limbs, resulting in four sets of single limb bottom edge image sequences corresponding to the left forelimb, left hindlimb, right forelimb, and right hindlimb, respectively.
[0087] In this embodiment of the invention, by performing motion key point recognition on the blurred and suppressed image sequence to obtain key point recognition data, the accuracy of subsequent recognition of the left and right limb landing interval can be improved.
[0088] S4. Based on the key point recognition data, identify the left and right limb landing intervals in the blurred and suppressed image sequence to obtain the landing interval time series.
[0089] In this embodiment of the invention, identifying the left and right limb landing intervals of the blurred and suppressed image sequence based on the key point recognition data refers to identifying the time taken for a sheep's hoof to land and then leave the ground in the blurred and suppressed image sequence based on the key point recognition data, which is used to analyze the coordination of the sheep's left and right limb movements.
[0090] In this embodiment of the invention, the step of identifying the left and right limb landing intervals based on the key point recognition data to obtain a landing interval time series includes:
[0091] The blurred image sequence is divided into gait cycles based on a preset periodic interval to obtain gait cycle sequence data.
[0092] Based on the key point recognition data and the gait cycle sequence data, the left and right limb low-interval identification is performed on the blurred suppressed image sequence to obtain the left limb low-interval sequence and the right limb low-interval sequence.
[0093] The time difference between the left and right limbs is calculated based on the left limb landing low-interval sequence and the right limb landing interval sequence to obtain the time difference sequence.
[0094] Calculate the variance of the time difference sequence to obtain the sequence variance;
[0095] Determine whether the variance of the sequence is greater than a preset variance threshold;
[0096] If the sequence variance is greater than the variance threshold, then the preset period interval is adjusted, and the step of dividing the blur-suppressed image sequence into gait periods based on the preset period interval to obtain gait period sequence data is returned.
[0097] If the variance of the sequence is less than or equal to the variance threshold, then the left limb landing low interval sequence and the right limb landing interval sequence are summarized to obtain gait cycle sequence data.
[0098] In this embodiment of the invention, the gait period is divided into the blurred and suppressed image sequence based on the key point recognition data to obtain gait period sequence data.
[0099] In detail, calculating the time difference between the left and right limbs landing based on the left limb landing low interval sequence and the right limb landing interval sequence means subtracting the interval data in the left limb landing low interval sequence from the interval data in the right limb landing interval sequence and taking the absolute value.
[0100] In this embodiment of the invention, by identifying the left and right limb landing intervals in the blurred and suppressed image sequence based on the key point recognition data, a landing interval time series can be obtained, which can improve the accuracy of subsequent calculation of the symmetry index.
[0101] S5. Calculate the symmetry index based on the time series of the drop-off interval.
[0102] In this embodiment of the invention, the symmetry index is a coefficient representing the consistency of the time interval between each time a sheep's hoof leaves the ground.
[0103] In this embodiment of the invention, calculating the symmetry index based on the landing-to-ground interval time series includes:
[0104] Based on the time sequence of hoof landing intervals, the time interval between each hoof landing of the target sheep was identified, resulting in four sets of hoof landing interval sequences.
[0105] The left and right limb coordination index was calculated based on the four sets of sheep hoof drop-off interval sequences.
[0106] The symmetry index is calculated based on the left and right limb coordination index.
[0107] In detail, the four sets of hoof-drop interval sequences include the left forelimb drop-off interval sequence, the left hindlimb drop-off interval sequence, the right forelimb drop-off interval sequence, and the right hindlimb drop-off interval sequence.
[0108] In detail, the left-right limb coordination index is an index used to measure the coordination of sheep's left and right limb movements. Its calculation formula takes into account the differences in the time interval between the landing of the left forelimb and the right hindlimb, and between the right forelimb and the left hindlimb, and is calculated by weighted averaging.
[0109] In detail, the formula for calculating the left and right limb coordination index is as follows:
[0110]
[0111] Among them, K LR The left-right limb coordination index is denoted by M, where M represents the number of samples in each of the four hoof-drop interval sequences, and T represents the number of samples in each hoof-drop interval sequence. LF,i T represents the i-th time interval in the left forelimb drop-off interval sequence included in the four sets of hoof drop-off interval sequences. RB,i T represents the i-th time interval in the right hind limb drop-off interval sequence included in the four sets of hoof drop-off interval sequences. RF,i T represents the i-th time interval in the right forelimb drop-off interval sequence included in the four sets of hoof drop-off interval sequences. LB,i This represents the i-th time interval in the left hind limb drop-off interval sequence included in the four sets of hoof drop-off interval sequences.
[0112] In detail, the formula for calculating the symmetry index is as follows:
[0113]
[0114] Where M is the symmetry index, K LRK is the left-right limb coordination index. max α is the preset maximum left-right limb coordination index, γ is the preset coordination index weight, γ is the preset periodic variance weight, N is the sample size of a single hoof-drop interval sequence in the four sets of hoof-drop interval sequences, and T is the maximum left-right limb coordination index. j, This represents the j-th hoof-drop interval data in the k-th hoof-drop interval sequence of the four sets of hoof-drop interval sequences. This represents the mean of the k-th hoof-drop interval sequence among the four hoof-drop interval sequences.
[0115] In this embodiment of the invention, by calculating the symmetry index based on the time series of the drop-off interval, the accuracy of identifying lameness behavior in target sheep can be improved.
[0116] S6. Based on the symmetry index, identify the lameness behavior of the target sheep and obtain the identification result.
[0117] In this embodiment of the invention, the step of identifying lameness behavior in the target sheep based on the symmetry index to obtain the identification result includes:
[0118] The symmetry index is normalized to obtain the normalized symmetry index;
[0119] Determine whether the normalized symmetry exponent is greater than a preset exponent threshold;
[0120] If the normalized symmetry index is greater than the index threshold, then it is confirmed that the target sheep does not exhibit lameness behavior.
[0121] If the normalized symmetry index is less than or equal to the index threshold, then the fuzzy suppressed image sequence is subjected to sheep lame gait period recognition to obtain the recognition result.
[0122] In detail, the normalization process refers to mapping the data to the range [0,1].
[0123] In detail, the step of performing sheep lameness gait periodicity recognition on the blurred and suppressed image sequence to obtain the recognition result includes:
[0124] The landing-off interval time series is divided into multiple periods to obtain multiple sets of landing-off interval periodic series;
[0125] Calculate the symmetry index of each set of periodic sequences with varying distances from the ground to obtain the symmetry index of the periodic sequences;
[0126] The periodic sequence of sheep lameness at ground level was confirmed based on the symmetry index of the periodic sequence.
[0127] Based on the periodic sequence of sheep lameness distance from the ground, the blurred suppressed image sequence is used to perform sheep lameness frame image recognition to obtain the recognition result.
[0128] In detail, the step of dividing the landing-off interval time series into multiple periods can be done by dividing the landing-off interval time series into ten gait interval sequences as one period.
[0129] In detail, the method for calculating the symmetry index of each set of ground-to-ground interval periodic sequences is the same as the method for calculating the symmetry index based on the ground-to-ground interval time sequence, and will not be repeated here.
[0130] In detail, the step of performing sheep lameness frame image recognition on the blurred suppressed image sequence based on the sheep lameness ground-leaning interval periodic sequence involves analyzing the blurred suppressed image sequence based on the determined sheep lameness ground-leaning interval periodic sequence, identifying frame images containing sheep lameness behavior, and obtaining the final recognition result.
[0131] like Figure 2 The diagram shown is a functional block diagram of a sheep lameness recognition device based on an indoor camera provided in an embodiment of the present invention.
[0132] The sheep lameness recognition device 100 based on an indoor camera described in this invention can be installed in an electronic device. Depending on the functions implemented, the sheep lameness recognition device 100 may include an image acquisition module 101, a blur suppression module 102, a key point recognition module 103, a drop-off-ground interval recognition module 104, and a sheep lameness recognition module 105. The module described in this invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and which are stored in the memory of the electronic device.
[0133] In this embodiment, the functions of each module / unit are as follows:
[0134] The image acquisition module 101 is used to acquire gait images of the target sheep using a preset indoor camera at preset time intervals to obtain a gait image sequence.
[0135] The blur suppression module 102 is used to perform motion blur suppression processing on the gait image sequence to obtain a blurred suppressed image sequence.
[0136] The key point recognition module 103 is used to perform motion key point recognition on the blurred suppressed image sequence to obtain key point recognition data.
[0137] The landing interval recognition module 104 is used to perform left and right limb landing interval recognition on the blurred and suppressed image sequence based on the key point recognition data to obtain a landing interval time sequence.
[0138] The sheep lameness behavior recognition module 105 is used to calculate a symmetry index based on the time series of the time interval between the fall and the ground, and to recognize the lameness behavior of the target sheep based on the symmetry index to obtain the recognition result.
[0139] In detail, the modules described in the indoor camera-based sheep lameness recognition system 100 in this embodiment of the invention employ the same methods as described above. Figure 1 The method used is the same as the indoor camera-based sheep lameness recognition method described above, and can produce the same technical effect, so it will not be repeated here.
[0140] In the embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.
[0141] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0142] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0143] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0144] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.
[0145] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application devices that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0146] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for recognizing a lameness behavior of a sheep based on an indoor camera, characterized in that, The method comprises: acquiring gait images of the target sheep according to a preset time interval by using a preset indoor camera to obtain a gait image sequence; performing motion blur suppression processing on the gait image sequence to obtain a blur suppression image sequence; performing four-limb edge recognition on the blur suppression image sequence to obtain four-limb edge data, marking the bottom edge of the blur suppression image sequence according to the four-limb edge data to obtain a bottom edge image sequence, setting the same ground reference line for each image in the bottom edge image sequence, obtaining the vertical distance between the bottom edge of each image in the bottom edge image sequence and the ground reference line to obtain a distance data sequence, and performing motion key point recognition on the bottom edge image sequence according to the distance data sequence; dividing the blur suppression image sequence into gait cycles based on a preset cycle interval to obtain gait cycle sequence data, identifying left and right limb take-off and landing intervals of the blur suppression image sequence according to the key point recognition data and the gait cycle sequence data to obtain a left limb take-off and landing interval sequence and a right limb take-off and landing interval sequence, calculating the time difference between the left and right limb take-off and landing intervals according to the left limb take-off and landing interval sequence and the right limb take-off and landing interval sequence to obtain a time difference sequence, calculating the variance of the time difference sequence to obtain a sequence variance, and judging whether the sequence variance is greater than a preset variance threshold; if the sequence variance is greater than the variance threshold, adjusting the preset cycle interval and returning to the step of dividing the blur suppression image sequence into gait cycles based on the preset cycle interval to obtain gait cycle sequence data; if the sequence variance is less than or equal to the variance threshold, then the left limb take-off and landing interval sequence and the right limb take-off and landing interval sequence are summarized to obtain a take-off and landing interval time sequence; identifying the take-off and landing time interval of each hoof of the target sheep according to the take-off and landing interval time sequence to obtain four groups of sheep hoof take-off and landing interval sequences, and calculating a left and right limb coordination index according to the four groups of sheep hoof take-off and landing interval sequences, wherein the calculation formula of the left and right limb coordination index is as follows: ; ; wherein, is the left-right limb coordination index, represents the number of samples of each of the four sets of hoof contact interval sequences, represents the time interval number in the left front limb contact interval sequence contained in the four sets of hoof contact interval sequences, represents the time interval number in the right rear limb contact interval sequence contained in the four sets of hoof contact interval sequences, represents the time interval number in the right front limb contact interval sequence contained in the four sets of hoof contact interval sequences, represents the time interval number in the left rear limb contact interval sequence contained in the four sets of hoof contact interval sequences, is a ratio factor, is an arc tangent function, () represents taking the larger value in the parentheses, represents taking the smaller value in the parentheses; calculating a symmetry index according to the left and right limb coordination index, wherein the calculation formula of the symmetry index is as follows: ; in, The symmetry index is... The left and right limb coordination index. The preset maximum left and right limb coordination index, The pre-defined coordination index weights, The preset periodic variance weights, The number of samples in a single hoof-drop-off-ground interval sequence among the four sets of hoof-drop-off-ground interval sequences. This indicates the sequence of the four sets of hoof-drop intervals. In the sequence of sheep hoof landing intervals, the first... Data on the distance from the landing point, This indicates the sequence of the four sets of hoof-drop intervals. Mean of the sequence of sheep hoof landing intervals; performing lameness behavior recognition on the target sheep according to the symmetry index to obtain a recognition result. 2.The indoor camera-based lameness behavior recognition method of claim 1, wherein, The motion key point recognition of the bottom edge image sequence according to the distance data sequence comprises: dividing the bottom edge image sequence into four-limb interval to obtain four groups of single-limb bottom edge image sequences; identifying the area where the vertical distance between the bottom edge and the ground reference line in each group of single-limb bottom edge image sequence remains unchanged according to the distance data sequence to obtain multiple groups of touch-ground image sequences; confirming the first frame image of each group of touch-ground image sequence as a touch-ground key point image, and confirming the last frame image of each group of touch-ground image sequence as a take-off key point image; summarizing all touch-ground key point images and take-off key point images to obtain the key point recognition data. 3.The indoor camera-based lameness behavior recognition method of claim 1, wherein, The target sheep is identified according to the symmetry index to obtain an identification result, and the identification result comprises: The symmetry index is normalized to obtain a normalized symmetry index; It is judged whether the normalized symmetry index is greater than the preset index threshold value; If the normalized symmetry index is greater than the index threshold value, it is confirmed that the target sheep has no lameness behavior; If the normalized symmetry index is less than or equal to the index threshold value, the fuzzy suppression image sequence is identified for a lameness gait cycle to obtain an identification result. 4.The indoor camera-based lameness behavior recognition method of claim 1, wherein, The fuzzy suppression image sequence is identified for a lameness gait cycle to obtain an identification result, and the identification result comprises: The landing-ground interval time sequence is divided into multiple cycles to obtain multiple sets of landing-ground interval cycle sequences; The symmetry index of each set of landing-ground interval cycle sequences is calculated to obtain a cycle sequence symmetry index; The lameness landing-ground interval cycle sequence is confirmed according to the cycle sequence symmetry index; The fuzzy suppression image sequence is identified for a lameness frame image according to the lameness landing-ground interval cycle sequence to obtain an identification result.
5. A system for recognizing the lameness behavior of sheep based on an indoor camera, characterized by, The system comprises an image acquisition module, a fuzzy suppression module, a key point identification module, a landing-ground interval identification module, and a lameness behavior identification module, wherein: The image acquisition module is configured to acquire gait images of a target sheep at a preset time interval by using a preset indoor camera to obtain a gait image sequence; The fuzzy suppression module is configured to perform motion blur suppression processing on the gait image sequence to obtain a fuzzy suppression image sequence; The key point identification module is configured to identify limb edges of the fuzzy suppression image sequence to obtain limb edge data, mark the bottom edges of the fuzzy suppression image sequence according to the limb edge data to obtain a bottom edge image sequence, set the same ground reference line for each image in the bottom edge image sequence, obtain the vertical distance between the bottom edge in each image in the bottom edge image sequence and the ground reference line to obtain a distance data sequence, and identify motion key points of the bottom edge image sequence according to the distance data sequence. The fall-off-ground interval identification module is configured to divide the sequence of blur-reduced images into gait cycle sequence data based on a preset cycle interval, identify left and right limb fall-off-ground intervals of the sequence of blur-reduced images based on the key point identification data and the gait cycle sequence data, obtain a left limb fall-off-ground interval sequence and a right limb fall-off-ground interval sequence, calculate a left and right limb fall-off-ground time difference based on the left limb fall-off-ground interval sequence and the right limb fall-off-ground interval sequence, obtain a time difference sequence, calculate a sequence variance of the time difference sequence, obtain a sequence variance, determine whether the sequence variance is greater than a preset variance threshold, if the sequence variance is greater than the variance threshold, adjust the preset cycle interval, and return to the step of dividing the sequence of blur-reduced images into gait cycle sequence data based on the preset cycle interval, if the sequence variance is less than or equal to the variance threshold, aggregate the left limb fall-off-ground interval sequence and the right limb fall-off-ground interval sequence, and obtain a fall-off-ground interval time sequence; The sheep lameness behavior identification module is configured to identify fall-off-ground time intervals of each hoof of the target sheep based on the fall-off-ground interval time sequence, obtain four groups of sheep hoof fall-off-ground interval sequences, calculate a left and right limb coordination index based on the four groups of sheep hoof fall-off-ground interval sequences, and calculate a symmetry index based on the left and right limb coordination index. ; ; in, The left and right limb coordination index. This indicates the number of samples in each of the four groups of hoof-drop-off-ground interval sequences. This indicates the left forelimb landing interval sequence included in the four sets of hoof landing interval sequences. A time interval, This indicates the right hind limb landing interval sequence included in the four sets of hoof landing interval sequences. A time interval, This indicates the right forelimb landing interval sequence included in the four sets of hoof landing interval sequences. A time interval, This indicates the left hind limb drop-off interval sequence included in the four sets of hoof drop-off interval sequences. A time interval, As a ratio factor, It is the arctangent function. () indicates taking the larger value within the parentheses. This indicates taking the smaller value within the parentheses; The sheep lameness behavior identification module is configured to identify fall-off-ground time intervals of each hoof of the target sheep based on the fall-off-ground interval time sequence, obtain four groups of sheep hoof fall-off-ground interval sequences, calculate a left and right limb coordination index based on the four groups of sheep hoof fall-off-ground interval sequences, and calculate a symmetry index based on the left and right limb coordination index. ; in, The symmetry index is... The left and right limb coordination index. The preset maximum left and right limb coordination index, The pre-defined coordination index weights, The preset periodic variance weights, The number of samples in a single hoof-drop-off-ground interval sequence among the four sets of hoof-drop-off-ground interval sequences. This indicates the sequence of the four sets of hoof-drop intervals. In the sequence of sheep hoof landing intervals, the first... Data on the distance from the landing point, This indicates the sequence of the four sets of hoof-drop intervals. Mean of the sequence of sheep hoof landing intervals; The sheep lameness behavior identification module is configured to identify fall-off-ground time intervals of each hoof of the target sheep based on the fall-off-ground interval time sequence, obtain four groups of sheep hoof fall-off-ground interval sequences, calculate a left and right limb coordination index based on the four groups of sheep hoof fall-off-ground interval sequences, and calculate a symmetry index based on the left and right limb coordination index. The sheep lameness behavior identification module is configured to identify fall-off-ground time intervals of each hoof of the target sheep based on the fall-off-ground interval time sequence, obtain four groups of sheep hoof fall-off-ground interval sequences, calculate a left and right limb coordination index based on the four groups of sheep hoof fall-off-ground interval sequences, and calculate a symmetry index based on the left and right limb coordination index.
Citation Information
Patent Citations
Dairy cow early limp recognition method and device
CN112293295A
Gait evaluation method and system based on multiple parameters
CN112957034A