An intelligent detection system for pig feces based on image feature analysis

By using image feature analysis and multiple screening technology in pig feces detection, the problem of pig body occlusion and ground impurity interference is solved, more accurate feces area identification and more efficient detection are achieved, and data accuracy and decision-making are improved. support.

CN118505696BActive Publication Date: 2024-09-24DALIAN KUNYUAN TECH DEV CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410962030.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-09-24
Estimated Expiration
2044-07-18

AI Technical Summary

Technical Problem

In the existing technology, the detection of pig feces is not accurate enough due to the obstruction of the pig body and the interference of impurities on the ground, which affects the accuracy of data and decision-making.

Method used

An intelligent detection system based on image feature analysis is used to obtain overhead images through preset sampling intervals, perform image segmentation and multiple screenings, eliminate interference from pig bodies and bare ground, narrow the search range of feces areas, and use neural networks to identify target feces areas and conduct Overlay to obtain the complete feces area.

Benefits of technology

It improves the accuracy of stool area recognition, reduces interference factors, improves detection efficiency, reduces the image area processed by the neural network, and reduces the amount of calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118505696B
    Figure CN118505696B
Patent Text Reader

Abstract

The present invention relates to the field of image processing and analysis technology, and specifically to an intelligent pig manure detection system based on image feature analysis. The present invention first obtains a bird's-eye view image of each fence of a pig house; further utilizes image segmentation to obtain the ground area of ​​the pig house; further screens the ground area of ​​the pig house to obtain the target ground area, and narrows the search range of the pig manure area; further screens the target ground area to obtain the pig manure area to be tested, and further narrows the search range; finally, the image of the pig manure area to be tested is input into a neural network to identify the target pig manure area, and then the image is spliced ​​and superimposed to obtain a complete pig manure area. The present invention screens out the area most likely to be pig manure through multiple screenings, and then inputs it into the neural network for final identification, reduces interference factors, improves recognition accuracy, and reduces the image area that needs to be processed by the neural network, reduces the amount of calculation, and improves detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing and analysis, and in particular to an intelligent pig feces detection system based on image feature analysis. Background Art

[0002] The recognition and detection of pig feces involves image processing and analysis technology. By collecting and analyzing the image data of pig feces, a large amount of information can be generated for decision-making. Such a data-driven approach helps optimize breeding management strategies and improve the sustainability of agricultural production. It can also help farm managers better understand the conditions in the pig farm. By timely handling of waste and improving cleaning efficiency, it helps to improve breeding efficiency and reduce resource waste.

[0003] At present, the detection of pig feces based on image features is generally based on the whole image and neural network recognition is directly performed. However, in practice, some ground areas cannot be obtained due to the obstruction of the pig body. There may be interference from soil impurities and water stains on the ground of the pig house, resulting in the inability to accurately obtain the area belonging to the feces, which affects the accuracy of the data generated based on image features and is not conducive to decision making. Summary of the invention

[0004] In order to solve the technical problem that the existing method is not accurate enough in obtaining the feces area, the purpose of the present invention is to provide an intelligent pig feces detection system based on image feature analysis. The technical solution adopted is as follows:

[0005] Image acquisition module: obtains the top view image of each fence of the pig house at a preset sampling interval;

[0006] Image segmentation module: performing image segmentation on the overhead image to obtain the ground area of ​​the pig house;

[0007] Preliminary screening module: according to the relative proportion of the number of edge pixels in each pig house ground area, the edge parameters of each pig house ground area are obtained; according to the deviation characteristics of the overall gray value of all pixels in the pig house ground area and the prior gray value of the bare ground, the coverage possibility parameters are obtained; according to the discrete characteristics of the gray value of the pixels in each pig house ground area, the edge parameters and the coverage possibility parameters are combined to obtain the screening parameters; according to the screening parameters, the target ground area is screened out;

