Animal body temperature intelligent detection method for animal husbandry and veterinary medicine

Through video frame processing and neural network segmentation technology, accurately judge the pigs to which the pig ear belongs, solving the problem of low detection accuracy when pig ears overlap in the existing technology, and improving the accuracy of intelligent detection of animal body temperature.

CN119888798AActive Publication Date: 2025-04-25SHENZHEN CHENGCHENG HIGH-TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510378310.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-04-25
Estimated Expiration
2045-03-28

AI Technical Summary

Technical Problem

The existing pig body temperature detection methods are difficult to accurately determine the pig to which each pig ear belongs when multiple pig ears overlap, resulting in a decrease in the accuracy of intelligent animal body temperature detection.

Method used

By obtaining the video frames at each moment when the pigs enter and exit the feeding farm, the pig ear root area and the pig face area are divided using the segmentation neural network, and combining the temperature values ​​corresponding to each pixel point in the video frame, the temperature values ​​corresponding to each pig face area in the video frame at each moment are determined.

Benefits of technology

By analyzing the pig's movement characteristics and the positional relationship between the pig's face and the ear root, the accuracy of judging the pig's ear belongs to, thereby improving the accuracy of intelligent detection of animal body temperature in animal husbandry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888798A_ABST
    Figure CN119888798A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image data processing, in particular to an animal body temperature intelligent detection method for animal husbandry and veterinary medicine, which comprises the following steps: acquiring video frames at each moment when a pig herd enters and exits from a feeding farm, and calculating the body temperature of the pig herd according to pig ear root areas and pig face areas in the video frames at continuous moments; and determining the motion state consistency between each pig ear root area and each pig face area at adjacent moments, and the position relationship consistency between each pig ear root area and each pig face area in the video frame at each moment, thereby determining the final consistency between each pig ear root area and each pig face area. And determining the temperature value corresponding to each pig face area by combining the temperature value corresponding to each pixel point in the video frame. By analyzing the movement characteristics of the pig and the position relation between the pig face and the ear root, the accuracy of judging the pig to which the ear belongs is improved, and therefore the accuracy of animal body temperature intelligent detection in the animal husbandry is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data processing, and in particular to an intelligent animal body temperature detection method for animal husbandry and veterinary medicine. Background Art

[0002] The intelligent temperature detection method for animal husbandry and veterinary use is a way to monitor and analyze animal body temperature using modern information technology and biotechnology. It can monitor animal body temperature in real time and detect health problems in a timely manner. For example: in the pig farming industry, group diseases such as swine fever can cause huge economic losses. In the early stages of the disease, there are often changes in body temperature. Therefore, the pig farming industry will prevent epidemics and diseases by detecting the body temperature of pigs. At present, the main method for detecting pig body temperature in pig farms is to detect pigs with abnormal temperatures through infrared technology, and determine pigs with abnormal temperatures based on the abnormal temperature areas on the infrared image.

[0003] Existing problem: Since the ear base is rich in blood vessels and the blood flows quickly, it can better reflect the animal's body temperature. Body temperature detection is often based on the temperature of the pig's ear base. When multiple pig ears overlap in the infrared image, it may not be possible to accurately determine which pig each pig ear belongs to, thereby reducing the accuracy of intelligent animal temperature detection. Summary of the invention

[0004] The invention provides an intelligent animal body temperature detection method for animal husbandry and veterinary medicine to solve the existing problems.

[0005] The intelligent animal body temperature detection method for animal husbandry and veterinary medicine of the present invention adopts the following technical scheme: An embodiment of the present invention provides an intelligent method for detecting animal body temperature for animal husbandry and veterinary medicine, the method comprising the following steps: Obtain video frames at every moment when the pigs enter and leave the farm; each pixel in the video frame corresponds to a temperature value; Use a segmentation neural network to segment the pig ear root area and the pig face area in the video frame at each moment; determine the consistency of the motion state of each pig ear root area and each pig face area between adjacent moments according to the changes in the centroid coordinates of the pig ear root area and the centroid coordinates of the pig face area in the video frames at adjacent moments; According to the distribution positions of the pig ear root regions and the pig facial regions in the video frames at consecutive moments, determining the consistency of the positional relationship between each pig ear root region and each pig facial region in the video frames at each moment; According to the consistency of the positional relationship between each pig ear root region and each pig facial region in the video frame at each moment and the consistency of the motion state between each pig ear root region and each pig facial region at adjacent moments, the final consistency between each pig ear root region and each pig facial region in the video frame at each moment is determined; According to the final consistency between each pig ear root area and each pig facial area in the video frame at each moment and the temperature value corresponding to each pixel point in the video frame, the temperature value corresponding to each pig facial area in the video frame at each moment is determined.

