A method and system for monitoring the health status of livestock
Through the improved SegNet and YOLOv3-tiny network, the problem of heavy workload of traditional manual observation has been solved, fast and accurate monitoring of livestock health status has been achieved, the timeliness of detection of sick cattle has been improved, and economic losses have been reduced.
Patent Information
- Application Number
- CN202111345404.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-11-15
AI Technical Summary
During the grazing process, due to the large number of cattle and mutual blocking, the traditional manual observation workload is heavy, resulting in the late detection of sick cattle, resulting in economic losses. The existing technology is insufficiently applied in livestock disease detection.
The improved SegNet semantic segmentation network and YOLOv3-tiny pathology detection network are used to collect images from multiple angles to determine the posture and pathology of livestock to achieve fast and accurate pathology detection.
It can quickly identify and locate sick livestock, improve the timeliness of detecting sick cattle, reduce economic losses, and is suitable for large-scale cattle health status monitoring.
Smart Images

Figure CN113989647B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of livestock health monitoring, and in particular to a livestock health status monitoring method and a system thereof. Background Art
[0002] Inner Mongolia grassland cattle breeding is a landmark industry of Inner Mongolia animal husbandry, and cattle grazing plays a vital role in grassland sheep breeding. At present, my country has become the world's third largest beef consumer. From 2000 to 2014, domestic beef consumption increased from 5.102 million tons to 7.297 million tons, with an annual compound growth rate of 2.4%, higher than the annual compound growth rate of 1.8% of global beef consumption during the same period. From January to October 2015, domestic beef consumption has exceeded the previous year's full-year consumption to 7.35 million tons, and the growth momentum remains strong.
[0003] During the grazing process, it is inevitable that cattle will become sick and die due to improper grazing management, climate and diet. Herders need to observe the herd every day before grazing or returning to grazing. Due to the large number of cattle and the large size of the cattle, which will block each other, the traditional manual observation is labor-intensive and time-consuming. In many cases, the disease is often discovered too late, resulting in the diseased cattle not receiving timely treatment, which has very serious consequences and causes great economic losses. Therefore, scientifically and effectively solving the problem of diseased cattle monitoring in the herd has become an important issue in livestock breeding.
[0004] With the improvement of computer technology and the rapid development of deep learning and computer vision technology, livestock detection has become one of the key technologies in the intelligent farming industry. At present, counting methods based on deep learning are widely used in traffic detection of pedestrians, vehicles, marine life, etc. However, there is a lack of relevant application research on cattle disease detection in livestock farming.
[0005] In view of this, the present invention is proposed. Summary of the invention
[0006] In view of this, the present invention discloses a method for monitoring the health status of livestock, and a system for implementing the above-mentioned monitoring method. The method can train, identify and locate the entire image content at a single time, and has the advantages of fast recognition speed, high accuracy, and suitability for small target detection.
[0007] Specifically, the present invention is achieved through the following technical solutions:
[0008] In a first aspect, the present invention discloses a method for monitoring the health status of livestock, the method comprising the following steps:
[0009] Collect pictures of livestock from multiple angles and input them into the trained improved SegNet semantic segmentation network structure to determine whether the livestock's body shape meets the normal condition.
[0010] The images are fed into the trained improved YOLOv3-tiny disease detection network to determine the diseased condition of livestock.
[0011] In a second aspect, the present invention discloses a system for monitoring the health status of livestock, comprising:
[0012] Livestock posture judgment module: It is used to collect livestock pictures from multiple angles and input the pictures into the trained improved SegNet semantic segmentation network structure to judge whether the livestock's body posture meets the normal body posture;
[0013] Disease judgment module: used to input pictures into the trained improved YOLOv3-tiny disease detection network to judge the disease condition of livestock.
[0014] In a third aspect, the present invention discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for monitoring the health status of livestock as described in the first aspect.
[0015] In a fourth aspect, the present invention discloses a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for monitoring the health status of livestock as described in the first aspect are implemented.
[0016] The solution of the present invention mainly determines the body size of livestock through the improved SegNet semantic segmentation network, and can also extract the morbid features of sick livestock (such as sick cows) in various directions on the fur, head or legs through the improved YOLOv3-tiny target detection algorithm for identification, such as whether there are tear marks, fur loss, leg lifting, hoof cracking or even falling off, etc. Target detection of sick livestock (such as sick cows) is achieved, and the problem of delayed detection of sick livestock (such as sick cows) is solved by using the improved YOLOv3-tiny to identify sick livestock (such as sick cows) and healthy livestock. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0018] Figure 1 Multi-angle pictures of livestock provided by embodiments of the present invention;
[0019] Figure 2 The improved SegNet semantic segmentation network structure diagram provided by the embodiment of the present invention;
[0020] Figure 3 A multi-angle livestock picture after judging the livestock's body shape provided by an embodiment of the present invention;
[0021] Figure 4 An improved YOLOv3-tiny pathological detection network diagram provided by an embodiment of the present invention;
[0022] Figure 5 A super-resolution restoration network diagram provided by an embodiment of the present invention;
[0023] Figure 6-7 A processing diagram after judging the morbidity of livestock provided by an embodiment of the present invention;
[0024] Figure 8 A schematic diagram of a specific process of a method for monitoring livestock health status provided by an embodiment of the present invention;
[0025] Fig. 9 A structural diagram of a livestock health status monitoring system provided by an embodiment of the present invention;
[0026] Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0028] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0029] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0030] The present invention discloses a method for monitoring the health status of livestock, the method comprising:
[0031] Collect pictures of livestock from multiple angles and input them into the trained improved SegNet semantic segmentation network structure to determine whether the livestock's body shape meets the normal condition.
[0032] The images are fed into the trained improved YOLOv3-tiny disease detection network to determine the diseased condition of livestock.
[0033] Figure 8 A flow chart of a method for monitoring the health status of livestock disclosed in an embodiment of the present invention is shown in FIG. Figure 1 As shown, the following steps are included:
[0034] Step 1: Collect pictures of livestock from the front, back, left, and right directions, such as Figure 1 shown.
[0035] Step 2: Label the collected livestock images using labelme and labelimg software to create a training set.
[0036] Step 3: Build an improved SegNet semantic segmentation network and design a loss function. The difference between the result of a single training sample after the forward operation of the neural network and the true label corresponding to the single training sample is calculated by calculating the loss function results of all samples in the training sample space and finding the average to express the prediction ability of the neural network for the sample, as shown in the following formula:
[0037]
[0038] Among them, σJ(f) is called the regularization term, N represents the number of samples, σ represents the regularization coefficient, f(x) represents the calculation result, and Y represents the true label.
[0039] like Figure 2 As shown in the figure, the improved network structure adds skip connections on the basis of the SegNet network, which can effectively aggregate high-level information and low-level information, and adds a void space pyramid pooling module to obtain large-scale, multi-level semantic information and improve segmentation accuracy.
[0040] Step 4: Input the image into the trained network to obtain the front, back, left and right segmented images of the livestock, and determine the body shape of sick livestock (such as sick cows) according to the set pixel threshold. The determination is based on the fixed distance between the camera and the cow and the input image size of 1280*960. When the cow is in the front or back, the horizontal pixels occupied by the cow are between 290 and 310. When the cow is on the side, the horizontal pixels occupied by the cow are between 540 and 560, and the vertical pixels are between 410 and 420. Within this range, it belongs to the normal body shape.
[0041] Step 5: Build an improved YOLOv3-tiny pathological detection network and design a loss function to ensure the degree of data fitting during training. The mean squard error (MSE) function is used as the loss function of coordinate error, and the cross entropy function is used as the loss function of confidence and category. The specific formula is as follows:
[0042]
[0043] Where S represents the grid size, s 2 represents 13×13, 26×26, B represents the number of prediction boxes, Represents the probability of the target appearing in the box at i, j, and On the contrary, it means that the box has no target at position i, j;
[0044] represents the true value, The value of is determined by whether the Bounding Box in the grid is responsible for predicting an object;
[0045] P i j and Respectively represent the predicted value and true value of each probability of a certain target being predicted;
[0046] λ coord and λ no_obj Represent the weights of the bounding box loss and confidence loss respectively.
[0047] like Figure 4 As shown in the figure, the improved YOLOv3-tiny pathological detection network adds the SE attention mechanism module on the basis of the original network, which can improve the range of network perception of objects and increase the detection accuracy. It also uses the inverse residual deep separable convolution block as the backbone feature extraction network, so that features can be extracted in high dimensions, thereby improving the detection accuracy.
[0048] Step 6: Load the collected livestock images into the trained improved YOLOv3-tiny pathological detection network. If pathological conditions are detected, the detected pathological images are cleared through the super-resolution restoration network. The super-resolution restoration network is shown in the figure. Figure 5 As shown, the obtained clear picture is as follows Figure 6 and Figure 7 As shown in the figure, the super-resolution restoration network FSRCNN directly uses low-resolution images as input, which is different from SRCNN which needs to first perform bicubic interpolation on the low-resolution image and then use it as input; FSRCNN uses a deconvolution layer at the end of the network to achieve upsampling; there is no nonlinear mapping in FSRCNN, and correspondingly, contraction, mapping and expansion occur; FSRCNN chooses smaller filters and deeper network structures.
[0049] Fig. 9 1 is a schematic diagram of the structure of a livestock health status monitoring system disclosed in the present invention, the system comprising:
[0050] Livestock posture judgment module 101: used to collect livestock pictures from multiple angles, and input the pictures into the trained improved SegNet semantic segmentation network structure to judge whether the livestock's body posture meets the normal body posture;
[0051] The sickness judgment module 102 is used to input the image into the trained improved YOLOv3-tiny sickness detection network to judge the sickness of the livestock.
[0052] The monitoring system is mainly composed of the above two modules. Through the cooperation between the two modules, the problem of delayed detection of sick livestock can be solved.
[0053] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.
[0054] Specific examples of actual cases:
[0055] Taking cattle as an example for posture monitoring, step 1 shows the collection of pictures of livestock from the front, back, left and right directions. Step 2 shows the use of annotation software to create a training set. Step 3 shows the construction of a livestock posture assessment network based on semantic segmentation. Step 4 shows the first transfer of the picture to the posture assessment network to obtain the segmented picture. Step 5 shows that the vertical pixels are judged to be 402, the horizontal pixels occupied by the front and rear cattle are 301, and the pixels occupied by the side cattle are 553, so this cattle has a normal posture.
[0056] Actual case of pathological monitoring: As shown in step 1, livestock pathological pictures are collected; as shown in step 2, a training set is prepared using labelimg annotation software; as shown in step 3, a pathological detection network based on the improved yolov3-tiny is built; as shown in step 4, the pictures are first passed into the pathological detection network to obtain the detected pictures, which show that the cattle are in an unhealthy state; as shown in step 5, the detected pathological pictures are input into the built super-resolution restoration network to make the pathological pictures clearer.
[0057] Fig.10 It is a structural schematic diagram of a computer device disclosed in the present invention. Fig.10 As shown, the computer device includes: an input device 63, an output device 64, a memory 62 and a processor 61; the memory 62 is used to store one or more programs; when the one or more programs are executed by the one or more processors 61, the one or more processors 61 implement a livestock health status monitoring method provided in the above embodiment; wherein the input device 63, the output device 64, the memory 62 and the processor 61 can be connected through a bus or other means, Fig.10 The example of connecting through bus is taken in the following.
[0058] The memory 62 is a readable and writable storage medium of a computing device, which can be used to store software programs, computer executable programs, such as program instructions corresponding to a method for monitoring the health status of livestock described in an embodiment of the present application; the memory 62 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required for a function; the data storage area can store data created according to the use of the device, etc.; in addition, the memory 62 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device; in some instances, the memory 62 can further include a memory remotely arranged relative to the processor 61, and these remote memories can be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0059] The input device 63 may be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the device; the output device 64 may include a display device such as a display screen.
[0060] The processor 61 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 62.
[0061] The computer device provided above can be used to execute a livestock health status monitoring method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0062] The present application embodiment also provides a storage medium containing computer executable instructions, which are used to perform a method for monitoring the health status of livestock provided in the above embodiment when executed by a computer processor, and the storage medium is any of various types of memory devices or storage devices, and the storage medium includes: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc.; the storage medium may also include other types of memory or a combination thereof; in addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet); the second computer system may provide program instructions to the first computer for execution. The storage medium includes two or more storage media that can reside in different locations (for example, in different computer systems connected via a network). The storage medium can store program instructions (for example, specifically implemented as a computer program) that can be executed by one or more processors.
[0063] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the livestock health status monitoring method described in the above embodiment, can also execute related operations in the livestock health status monitoring method provided in any embodiment of the present application.
[0064] Finally, it should be noted that although this specification contains many specific implementation details, these should not be interpreted as limiting the scope of any invention or the scope of protection claimed, but are mainly used to describe the features of specific embodiments of specific inventions. Certain features described in multiple embodiments within this specification may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or in any suitable sub-combination. In addition, although features may work in certain combinations as described above and even initially claimed as such, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of a sub-combination.
[0065] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or requiring that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.
[0066] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired results. In some implementations, multitasking and parallel processing may be advantageous.
[0067] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the scope of protection of the present disclosure.
Claims
1. A method for monitoring the health status of livestock, characterized in that: The steps include: Collect pictures of livestock from multiple angles and input them into the trained improved SegNet semantic segmentation network structure to determine whether the livestock's body shape meets the normal condition. The images are fed into the trained improved YOLOv3-tiny disease detection network to determine the diseased condition of the livestock; The training method of the improved SegNet semantic segmentation network structure includes: Build a network and design a loss function. Calculate the average of the loss function results of all samples in the training sample space to represent the prediction ability of the network. The specific calculation formula is: Among them, σJ(f) is called the regularization term, N represents the number of samples, σ represents the regularization coefficient, f(x) represents the calculation result, and Y represents the true label; The method for building the improved YOLOv3-tiny pathological detection network includes: Build a detection network and design a loss function, where the mean square error function is used as the loss function of the coordinate error, and the cross entropy function is used as the loss function of the confidence and category. The specific formula is as follows: Where S represents the grid size, s 2 represents 13×13, 26×26, B represents the number of prediction boxes, Represents the probability of the target appearing in the box at i, j, and On the contrary, it means that the box has no target at position i, j; represents the true value, The value of is determined by whether the Bounding Box in the grid is responsible for predicting an object; P i j and Respectively represent the predicted value and true value of each probability of a certain target being predicted; λ coord and λ no_obj Represent the weights of bounding box loss and confidence loss respectively; After determining the pathological condition of the livestock, the detected pathological images are clarified through a super-resolution restoration network, which uses a small-size filter and a deeper network structure, and uses a deconvolution layer in the final step of the network to achieve upsampling.
2. The monitoring method according to claim 1, characterized in that: The improved SegNet semantic segmentation network structure adds skip connections and a dilated space pyramid pooling module to the SegNet network.
3. The monitoring method according to claim 1, characterized in that: Methods for determining whether the body shape of livestock meets normal body shape include: The front, back, left and right pictures of the livestock are input into the network structure to obtain the front, back, left and right segmented pictures of the livestock, and whether the body shape of the livestock meets the normal state is determined according to the set pixel threshold.
4. The monitoring method according to claim 1, characterized in that: The improved YOLOv3-tiny pathological detection network adds a SE attention mechanism module and uses the inverse residual deep separable convolution block as the backbone feature extraction network.
5. A livestock health status monitoring system, using the livestock health status monitoring method according to any one of claims 1 to 4, characterized in that: include: Livestock posture judgment module: It is used to collect livestock pictures from multiple angles and input the pictures into the trained improved SegNet semantic segmentation network structure to judge whether the livestock's body posture meets the normal body posture; Disease judgment module: used to input pictures into the trained improved YOLOv3-tiny disease detection network to judge the disease condition of livestock.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for monitoring the health status of livestock described in any one of claims 1-4 are implemented.
7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for monitoring the health status of livestock as described in any one of claims 1-4 are implemented.
Citation Information
Patent Citations
Remote sensing image semantic segmentation method, storage medium and computing device
CN112084923A
Traffic sign detection and recognition method based on improved YOLOv3-tiny
CN112464911A