[0008] Fine screening module: according to the distribution characteristics of the pixel points in the target ground area, combined with the screening parameters, the feces area possibility of each target ground area is obtained; according to the feces area possibility, the pig feces area to be tested is screened;

[0009] Feces detection module: The image of each pig feces area to be tested is passed through a pre-trained neural network to obtain the target pig feces area; the target pig feces areas in all the overhead images corresponding to each fence are superimposed and spliced ​​to obtain the complete pig feces area of ​​each fence.

[0010] Furthermore, the method for obtaining the edge parameters includes:

[0011] The edge pixel points of the overhead image are obtained by using the Sobel operator; the range of the number of edge pixel points contained in the pig house ground area is obtained as a denominator parameter; and the ratio of the number of edge pixel points contained in each pig house ground area to the denominator parameter is used as the edge parameter of each pig house ground area.

[0012] Furthermore, the method for obtaining the coverage possibility parameter includes:

[0013] The absolute value of the difference between the grayscale average value of all pixels in each pig house ground area and the prior grayscale value of the bare ground is used as the coverage possibility parameter of each pig house ground area.

[0014] Furthermore, the method for obtaining the screening parameters includes:

[0015] The average absolute deviation of the grayscale values ​​of the pixels in the ground area of ​​the pig house is used as a texture roughness parameter;

[0016] The product of the texture roughness parameter, the edge parameter and the coverage possibility parameter of each pig house floor area is normalized and used as the screening parameter of each pig house floor area.

[0017] Furthermore, the method for acquiring the target ground area includes:

[0018] The pig house floor area where the screening parameter is greater than a preset covering existence threshold is taken as the target floor area.

[0019] Furthermore, the method for obtaining the feces area possibility includes:

[0020] The target ground area is processed using an 8-chain code to obtain angles of adjacent chain codes to form an angle sequence; statistical characteristics of the angles in the angle sequence are analyzed to obtain a first parameter;

[0021] The mean absolute deviation of the gradient amplitude of the pixels in the target ground area is used as the second parameter;

[0022] Analyze the overall grayscale trend characteristics in the target ground area to obtain a third parameter;

[0023] The product of the first parameter, the second parameter and the third parameter is mapped and normalized using an exponential function to obtain the feces area possibility of the target ground area.

[0024] Furthermore, the method for obtaining the first parameter includes:

[0025] Performing cosine transformation on the angles in the angle sequence to obtain an angle cosine value sequence, performing negative correlation mapping on each cosine value in the angle cosine value sequence, and summing the mapping results to obtain a first parameter.

[0026] Furthermore, the method for obtaining the third parameter includes:

[0027] The difference between the maximum grayscale value and the average grayscale value of all pixels in the target ground area is negatively correlated to obtain an overall bias parameter; the product of the screening parameter of the target ground area and the overall bias parameter is used as the third parameter.

[0028] Furthermore, the method for obtaining the pig feces area to be tested includes:

[0029] The target ground area whose feces area possibility is greater than or equal to a preset feces area possibility threshold is marked as a pig feces area to be detected.

[0030] Furthermore, the method for obtaining the ground area of ​​the pig house includes:

[0031] The overhead image is processed using the OTSU algorithm to obtain a pig house ground image; the pig house ground image is processed using a selective search algorithm to obtain a pig house ground area.

[0032] The present invention has the following beneficial effects:

[0033] The present invention aims at the technical problem that the existing method is not accurate enough in obtaining the feces area, and proposes an intelligent pig feces detection system based on image feature analysis. The present invention first obtains the top view image of each fence of the pig house at a preset sampling interval, so as to finally stitch and superimpose multiple images to reduce the situation that part of the ground image cannot be obtained due to the occlusion of the pig body; further use image segmentation to obtain the ground area of ​​the pig house and exclude the interference of the pig body area; further use the smoothing characteristics, edge parameters and coverage possibility parameters of the ground area of ​​the pig house to screen the ground area of ​​the pig house, exclude the interference of the exposed ground area, obtain the target ground area, and narrow the search range of the pig feces area; further according to the distribution characteristics of the pixel points in the target ground area, the target ground area is screened, the interference of the soil block and the water stain area is reduced, and the pig feces area to be tested is obtained, and the search range of the living feces area is further narrowed; finally, the image of the pig feces area to be tested is input into the neural network to identify the target pig feces area, and then stitch and superimpose to obtain the complete pig feces area. The present invention screens out the areas most likely to be pig feces through multiple screenings, and then inputs them into the neural network for final recognition, thereby reducing interference factors, improving recognition accuracy, and reducing the image areas that need to be processed by the neural network, reducing the amount of calculation, and improving detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are 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.

[0035] Figure 1 A system block diagram of an intelligent pig feces detection system based on image feature analysis provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation method, structure, characteristics and effects of the intelligent detection system of pig feces based on image feature analysis proposed by the present invention are described in detail below 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.

[0037] 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.

[0038] The specific scheme of the intelligent pig feces detection system based on image feature analysis provided by the present invention is described in detail below with reference to the accompanying drawings.

[0039] See also Figure 1 , which shows a system block diagram of a pig feces intelligent detection system based on image feature analysis provided by an embodiment of the present invention, the system includes: an image acquisition module 101, an image segmentation module 102, a preliminary screening module 103, a fine screening module 104 and a feces detection module 105.

[0040] Image acquisition module 101: obtains a bird's-eye view image of each fence of the pig house at a preset sampling interval.

[0041] Since the activities of the pigs themselves will cover part of the ground area, making it impossible to obtain this part of the image, the embodiment of the present invention uses multiple sampling and unified splicing methods to set up a camera on the roof for overhead shooting, and uses multiple cameras to shoot multiple fences to ensure that the imaging angle can cover the entire area within a fence of the pig house, and multiple sampling areas are adjacent and non-overlapping. For each fence area in the pig house, take a photo every 5 minutes, take the images taken in the same fence area within an hour as a group of images, and then process all the images in the group, remove the pig body area in each image, reduce the interference of soil and water stains, and screen out the area that is most likely to be pig feces, thereby reducing the interference factors in the neural network recognition process, and obtaining a more accurate target pig feces area. Finally, the target pig feces area is superimposed and spliced ​​to obtain the feces detection result in the fence area.

[0042] Image segmentation module 102: performs image segmentation on the overhead image to obtain the ground area of ​​the pig house.

[0043] In the embodiment of the present invention, considering that there is a certain background interference in the pig body area for the identification of the feces area, which affects the accurate positioning of the feces area, and segmenting the image is more conducive to target recognition and detection, so that the focus can be placed on the local features of each area, so the overhead image is first segmented to eliminate the interference of the pig body area so as to more accurately locate the feces area.

[0044] Preferably, in one embodiment of the present invention, considering that there is an obvious difference in grayscale between the pig body area and the ground area, the OTSU algorithm is used to process the overhead image, find the maximum inter-class variance, separate the ground area and the pig body area, and obtain the pig house ground image; and considering that the selective search algorithm has a wide range of applicability and has a certain robustness to occlusions and complex scenes in the image, the pig house ground image is processed using the selective search algorithm, the pig house ground image is adaptively segmented, and the pig house ground area is obtained.

[0045] It should be noted that the OTSU algorithm and the selective search algorithm are already technical means well known to those skilled in the art and will not be described in detail here; in other embodiments of the present invention, the implementer may select other image segmentation methods such as the watershed algorithm to obtain the ground area of ​​the pig house.

[0046] Preliminary screening module 103: Obtain edge parameters of each pig house ground area according to the relative proportion of the number of edge pixels in each pig house ground area; Obtain coverage possibility parameters according to the deviation characteristics of the overall grayscale value of all pixels in the pig house ground area and the prior grayscale value of the bare ground; Obtain screening parameters according to the discrete characteristics of the grayscale values ​​of the pixels in each pig house ground area, combined with the edge parameters and the coverage possibility parameters; Screen out the target ground area according to the screening parameters.