[0006] Furthermore, the determination of the consistency of the motion state of each pig ear root region and each pig face region at adjacent moments includes the following specific steps: The first The first video frame at time The pig ear root area and The pig facial regions are used as the reference pig ear root region and the reference pig facial region respectively; In the Time to During a time period of time, a target tracking algorithm is used to obtain a reference pig ear root area and a reference pig face area in a video frame at each time in the time period; wherein, is a preset time threshold; In each video frame at a certain moment, a rectangular coordinate system is constructed with the vertex at the lower left corner of the video frame as the origin, the horizontal axis to the right as the horizontal axis, and the vertical axis upward as the vertical axis; In the rectangular coordinate system of the video frame at each moment, the centroid coordinates of each pig ear root area and the centroid coordinates of each pig facial area in the video frame at each moment are obtained; Determine the consistency of the displacement between the reference pig ear root region and the reference pig face region at adjacent moments according to the distance between the centroid coordinates of the reference pig ear root region and the centroid coordinates of the reference pig face region in the video frames at adjacent moments; Determine the consistency of the displacement direction of the reference pig ear root region and the reference pig face region between adjacent moments according to a straight line of the centroid coordinates of the reference pig ear root region and a straight line of the centroid coordinates of the reference pig face region in the video frames passing through adjacent moments on a rectangular coordinate system; According to the consistency of displacement amount and displacement direction between the reference pig ear root region and the reference pig face region at adjacent moments, the consistency of motion state between the reference pig ear root region and the reference pig face region at adjacent moments is determined.

[0007] Furthermore, the determination of the displacement consistency between the reference pig ear root region and the reference pig face region at adjacent moments includes the following specific steps: Calculate the Moment and The Euclidean distance between the centroid coordinates of the reference pig ear root area in the video frame at time t is taken as the first distance, and the second distance is calculated. Moment and The Euclidean distance between the centroid coordinates of the reference pig face region in the video frame at time t is used as the second distance, and the inverse proportional normalized value of the absolute value of the difference between the first distance and the second distance is used as the distance between the reference pig ear root region and the reference pig face region at time t Moment and The consistency of displacement between moments.

[0008] Furthermore, the determination of the consistency of the displacement directions of the reference pig ear root region and the reference pig face region at adjacent moments includes the following specific steps: In the rectangular coordinate system, obtain the Moment and The straight line of the reference pig ear root area mass center coordinates in the video frame at time t is taken as the first straight line, and the straight line passing through the Moment and The straight line of the center of mass coordinates of the reference pig face region in the video frame at time t is used as the second straight line, and the normalized value of the minimum angle between the first straight line and the second straight line is used as the angle between the reference pig ear root region and the reference pig face region at the first straight line. Moment and The consistency of displacement direction between moments.

[0009] Furthermore, the determination of the consistency of the motion states of the reference pig ear root region and the reference pig face region at adjacent moments includes the following specific steps: The reference pig ear root area and the reference pig face area were Moment and The product of the consistency of displacement amount and the consistency of displacement direction between the reference pig ear root area and the reference pig face area at the first Moment and The consistency of motion state between moments.

[0010] Furthermore, the determination of the consistency of the positional relationship between each pig ear root region and each pig facial region in the video frame at each moment includes the following specific steps: Use the morphological thinning algorithm to obtain the Referring to the skeleton line of the pig's facial area in the video frame at the time, performing straight line detection on the skeleton line using the Hough straight line detection algorithm, and obtaining a straight line segment corresponding to the skeleton line as the first straight line segment; According to The first straight line segment in the video frame at the time and the centroid of the reference pig ear root area are determined The target angle in the video frame at time ; According to the target angles in the video frames at consecutive moments, the consistency of the positional relationship between the reference pig ear root region and the reference pig face region in the video frames at each moment is determined.

[0011] Furthermore, the determination The target angle in the video frame at the moment includes the following specific steps: In the In the video frame at time , the straight line segment from the center point of the first straight line segment to the centroid of the reference pig ear root area is obtained as the second straight line segment, and the minimum angle between the first straight line segment and the second straight line segment is recorded as The target angle in the video frame at time.

[0012] Furthermore, the determination of the consistency of the positional relationship between the reference pig ear root region and the reference pig face region in the video frame at each moment includes the following specific steps: In the Time to The inverse normalized value of the difference between the maximum target angle and the minimum target angle is calculated as the first difference, the inverse normalized value of the variance of all target angles is calculated as the second difference, and the product of the first difference and the second difference is calculated as the second difference. The consistency of the positional relationship between the reference pig ear base area and the reference pig face area in the video frame at the moment.

[0013] Furthermore, the determination of the final consistency between each pig ear root region and each pig facial region in the video frame at each moment includes the following specific steps: In the Time to In the period of time, the mean of the consistency of the motion state between the reference pig ear root area and the reference pig face area at all adjacent moments is calculated, and the mean and the consistency of the motion state between the reference pig ear root area and the reference pig face area are calculated. The product of the consistency of the positional relationship between the reference pig ear root area and the reference pig face area in the video frame at time t is taken as the The final consistency between the reference pig ear root area and the reference pig face area in the video frame at the moment.

[0014] Furthermore, the specific steps of determining the temperature value corresponding to each pig facial area in the video frame at each moment include the following: In the In the video frame at time The pig face region corresponding to the maximum value of the final consistency between the pig ear root region and all pig face regions is taken as the first The pig facial area to which the pig ear root area belongs is the average of the temperature values ​​corresponding to the pixel points at the centroid of all the pig ear root areas to which each pig facial area belongs, as the temperature value corresponding to each pig facial area.

[0015] The beneficial effects of the technical solution of the present invention are: In an embodiment of the present invention, a video frame of each moment when a pig enters and leaves a breeding farm is obtained, and the consistency of the motion state of each pig ear root region and each pig facial region between adjacent moments is determined according to the change of the centroid coordinates of the pig ear root region and the centroid coordinates of the pig facial region in the video frames at adjacent moments, thereby obtaining a preliminary judgment parameter (consistency of motion state) through the movement consistency of the face and ear root of the same pig, thereby ensuring the accuracy of the subsequent matching of the face and ear root of the pig. According to the distribution position of the pig ear root region and the pig facial region in the video frames at consecutive moments, the consistency of the positional relationship between each pig ear root region and each pig facial region in the video frames at each moment is determined, thereby obtaining a further judgment parameter (consistency of positional relationship) through the positional relationship between the face and ear root of the same pig, thereby further ensuring the accuracy of the matching of the face and ear root of the pig. Therefore, according to the consistency of motion state and consistency of positional relationship, the final consistency of each pig ear root region and each pig facial region in the video frame at each moment is obtained, and then combined with the temperature value corresponding to each pixel point in the video frame, the temperature value corresponding to each pig facial region in the video frame at each moment is determined. At this point, the present invention improves the accuracy of judging the pig to which the pig ear belongs by analyzing the movement characteristics of the pig and the positional relationship between the pig's face and the ear base, thereby improving the accuracy of intelligent detection of animal body temperature in animal husbandry, which is beneficial to subsequent data management and personnel analysis of body temperature data, and is also beneficial to the intelligent detection of animal body temperature. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 This is a flow chart of the steps of an intelligent method for detecting animal body temperature for animal husbandry and veterinary medicine of the present invention; Figure 2 Schematic diagram of a front view of a pig in this embodiment; Figure 3 Schematic diagram of the angle between the center line of the pig's face and the line connecting the center of the pig's face to the center of the pig's ear root in this embodiment. DETAILED DESCRIPTION

[0018] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, characteristics and effects of an intelligent animal body temperature detection method for animal husbandry and veterinary medicine proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0019] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0020] The specific scheme of the intelligent animal body temperature detection method for animal husbandry and veterinary medicine provided by the present invention is described in detail below with reference to the accompanying drawings.

[0021] See also Figure 1 , which shows a flowchart of a method for intelligently detecting animal body temperature for animal husbandry and veterinary medicine provided by an embodiment of the present invention, the method comprising the following steps: Step S001: Obtain video frames of each moment when a herd of pigs enters or leaves a farm; each pixel in the video frame corresponds to a temperature value.

[0022] This embodiment mainly determines the pig body to which the pig ear belongs by analyzing the position relationship and movement state between the pig face and the pig ear base, obtains the corresponding body temperature of the pig, and completes the intelligent detection of the body temperature of animal husbandry.