[0047] The pig house ground areas with different characteristics are obtained through the image segmentation module 102. Since the ultimate goal is to detect pig feces on the ground, it is necessary to exclude the influence of bare ground without covering and screen out the target ground area with covering.

[0048] In the embodiment of the present invention, considering that the pig house usually uses concrete floor, if there is a covering on the ground, it will cause grayscale changes in the image, and it is known from experience that the coverings such as feces, soil and water stains on the pig house floor have lower grayscale values ​​than the bare ground. At the same time, there is diffuse reflection phenomenon. The grayscale changes in the covering area fluctuate greatly and are relatively not smooth. After edge detection of the image, there will be more edge points in the covering area, so the edge parameters and coverage possibility parameters are obtained respectively, and then the target ground area is screened out in combination with the smoothness feature.

[0049] Preferably, in one embodiment of the present invention, the edge pixel points of the overhead image are obtained by using the Sobel operator; the range of the number of edge pixel points contained in the pig house ground area is obtained as the denominator parameter; the ratio of the number of edge pixel points contained in each pig house ground area to the denominator parameter is used as the edge parameter of each pig house ground area; the larger the ratio of the number of edge pixel points to the denominator parameter, the larger the relative proportion of the number of edge pixel points in the pig house ground area, the larger the number of edge pixel points, the less likely it is a clean exposed ground, and the larger the edge parameter.

[0050] In another embodiment of the present invention, the implementer may directly normalize the number of edge pixels contained in each pig house floor area using a normalization function and use it as the edge parameter of the corresponding pig house floor area; or the implementer may use the average value of the number of edge pixels contained in all pig house floor areas as the denominator parameter, analyze the relative proportion of the number of edge pixels in each pig house floor area, and obtain the edge parameter.

[0051] It should be noted that, due to the difference in the distribution of pig manure in different pig house ground areas, the number of edge pixels contained in the pig house ground area will be different, and the range will not be 0, that is, the denominator parameter will not be 0.

[0052] It should be noted that using the Sobel operator to perform edge detection to obtain image edge points is a technical means well known to those skilled in the art and will not be described in detail here; in other embodiments of the present invention, the implementer may select other edge detection methods in the prior art to obtain the edge points of the image.

[0053] Preferably, in one embodiment of the present invention, considering that the greater the difference between the grayscale average value of the pixels in the pig house ground area and the prior grayscale value, the more likely it is that it is not bare ground, and the greater the possibility of having a cover, the grayscale average value of the pixels in the pig house ground area is used to represent the overall grayscale value of all pixels in the pig house ground area, and the deviation characteristics of the grayscale value are represented by the absolute value of the difference. Therefore, the absolute value of the difference between the grayscale average value of all pixels in each pig house ground area and the prior grayscale value of the bare ground is used as the coverage possibility parameter of each pig house ground area.

[0054] In another embodiment of the present invention, the deviation characteristics of the grayscale value can also be represented by a percentage difference, for example, the absolute value of the difference between the grayscale average value of all pixels in the pig house ground area and the prior grayscale value of the bare ground is used as the numerator, the prior grayscale value of the bare ground is used as the denominator, and the ratio is used as the coverage possibility parameter. The overall grayscale value of all pixels in the pig house ground area can also be obtained by weighted summing the mode, median and mean of the pixel grayscale values, for example, the weighted weights of the mode, median and mean are 0.3, 0.3 and 0.4 respectively, and the weighted summation result is used as the overall grayscale value of all pixels in the pig house ground area.