[0023] At the exit of the farm, a dual-spectrum camera facing inside the farm is installed, and at the entrance of the farm, a dual-spectrum camera facing outside the farm is installed. When the animals enter and leave the farm, the front view of the animals is captured when the animals pass through. In this way, video frames of the pigs entering and leaving the farm are obtained at every moment. That is, when the pigs enter the farm, the dual-spectrum camera facing outside the farm is used to collect video frames, and when the pigs leave the farm, the dual-spectrum camera facing inside the farm is used to collect video frames. Schematic diagram of the front view of the pig, as shown in Figure 2 shown.

[0024] It should be noted that a dual-spectrum camera is usually equipped with two sensors, one for capturing visible light images and the other for capturing infrared images. In this embodiment, the video frame is a visible light image. The visible light image at the same moment corresponds to the pixels in the infrared image one by one. According to the temperature value corresponding to each pixel in the infrared image, the temperature value corresponding to each pixel in the video frame can be known, and the video frame is collected once per second to obtain multiple continuous video frames. The subsequent analysis is a continuous video frame collected by a dual-spectrum camera.

[0025] Step S002: Use a segmentation neural network to segment the pig ear root area and the pig face area in the video frame at each moment; determine the consistency of the motion state of each pig ear root area and each pig face area between adjacent moments based on the changes in the centroid coordinates of the pig ear root area and the centroid coordinates of the pig face area in the video frames at adjacent moments.

[0026] In the video frame, for pigs with overlapping ears, since the displacement of the pig's ears is consistent with that of the pig's body, and the ears of the pigs located at a more forward position in the video frame should be more visually visible, the pig to which the pig ear belongs can be determined by obtaining the movement direction of the pigs in the video frame and the position relationship of the pigs.

[0027] Preferably, in one embodiment of the present invention, a method for obtaining the consistency of the motion state of each pig ear root region and each pig face region at adjacent moments comprises: The embodiment of the present invention adopts a segmentation neural network to identify and segment the pig ear root area and the pig facial area in the video frame, wherein the pig facial area does not include the ear.

[0028] The relevant content of the segmentation neural network is as follows: The segmentation neural network used in this embodiment is the Mask R-CNN neural network; the data set used is a video frame data set. Mask R-CNN is a well-known technology, and the specific method is not introduced here. The full name of Mask R-CNN in Chinese is "Mask Region-based Convolutional Neural Network", and the full name in English is "Mask Region-based Convolutional Neural Network".

[0029] The pixels that need to be segmented are divided into two categories, that is, the labeling process of the training set is: single-channel semantic label, the corresponding position pixel belongs to the pig ear root area is labeled as 0, and the corresponding position pixel belongs to the pig face area is labeled as 1.

[0030] The task of the network is classification, so the loss function used is the cross entropy loss function.

[0031] The pig ear root area and the pig face area in the video frame are obtained by segmenting the neural network. This process is a well-known technology and the specific method will not be introduced here.

[0032] The first The first video frame at time The pig ear root area and pig facial regions, respectively, as the reference pig ear root region and the reference pig facial region. Time to During a time period of time, a target tracking algorithm is used to obtain a reference pig ear root area and a reference pig face area in a video frame at each time during the time period.

[0033] What needs to be explained is: , as well as is a positive integer and can be any value. , taking this as an example. The target tracking algorithm is a well-known technology, and the specific method is not introduced here. Time to If the reference pig ear root area does not exist in the video frame at a certain moment in the time period of time, that is, the reference pig ear root area moves beyond the video monitoring range over time, the first The first video frame at time According to the continuity of the video frames, the The first video frame at time The pig ear root area will be The analysis is performed in a video frame before the moment, so that a certain pig ear root area will not be missed in the following analysis.

[0034] It should be further explained that the ear roots and face movements of the same pig are consistent. Time to If there is no reference pig face region in the video frame at a certain time in the time period of time, it means that the reference pig face region and the pig ear root region do not belong to the same pig. Time to The reference pig facial region present in each video frame within the time period of time is used as the reference pig ear root region for matching analysis.

[0035] When pigs move in and out of the farm, the movement trends of the pig ears and the pig faces are consistent. Therefore, the stronger the consistency of the movement trends of the pig ears and the pig faces, the greater the possibility that the detected pig ear root area belongs to the pig.

[0036] In the video frame at each moment, a rectangular coordinate system is constructed with the vertex at the lower left corner of the video frame as the origin, the horizontal rightward as the horizontal axis, and the vertical upward as the vertical axis.

[0037] In the rectangular coordinate system of the video frame at each moment, the centroid coordinates of each pig ear root area and the centroid coordinates of each pig face area in the video frame at each moment are obtained.