[0055] Preferably, in other embodiments of the present invention, taking into account that the mean absolute deviation (MAD) can reflect the discrete characteristics of data, the smaller the mean absolute deviation of the grayscale value of the pixel point, the smoother the grayscale change in the pig house floor area, the smaller the grayscale difference, the smaller the texture roughness parameter, and the smaller the screening parameter; the larger the edge parameter, the more edge pixels are contained in the pig house floor area, the greater the possibility of the existence of covering objects, and the larger the screening parameter; the larger the coverage possibility parameter, the greater the difference between the grayscale average value of the pixel points in the pig house floor area and the prior grayscale value, the more likely it is that it is not bare ground, and the larger the screening parameter; based on this, the mean absolute deviation of the grayscale value of the pixel points in the pig house floor area is used as the texture roughness parameter;

[0056] The product of the texture roughness parameter, edge parameter and covering possibility parameter of each pig house floor area is normalized and used as the screening parameter of each pig house floor area. The pig house floor area with screening parameters greater than the preset covering existence threshold is taken as the target floor area.

[0057] The calculation formula for the screening parameters includes:

[0058]

[0059] in, Indicates In the pig pen The first image collected Screening parameters for each pig house floor area; represents the maximum and minimum normalized function; Indicates In the pig pen The first image collected Texture roughness parameters of the floor area of ​​the pig house; Indicates In the pig pen The first image collected Edge parameters of the pig house floor area, The identifier symbol representing the number of edge pixels in the ground area of ​​the pig house. Indicates the maximum number of edge pixels in all pig house ground areas. Indicates the minimum number of edge pixels in all pig house ground areas. Indicates In the pig pen The first image collected The number of edge pixels in the ground area of ​​a pig house; Represents the prior gray value of the bare ground; Indicates In the pig pen The first image collected The average grayscale value of pixels in the ground area of ​​a pig house.

[0060] It should be noted that the calculation process of the mean absolute deviation is a technical means well known to those skilled in the art and will not be described in detail here. In other embodiments of the present invention, the implementer may also analyze the discrete characteristics of the grayscale values ​​in the floor area of ​​the pig house by calculating the variance or range or other methods to obtain the texture roughness parameters. When constructing the screening parameter calculation formula, other basic mathematical operations or function mappings may also be used to achieve relevant mappings, which are technical means well known to those skilled in the art and will not be described in detail here.

[0061] It should be noted that, in one embodiment of the present invention, the preset threshold value for the existence of coverings is 0.25, and the pig house floor area with screening parameters greater than the preset threshold value for the existence of coverings is used as the target floor area. In other embodiments of the present invention, the implementer may set other threshold values ​​for the existence of coverings.

[0062] It should be noted that the prior grayscale value of the bare ground is affected by factors such as the lighting effect of the pig house, camera parameters, and concrete material, and the implementer needs to set it according to the actual situation. In one embodiment of the present invention, it can be obtained in real time by setting the average grayscale value of an exposed ground area where there is no cover. In other embodiments of the present invention, the implementer can set a fixed empirical value or use other methods to obtain the prior grayscale value of the bare ground.

[0063] Fine screening module 104: according to the distribution characteristics of the pixels in the target ground area, combined with the screening parameters, the feces area possibility of each target ground area is obtained; according to the feces area possibility, the pig feces area to be tested is screened.

[0064] The preliminary screening module 103 screens out all target ground areas with covered objects, but not all covered objects are pig manure, and there may be other interference factors. Therefore, it is necessary to further analyze and screen the areas with covered objects to obtain the pig manure areas to be tested.

[0065] In the embodiment of the present invention, considering the presence of food residues in pig manure and the strong granularity of the manure area, the pixel distribution in the manure area is more uneven and the changes are more complicated compared with impurities such as clods of soil and water stains. In addition, the overall grayscale of the manure area is different from the grayscale of impurities such as clods of soil and water stains. Therefore, the possibility of the manure area of ​​each target ground area is obtained according to the distribution characteristics of the pixel points in the target ground area.