[0038] Among them, the changes of the centroid coordinates of the pig ear root area and the centroid coordinates of the pig face area with time are the displacement routes of the pig ear root and the pig face.

[0039] For the reference pig ear root area and the reference pig face area, the more consistent the displacement of the two in the video frames at adjacent moments, the stronger the consistency of the displacement between the pig ear root and the pig face, and the stronger the consistency of the displacement, the stronger the correspondence between the pig ear root and the pig face.

[0040] Calculate the Moment and The Euclidean distance between the centroid coordinates of the reference pig ear root area in the video frame at time t is taken as the first distance, and the second distance is calculated. Moment and The Euclidean distance between the centroid coordinates of the reference pig face region in the video frame at time t is used as the second distance, and the inverse proportional normalized value of the absolute value of the difference between the first distance and the second distance is used as the distance between the reference pig ear root region and the reference pig face region at the first Moment and The consistency of displacement between moments.

[0041] It should be noted that the absolute value of the difference between the first distance and the second distance is recorded as , then use As The inverse normalized value of is an exponential function with a natural constant as the base. To present The inverse proportional relationship and normalization processing of the implementation can be set by the implementer according to the actual situation. The smaller the size, the closer the reference pig ear root area is to the reference pig face area. Moment and The more consistent the displacement between moments.

[0042] For the reference pig ear root region and the reference pig face region, the more consistent their displacement directions in the video frames at adjacent moments, the stronger the consistency of the displacement directions of the pig ear root and the pig face, and the stronger the consistency of the displacement directions, the stronger the correspondence between the pig ear root and the pig face.

[0043] In the rectangular coordinate system, obtain the Moment and The straight line of the reference pig ear root area mass center coordinates in the video frame at time t is taken as the first straight line, and the straight line passing through the Moment and The straight line of the center of mass coordinates of the reference pig face region in the video frame at time t is used as the second straight line, and the normalized value of the minimum angle between the first straight line and the second straight line is used as the angle between the reference pig ear root region and the reference pig face region at time t Moment and The consistency of displacement direction between moments.

[0044] It should be noted that the normalized value of the minimum angle is Linear normalization function, used to normalize the minimum angle value to between 0 and 1.

[0045] The reference pig ear root area and the reference pig face area were Moment and The product of the consistency of displacement amount and the consistency of displacement direction between the reference pig ear root area and the reference pig face area at the first Moment and The consistency of motion state between moments.

[0046] Among them, the greater the consistency of the motion state, the The first video frame at time The more likely the pig ear root area is to belong to Pig facial area.

[0047] Step S003: according to the distribution positions of the pig ear base regions and the pig facial regions in the video frames at consecutive moments, determining the consistency of the positional relationship between each pig ear base region and each pig facial region in the video frames at each moment.

[0048] There is a certain positional relationship between the pig's ear roots and the pig's face. At the same time, it is not possible to fully identify all the pig's faces or ear roots in the video frame at each moment. Therefore, in practice, it is necessary to match the identified face with the corresponding ear root part, so as to realize automatic detection of the pig's body temperature.

[0049] Preferably, in one embodiment of the present invention, a method for obtaining the consistency of the positional relationship between each pig ear root region and each pig facial region in a video frame at each moment includes: Use the morphological thinning algorithm to obtain the The skeleton line of the reference pig face region in the video frame at the moment is then detected by using the Hough line detection algorithm to obtain a straight line segment corresponding to the skeleton line as the first straight line segment, wherein the endpoint of the straight line segment is on the boundary of the reference pig face region.

[0050] In the In the video frame at time , the straight line segment from the center point of the first straight line segment to the centroid of the reference pig ear root area is obtained as the second straight line segment, and the minimum angle between the first straight line segment and the second straight line segment is recorded as The target angle in the video frame at time.

[0051] It should be noted that both the morphological thinning algorithm and the Hough line detection algorithm are well-known technologies, and the specific methods will not be introduced here. Since the structure of the pig's head is bilaterally symmetrical, this means that from the front to the back of the head, a line is drawn through the midpoint between the eyes. This line divides the head evenly into two mirror-symmetrical parts on the left and right. Therefore, when the pig's head is thinned to extract the skeleton line, this line often runs along the center of the head to form a symmetry line. Schematic diagram of the angle between the center line of the pig's face and the line connecting the center of the pig's face to the center of the pig's ear root, as shown in Figure 3 As shown, Figure 3 The vertical line in the figure represents the first straight line segment, and the upper right straight line represents the second straight line segment. Represents the target angle.

[0052] According to the above method, get Time to The target angle in the video frame at each moment in the time period.

[0053] It should be noted that each pig will keep its face forward most of the time when moving towards the exit, that is, the target angle in most video frames is credible. Time to When the reference pig facial region in a certain video frame within the time period of time is not the front face, the subsequent analysis does not consider the video frame. In this embodiment, a deep neural network is used to identify whether the reference pig facial region in the video frame is the front face, wherein the deep neural network used is the DeepLabV3 neural network, the data set used is the pig facial region data set in the video frame, and the label marking process corresponding to the training set is: the pig facial region is marked as 0 for the front face, and the pig facial region is not marked as 1 for the front face. The task of the network is classification, so the loss function used is the cross entropy loss function.

[0054] Since the angle between the center line of the pig's face and the line connecting the center of the pig's face to the center of the pig's ear base is relatively fixed, the more stable the angle between the center line of the pig's face and the line connecting the center of the pig's face to the center of the pig's ear base in continuous video frames, the greater the possibility that the detected pig's ear base area belongs to the pig.

[0055] In the Time to The inverse normalized value of the difference between the maximum target angle and the minimum target angle is calculated as the first difference, the inverse normalized value of the variance of all target angles is calculated as the second difference, and the product of the first difference and the second difference is calculated as the second difference. The consistency of the positional relationship between the reference pig ear base area and the reference pig face area in the video frame at the moment.

[0056] It should be noted that the difference between the maximum target angle and the minimum target angle is recorded as , the variance of all target angles is recorded as , then use and As and The inverse normalized value of . The smaller, and The smaller the value is, the smaller the change of the target angle in the connected video frame is, and the more consistent the positional relationship between the reference pig ear root area and the reference pig face area is. The first video frame at time The more likely the pig ear root area is to belong to Pig facial area.

[0057] Step S004: Determine the final consistency between each pig ear base area and each pig facial area in the video frame at each moment based on the consistency of the positional relationship between each pig ear base area and each pig facial area in the video frame at each moment and the consistency of the motion state between each pig ear base area and each pig facial area at adjacent moments.

[0058] Preferably, in one embodiment of the present invention, a method for obtaining the final consistency between each pig ear root region and each pig face region in a video frame at each moment includes: In the Time to In the period of time, the mean of the consistency of the motion state between the reference pig ear root area and the reference pig face area at all adjacent moments is calculated, and the mean and the consistency of the motion state between the reference pig ear root area and the reference pig face area are calculated. The product of the consistency of the positional relationship between the reference pig ear root area and the reference pig face area in the video frame at time t is taken as the The final consistency between the reference pig ear root area and the reference pig face area in the video frame at the moment.

[0059] Among them, the greater the final consistency, the The first video frame at time The more likely the pig ear root area is to belong to Pig facial area.

[0060] Step S005: Determine the temperature value corresponding to each pig facial region in the video frame at each moment according to the final consistency between each pig ear root region and each pig facial region in the video frame at each moment and the temperature value corresponding to each pixel in the video frame.

[0061] Preferably, in one embodiment of the present invention, a method for obtaining the temperature value corresponding to each pig facial area in a video frame at each moment includes: According to the above method, in In the video frame at time The final consistency of the pig ear root region and each pig face region is The pig face region corresponding to the maximum value of the final consistency between the pig ear root region and all pig face regions is taken as the first The pig's ear root area belongs to the pig's facial area.

[0062] What needs to be explained is: When there are multiple maximum values ​​in the final consistency between the pig ear root region and all pig facial regions, it means that The video frame at time The pig ears overlap seriously in the area of ​​the pig ears' roots, which does not match the For the pig ear root area, you can use The first video frame before or after the moment The temperature detection is performed based on the matching results of the pig's ear root area. If a pig has two ears, the matching result of the other ear can be used to complete the temperature detection.

[0063] In the In the video frame at the moment, the average of the temperature values ​​corresponding to the pixel points at the centroid of all the pig ear root regions to which each pig facial region belongs is taken as the temperature value corresponding to each pig facial region.

[0064] According to the above method, the temperature value corresponding to each pig facial area in the video frame at each moment can be obtained, that is, the body temperature of each pig in the video frame at each moment can be obtained, thereby completing the detection of the pig's body temperature.

[0065] So far, the present invention is completed.