[0066] Preferably, in one embodiment of the present invention, considering that the edge lines of the feces area have more concave-convex fluctuations than those of the impurity area, and the edge changes more dramatically, and the 8-chain code is a commonly used encoding method for describing the contour or the edge of the area, obtaining the angle between adjacent chain codes can provide information about the change in the contour direction, and the size of the angle can be used to describe the curvature and shape change of the edge. The larger the angle, the more dramatic the change. In order to remove the angle dimension, the angle is subjected to cosine change and then negatively correlated mapping. At this time, the angle is positively correlated with the mapping result. After summing the mapping results of all angles, the first parameter for measuring the possibility of feces from the perspective of edge change can be obtained;

[0067] Considering that the random distribution of food residues affects the overall grayscale change, the gradient change is more random, so the mean absolute deviation of the gradient amplitude is used as the second parameter to measure the possibility of feces from the perspective of amplitude change;

[0068] At the same time, considering that pig manure contains a large amount of organic matter, such as cellulose, fat and other organic components, these organic substances may exhibit brighter characteristics optically because they may have greater scattering and reflection of light. Therefore, in comparison, the overall grayscale is relatively large, and the screening parameter can also reflect the smoothness of the regional grayscale. The larger the screening parameter, the less smooth it is, and the more likely it is a pig manure area. Therefore, the third parameter is obtained to measure the possibility of feces from the perspective of overall grayscale bias and grayscale fluctuation.

[0069] Based on this, the target ground area is processed using the 8-chain code to obtain the angles of adjacent chain codes to form an angle sequence; the angles in the angle sequence are cosine transformed to obtain an angle cosine value sequence; each cosine value in the angle cosine value sequence is negatively correlated mapped, and the mapping results are summed to obtain the first parameter;

[0070] The mean absolute deviation of the gradient amplitude of the pixels in the target ground area is used as the second parameter;

[0071] Analyze the overall grayscale trend characteristics in the target ground area, negatively correlate the difference between the maximum grayscale value and the average grayscale value of all pixels in the target ground area, and obtain the overall bias parameter; take the product of the screening parameter of the target ground area and the overall bias parameter as the third parameter;

[0072] The product of the first parameter, the second parameter and the third parameter is mapped and normalized using an exponential function to obtain the feces area possibility of the target ground area.

[0073] Taking any target ground area as an example, the calculation formula for the feces area possibility includes:

[0074]

[0075] in, Indicates the fecal area possibility of the current ground area; represents the maximum and minimum normalized function; Expressed as a natural constant An exponential function with base ; The first parameter representing the current ground area, , Represents the number of elements in the angle cosine sequence, Indicates the angle cosine value sequence The cosine of the elements, Indicates the angle sequence The angle value of the included angle, 2 is a natural number, used to adjust the cosine value range; The second parameter representing the current ground area, , Indicates the current target ground area. The gradient amplitude of each pixel, Represents the set of gradient amplitudes of pixels in the current target ground area. represents the mean absolute deviation function; The third parameter representing the current ground area, , Indicates the screening parameters of the current target ground area, Indicates the maximum grayscale value of pixels in the current target ground area. Represents the average grayscale value of pixels in the current target ground area. 1 is a natural number to prevent the denominator from being zero.

[0076] In the calculation formula for the possibility of a feces area, the larger the first parameter is, the lower the edge flatness of the current target ground area, the more drastic the edge change, the more irregular the shape, the more likely it is a feces area, and the greater the possibility of a feces area; the larger the second parameter is, the more drastic the gradient change in the current target ground area, the more likely it is the influence of food residues, the more likely it is a feces area, and the greater the possibility of a feces area; the larger the third parameter is, the more the current target ground area as a whole tends to high grayscale, the stronger the overall volatility, the more likely it is a feces area, and the greater the possibility of a feces area.