[0066] In summary, in an embodiment of the present invention, a video frame of each moment when a pig herd enters and leaves a breeding farm is obtained, and the consistency of the motion state of each pig ear root region and each pig facial region between adjacent moments is determined according to the change of the centroid coordinates of the pig ear root region and the centroid coordinates of the pig facial region in the video frames at adjacent moments, and the consistency of the positional relationship of each pig ear root region and each pig facial region in the video frames at each moment is determined according to the distribution positions of the pig ear root region and the pig facial region in the video frames at consecutive moments, thereby determining the final consistency of each pig ear root region and each pig facial region in the video frames at each moment, and then combining the temperature value corresponding to each pixel point in the video frame, determining the temperature value corresponding to each pig facial region in the video frame at each moment. The present invention improves the accuracy of judging the pig to which the pig ear belongs by analyzing the movement characteristics of the pig and the positional relationship between the pig face and the ear root, thereby improving the accuracy of intelligent detection of animal body temperature in animal husbandry.

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

Claims

1. An intelligent method for detecting animal body temperature for animal husbandry and veterinary medicine, characterized in that: The method comprises the following steps: Obtain video frames at every moment when the pigs enter and leave the farm; each pixel in the video frame corresponds to a temperature value; Use a segmentation neural network to segment the pig ear root area and the pig face area in the video frame at each moment; determine the consistency of the motion state of each pig ear root area and each pig face area between adjacent moments according to the changes in the centroid coordinates of the pig ear root area and the centroid coordinates of the pig face area in the video frames at adjacent moments; According to the distribution positions of the pig ear root regions and the pig facial regions in the video frames at consecutive moments, determining the consistency of the positional relationship between each pig ear root region and each pig facial region in the video frames at each moment; According to the consistency of the positional relationship between each pig ear root region and each pig facial region in the video frame at each moment and the consistency of the motion state between each pig ear root region and each pig facial region at adjacent moments, the final consistency between each pig ear root region and each pig facial region in the video frame at each moment is determined; According to the final consistency between each pig ear root area and each pig facial area in the video frame at each moment and the temperature value corresponding to each pixel point in the video frame, the temperature value corresponding to each pig facial area in the video frame at each moment is determined.

2. The method for intelligently detecting animal body temperature for animal husbandry and veterinary medicine according to claim 1, characterized in that: The determination of the consistency of the motion state of each pig ear root region and each pig face region at adjacent moments includes the following specific steps: The first The first video frame at time The pig ear root area and The pig facial regions are used as the reference pig ear root region and the reference pig facial region respectively; In the Time to During a time period of time, a target tracking algorithm is used to obtain a reference pig ear root area and a reference pig face area in a video frame at each time in the time period; wherein, is a preset time threshold; In each video frame at a certain moment, a rectangular coordinate system is constructed with the vertex at the lower left corner of the video frame as the origin, the horizontal axis to the right as the horizontal axis, and the vertical axis upward as the vertical axis; In the rectangular coordinate system of the video frame at each moment, the centroid coordinates of each pig ear root area and the centroid coordinates of each pig facial area in the video frame at each moment are obtained; Determine the consistency of the displacement between the reference pig ear root region and the reference pig face region at adjacent moments according to the distance between the centroid coordinates of the reference pig ear root region and the centroid coordinates of the reference pig face region in the video frames at adjacent moments; Determine the consistency of the displacement direction of the reference pig ear root region and the reference pig face region between adjacent moments according to a straight line of the centroid coordinates of the reference pig ear root region and a straight line of the centroid coordinates of the reference pig face region in the video frames passing through adjacent moments on a rectangular coordinate system; According to the consistency of displacement amount and displacement direction between the reference pig ear root region and the reference pig face region at adjacent moments, the consistency of motion state between the reference pig ear root region and the reference pig face region at adjacent moments is determined.

3. According to claim 2, a method for intelligently detecting animal body temperature for animal husbandry and veterinary medicine, characterized in that: The specific steps of determining the consistency of the displacement between the reference pig ear root region and the reference pig face region at adjacent moments are as follows: Calculate the Moment and The Euclidean distance between the centroid coordinates of the reference pig ear root area in the video frame at time t is taken as the first distance, and the second distance is calculated. Moment and The Euclidean distance between the centroid coordinates of the reference pig face region in the video frame at time t is used as the second distance, and the inverse proportional normalized value of the absolute value of the difference between the first distance and the second distance is used as the distance between the reference pig ear root region and the reference pig face region at time t Moment and The consistency of displacement between moments.