[0077] It should be noted that the water stain area may be affected by the uneven ground, the edges are irregular, and it will also reflect light, resulting in a larger overall grayscale in the water stain area. However, the grayscale changes in the water stain area are relatively smooth, so the screening parameters in the second and third parameters can effectively suppress this feature and reduce the possibility of the water stain area being misjudged as a feces area.

[0078] It should be noted that in other embodiments of the present invention, other positive parameters can be set to adjust the value range of the denominator when calculating the first parameter and the third parameter to avoid the denominator being a non-positive number. Other basic mathematical operations or function mappings can also be used to achieve relevant mappings. These are technical means well known to those skilled in the art and will not be elaborated here.

[0079] In one embodiment of the present invention, the target ground area whose feces area possibility is greater than or equal to a preset feces area possibility threshold is marked as a pig feces area to be detected, and the preset feces area possibility threshold is 0.85.

[0080] Feces detection module 105: The image of each pig feces area to be detected is passed through a pre-trained neural network to obtain the target pig feces area; the target pig feces areas in all the overhead images corresponding to each fence are superimposed and spliced ​​to obtain the complete pig feces area of ​​each fence.

[0081] By removing the pig body area in the overhead image, screening the target ground area, and screening the feces area to be tested, the scope is narrowed step by step, the pig feces area is accurately identified, and the interference of the pig body area, soil and water stains is reduced. The area most likely to be pig feces is screened out and input into the neural network for final recognition, reducing interference factors, improving recognition accuracy, and reducing the image area that needs to be processed by the neural network, reducing the amount of calculation, and improving detection efficiency.

[0082] Preferably, in one embodiment of the present invention, an existing Mask-RCNN network is selected, the structure is Encoder-Decoder, and the cross entropy loss function is used and pre-trained. The image of the pig feces area to be tested is input into the pre-trained neural network, and the labeled image is output. The pixel points of the target pig feces area are marked as 0. After all the target pig feces areas in the overhead image are obtained, they are marked in the overhead image, and the pixel points of the area outside the target pig feces area are marked as 1. The same group of images are superimposed and spliced ​​by mask superposition, and a complete pig feces area in a pig house fence can be obtained.

[0083] It should be noted that mask superposition and Mask-RCNN network are already technical means well known to those skilled in the art, and the detailed process will not be repeated here. In other embodiments of the present invention, the implementer can train other suitable neural networks to perform image processing.

[0084] After obtaining the pig manure area, it is possible to determine whether the fence needs to be cleaned in a timely manner by analyzing the area ratio of the manure area to the overall area of ​​the fence, or to use the information of the pig manure area to perform other operations.

[0085] In summary, the present invention aims at the technical problem that the existing methods are not accurate enough in obtaining the feces area, and proposes an intelligent pig feces detection system based on image feature analysis. The present invention first obtains a bird's-eye view image of each fence of the pig house; further uses image segmentation to obtain the ground area of ​​the pig house; further screens the ground area of ​​the pig house to obtain the target ground area, and narrows the search range of the pig feces area; further screens the target ground area to obtain the pig feces area to be tested, and further narrows the search range; finally, the image of the pig feces area to be tested is input into the neural network to identify the target pig feces area, and then the images are spliced ​​and superimposed to obtain the complete pig feces area. The present invention screens out the area that is most likely to be pig feces through multiple screenings, and then inputs it into the neural network for final identification, thereby reducing interference factors, improving recognition accuracy, and reducing the image area that needs to be processed by the neural network, reducing the amount of calculation, and improving detection efficiency.

[0086] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0087] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. An intelligent pig feces detection system based on image feature analysis, It is characterized in that The system comprises: Image acquisition module: obtains the top view image of each fence of the pig house at a preset sampling interval; Image segmentation module: performing image segmentation on the overhead image to obtain the ground area of ​​the pig house; Preliminary screening module: according to the relative proportion of the number of edge pixels in each pig house ground area, the edge parameters of each pig house ground area are obtained; according to the deviation characteristics of the overall gray value of all pixels in the pig house ground area and the prior gray value of the bare ground, the coverage possibility parameters are obtained; according to the discrete characteristics of the gray value of the pixels in each pig house ground area, the edge parameters and the coverage possibility parameters are combined to obtain the screening parameters; according to the screening parameters, the target ground area is screened out; Fine screening module: according to the distribution characteristics of the pixel points in the target ground area, combined with the screening parameters, the feces area possibility of each target ground area is obtained; according to the feces area possibility, the pig feces area to be tested is screened; Feces detection module: the image of each pig feces area to be detected is passed through a pre-trained neural network to obtain the target pig feces area; the target pig feces area in all the overhead images corresponding to each fence are superimposed and spliced ​​to obtain the complete pig feces area of ​​each fence; The method for obtaining the edge parameters includes: Obtain edge pixel points of the overhead image by using a Sobel operator; obtain the range of the number of edge pixel points contained in the pig house ground area as a denominator parameter; and use the ratio of the number of edge pixel points contained in each pig house ground area to the denominator parameter as the edge parameter of each pig house ground area; The method for obtaining the coverage possibility parameter includes: The absolute value of the difference between the grayscale average value of all pixels in each pig house ground area and the prior grayscale value of the bare ground is used as the coverage possibility parameter of each pig house ground area; The method for obtaining the screening parameters includes: The average absolute deviation of the grayscale values ​​of the pixels in the ground area of ​​the pig house is used as a texture roughness parameter; Normalizing the product of the texture roughness parameter, the edge parameter and the coverage possibility parameter of each pig house floor area as a screening parameter for each pig house floor area; The method for obtaining the feces area possibility includes: The target ground area is processed using an 8-chain code to obtain angles of adjacent chain codes to form an angle sequence; statistical characteristics of the angles in the angle sequence are analyzed to obtain a first parameter; The mean absolute deviation of the gradient amplitude of the pixels in the target ground area is used as the second parameter; Analyze the overall grayscale trend characteristics in the target ground area to obtain a third parameter; The product of the first parameter, the second parameter and the third parameter is mapped and normalized using an exponential function to obtain the feces area possibility of the target ground area; the method for obtaining the first parameter includes: Performing cosine transformation on the angles in the angle sequence to obtain an angle cosine value sequence, performing negative correlation mapping on each cosine value in the angle cosine value sequence, and summing the mapping results to obtain the first parameter; the method for obtaining the third parameter includes: The difference between the maximum grayscale value and the average grayscale value of all pixels in the target ground area is negatively correlated to obtain an overall bias parameter; the product of the screening parameter of the target ground area and the overall bias parameter is used as the third parameter.

2. According to the pig feces intelligent detection system based on image feature analysis described in claim 1, It is characterized in that The method for acquiring the target ground area includes: The pig house floor area where the screening parameter is greater than a preset covering existence threshold is taken as the target floor area.

3. According to the pig feces intelligent detection system based on image feature analysis described in claim 1, It is characterized in that The method for obtaining the pig feces area to be tested comprises: The target ground area whose feces area possibility is greater than or equal to a preset feces area possibility threshold is marked as a pig feces area to be detected.

4. According to the pig feces intelligent detection system based on image feature analysis described in claim 1, It is characterized in that The method for obtaining the ground area of ​​the pig house comprises: The overhead image is processed using the OTSU algorithm to obtain a pig house ground image; the pig house ground image is processed using a selective search algorithm to obtain a pig house ground area.

Citation Information

Patent Citations

  • Method for extracting foreground in piggery monitoring video

    CN102024146A

  • Water body anomaly detection method for aquaculture

    CN115100439A

  • Livestock manure rapid detection method based on computer vision

    CN115471502A

  • Visual image-based swinery surface anomaly detection system and method

    CN118279936A

  • Method and device for detecting object in image

    US20220139113A1