4. The method for intelligently detecting animal body temperature for animal husbandry and veterinary medicine according to claim 2, characterized in that: The specific steps of determining the consistency of the displacement directions of the reference pig ear root region and the reference pig face region at adjacent moments are as follows: In the rectangular coordinate system, obtain the Moment and The straight line of the reference pig ear root area mass center coordinates in the video frame at time t is taken as the first straight line, and the straight line passing through the Moment and The straight line of the center of mass coordinates of the reference pig face region in the video frame at time t is used as the second straight line, and the normalized value of the minimum angle between the first straight line and the second straight line is used as the angle between the reference pig ear root region and the reference pig face region at time t Moment and The consistency of displacement direction between moments.

5. The intelligent animal body temperature detection method for animal husbandry and veterinary medicine according to claim 2, characterized in that: The determination of the consistency of the motion states of the reference pig ear root region and the reference pig face region at adjacent moments includes the following specific steps: The reference pig ear root area and the reference pig face area were Moment and The product of the consistency of displacement amount and the consistency of displacement direction between the reference pig ear root area and the reference pig face area at the first Moment and The consistency of motion state between moments.

6. The intelligent animal body temperature detection method for animal husbandry and veterinary medicine according to claim 2, characterized in that: The specific steps of determining the consistency of the positional relationship between each pig ear root region and each pig facial region in the video frame at each moment are as follows: Use the morphological thinning algorithm to obtain the Referring to the skeleton line of the pig's facial area in the video frame at the time, performing straight line detection on the skeleton line using the Hough straight line detection algorithm, and obtaining a straight line segment corresponding to the skeleton line as the first straight line segment; According to The first straight line segment in the video frame at the time and the centroid of the reference pig ear root area are determined The target angle in the video frame at time ; According to the target angles in the video frames at consecutive moments, the consistency of the positional relationship between the reference pig ear root region and the reference pig face region in the video frames at each moment is determined.

7. The intelligent animal body temperature detection method for animal husbandry and veterinary medicine according to claim 6, characterized in that: The determination The target angle in the video frame at the moment includes the following specific steps: In the In the video frame at time , the straight line segment from the center point of the first straight line segment to the centroid of the reference pig ear root area is obtained as the second straight line segment, and the minimum angle between the first straight line segment and the second straight line segment is recorded as The target angle in the video frame at time.

8. The intelligent animal body temperature detection method for animal husbandry and veterinary medicine according to claim 6, characterized in that: The specific steps of determining the consistency of the positional relationship between the reference pig ear root region and the reference pig face region in the video frame at each moment are as follows: In the Time to The inverse normalized value of the difference between the maximum target angle and the minimum target angle is calculated as the first difference, the inverse normalized value of the variance of all target angles is calculated as the second difference, and the product of the first difference and the second difference is calculated as the second difference. The consistency of the positional relationship between the reference pig ear base area and the reference pig face area in the video frame at the moment.

9. The intelligent animal body temperature detection method for animal husbandry and veterinary medicine according to claim 2, characterized in that: The specific steps of determining the final consistency between each pig ear root region and each pig face region in the video frame at each moment are as follows: In the Time to In the period of time, the mean of the consistency of the motion state between the reference pig ear root area and the reference pig face area at all adjacent moments is calculated, and the mean and the consistency of the motion state between the reference pig ear root area and the reference pig face area are calculated. The product of the consistency of the positional relationship between the reference pig ear root area and the reference pig face area in the video frame at time t is taken as the The final consistency between the reference pig ear root area and the reference pig face area in the video frame at the moment.

10. The intelligent animal body temperature detection method for animal husbandry and veterinary medicine according to claim 1, characterized in that: The specific steps of determining the temperature value corresponding to each pig facial area in the video frame at each moment are as follows: In the In the video frame at time The pig face region corresponding to the maximum value of the final consistency between the pig ear root region and all pig face regions is taken as the first The pig facial area to which the pig ear root area belongs is the average of the temperature values ​​corresponding to the pixel points at the centroid of all the pig ear root areas to which each pig facial area belongs, as the temperature value corresponding to each pig facial area.

Citation Information

Patent Citations

  • Pig body temperature detection method in multi-pig scene based on infrared image

    CN111145205A

  • Livestock body temperature image processing method based on artificial intelligence and active gun-ball linkage

    CN111833331A

  • Livestock body temperature monitoring method and device, electronic equipment and storage medium

    CN114885853A

  • Method for acquiring ear state based on infrared image, electronic equipment and storage medium

    CN117017618A

  • Cow abnormal behavior detection method based on remote monitoring

    CN117831136A