A multi-target recognition method and system based on vision technology
By analyzing the connected domain features of sheep flock remote sensing images and adjusting the step size parameters of the convolutional neural network, the problem of misidentification of multiple targets in dense sheep flock scenes was solved, and high-precision sheep identification was achieved.
Patent Information
- Application Number
- CN202510685888.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-05-27
AI Technical Summary
In scenes with dense flocks of sheep, existing technologies have difficulty accurately identifying multiple sheep, resulting in misidentification as a single sheep, affecting the accuracy and reliability of the recognition results.
By obtaining the connected domain of the sheep flock remote sensing image, analyzing the shape of the connected domain and the suspected sheep flock distribution value, using opening and corrosion operations to obtain the sheep flock closeness and false detection degree, and adjusting the step size parameters of the convolutional neural network, multi-target recognition is achieved.
The accuracy of multi-target recognition of sheep flocks is improved, and it can adapt to sheep flocks of different densities and complex backgrounds, maintaining high detection accuracy.
Smart Images

Figure CN120219727B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a multi-target recognition method and system based on vision technology. Background Art
[0002] With the continuous advancement of computer vision technology, deep learning-based object detection has been widely applied in various fields, such as video surveillance, autonomous driving, and smart agriculture. Accurately identifying and classifying individual sheep within a flock is particularly crucial in automated pasture management. For example, in Inner Mongolia, some herders use drones to graze their flocks and share the experience online through live streaming platforms. This innovative grazing method not only improves efficiency but also attracts online interest. However, in real-world live streaming applications, because sheep in a flock are often closely packed together and vary in size, inaccurate object recognition can easily occur, potentially leading to individual sheep being lost and causing economic losses for herders. In densely grazing scenarios, flocks often exhibit the following characteristics: close spatial distribution of individual sheep, resulting in high overlap; significant scale variation due to age and posture; and small sheep, when photographed from a distance, have a low pixel count. Consequently, when performing multi-object recognition on a flock, multiple sheep may be mistakenly identified as a single one, compromising the accuracy and reliability of the recognition results. Summary of the Invention
[0003] The present invention provides a multi-target recognition method and system based on vision technology to solve the existing problem that due to the close spatial distribution of individual sheep and the high overlap rate of sheep targets, multiple sheep may be mistakenly identified as one when performing multi-target recognition on a flock of sheep.
[0004] The present invention provides a multi-target recognition method and system based on visual technology, which adopts the following technical solutions:
[0005] The present invention proposes a multi-target recognition method based on visual technology, which includes the following steps:
[0006] Obtain remote sensing images of sheep flocks in pastures;
[0007] Obtain several connected domains in the remote sensing image of the sheep flock in the pasture; obtain the suspected sheep flock distribution value of each connected domain based on the internal distribution of the connected domain; obtain the degree of proximity of the sheep flocks in the connected domain based on the shape of the connected domain and the suspected sheep flock distribution value;
[0008] Perform multi-target recognition on the connected domain to obtain several target frames and corresponding target probabilities within the connected domain; obtain the sheep segmentation accuracy of each target frame within the connected domain based on the difference before and after the connected domain opening operation; obtain the false detection degree value of each target frame within the connected domain based on the edge distribution of the connected domain between the target frame and other target frames, as well as the sheep segmentation accuracy and target probability; obtain the comprehensive sheep recognition accuracy of the connected domain based on the close proximity of the sheep in the connected domain and the false detection degree value of the target frame; and obtain the optimal step size parameter of the convolutional neural network for multi-target recognition of sheep in the pasture based on the comprehensive sheep recognition accuracy;
[0009] A convolutional neural network based on the optimal step size is used to identify multiple sheep in remote sensing images of sheep flocks in pastures.
[0010] Preferably, the specific method for obtaining the suspected herd distribution value of each connected domain according to the internal distribution of the connected domain is:
[0011] For the first The connected domain is corroded to obtain the A connected domain is divided into multiple connected domains after corrosion; The number of connected domains that are divided into multiple connected domains after corrosion is the first The number of suspected sheep in the connected domain; The normalized value of the number of suspected sheep in the first connected domain is The product of the areas of the connected domains is taken as the The suspected herd distribution value in a connected domain.
[0012] Preferably, the specific method for obtaining the close proximity of the sheep herds in the connected domain according to the shape of the connected domain and the suspected sheep herd distribution value is:
[0013] According to the shape of the connected domain, obtain the significance of the gaps between the flocks in the connected domain;
[0014] The first The inverse proportional normalized value of the gap significance between the flocks in the first connected domain is The product of the suspected herd distribution values in the connected domain is used as the The closeness of the flock within a connected domain.
[0015] Preferably, the specific method for obtaining the significance of gaps between sheep in a connected domain according to the shape of the connected domain is:
[0016] No. The difference between the convex hull area and the area of the first connected domain is taken as the The blank area of the connected domain; The ratio of the blank area of the first connected domain to the convex hull area is used as the The significance of gaps between flocks in a connected domain.
[0017] Preferably, the specific method for obtaining the sheep segmentation inaccuracy of each target frame in the connected domain according to the difference before and after the opening operation of the connected domain is:
[0018] Use opening operation to The first The connected domain within the target box is corroded and expanded to obtain the first The connected domain within the target box; The area of the connected domain within the target box is equal to the area of the first The absolute value of the difference between the connected domains within the target box is recorded as the target difference;
[0019] In the The first The connected domain within the target frame is corroded and divided into multiple connected domains. The center position of the largest connected domain is connected to the first connected domain. The Euclidean distance between the center positions of the target boxes is recorded as the target distance; the product of the target difference and the target distance is used as the The first The segmentation accuracy of sheep in each target box is 0.
[0020] Preferably, the specific method for obtaining the false detection degree value of each target frame in the connected domain according to the edge distribution of the connected domain between the target frame and other target frames, as well as the sheep segmentation inaccuracy and target probability is:
[0021] For the For any two target frames in a connected domain, the target frame with a larger target probability is selected as the standard target frame, and the other one is selected as the comparison target frame; the image pyramid technology is used to scale the comparison target frame until it is the same size as the standard target frame;
[0022] Obtain the final matching similarity between the standard target frame and the comparison target frame;
[0023] Get the The first The final matching similarity between the target box and each target box in all connected domains is calculated by normalizing the inverse proportional value of the maximum value of the final matching similarity to the first The first The product of the segmentation inaccuracies of the target boxes is used as the The first The false detection degree value of the target box.
[0024] Preferably, the specific method for obtaining the final matching similarity between the standard target frame and the comparison target frame is:
[0025] In the vertical direction within the standard target frame, the highest pixel point on the edge of the connected domain within the standard target frame is selected as the starting point, and the chain code sequence of the standard target frame is obtained clockwise. In the vertical direction within the comparison target frame, the highest pixel point on the edge of the connected domain within the comparison target frame is selected as the starting point, and the chain code sequence of the comparison target frame is obtained clockwise. The inverse proportional normalized value of the DTW value between the chain code sequence of the standard target frame and the chain code sequence of the comparison target frame is used as the matching similarity between the standard target frame and the comparison target frame.
[0026] Preset a rotation parameter , rotate the comparison target frame clockwise each time , and obtain the matching similarity between the standard target frame and the comparison target frame after each rotation; among the matching similarities between the standard target frame and the comparison target frame corresponding to all rotations, the maximum matching similarity is taken as the final matching similarity between the standard target frame and the comparison target frame.
[0027] Preferably, the specific method for obtaining the comprehensive sheep identification accuracy of the connected domain based on the close proximity of the sheep in the connected domain and the false detection degree value of the target frame is:
[0028] The first The area of the connected domain is The absolute value of the difference between the cumulative sum of the areas of all connected domains in the target box in the first connected domain is recorded as the first difference; The average of the false detection degree values of all target boxes in the first connected domain is The ratio of the closeness of the flocks in the connected domain is recorded as the first ratio; the inverse proportional normalized value of the product of the first difference and the first ratio is recorded as the first The comprehensive sheep recognition accuracy of the connected domain.
[0029] Preferably, the specific method for obtaining the optimal step size parameter of the convolutional neural network for multi-target recognition of sheep in the pasture based on the comprehensive sheep recognition accuracy is:
[0030] For a convolutional neural network with any one step size parameter, when performing multi-target recognition on a remote sensing image of a sheep flock in a pasture using the convolutional neural network with any one step size parameter, the mean of the comprehensive sheep recognition accuracy of all connected domains in the remote sensing image of the sheep flock in the pasture is used as the optimization degree of the convolutional neural network with any one step size parameter;
[0031] Preset an initial maximum step size parameter and a minimum step size parameter , change the step size parameter of the convolutional neural network from Start to gradually decrease to , obtain the optimization degree of the convolutional neural network for each step parameter; the step parameter with the largest optimization degree is used as the optimal step parameter of the convolutional neural network for multi-target recognition of sheep in the pasture.
[0032] The present invention also proposes a multi-target recognition system based on vision technology, comprising a memory and a processor, wherein the processor executes a computer program stored in the memory to implement the steps of the above-mentioned multi-target recognition method based on vision technology.
[0033] The beneficial effects of the technical solution of the present invention are as follows: the present invention obtains the close proximity of sheep in the connected domain according to the shape of the connected domain and the suspected sheep distribution value; performs multi-target recognition on the connected domain to obtain several target frames and corresponding target probabilities in the connected domain; obtains the sheep segmentation inaccuracy of each target frame in the connected domain according to the difference before and after the opening operation of the connected domain; obtains the false detection degree value of each target frame in the connected domain according to the edge distribution of the connected domain between the target frame and other target frames, as well as the sheep segmentation inaccuracy and the target probability; and obtains the false detection degree value of each target frame in the connected domain according to the close proximity of sheep in the connected domain and the false detection degree value of the target frame. The comprehensive sheep recognition accuracy of the connected domain is obtained; based on the comprehensive sheep recognition accuracy, the optimal step size parameter of the convolutional neural network for multi-target recognition of sheep in the pasture is obtained; the convolutional neural network based on the optimal step size recognizes multi-target sheep in the remote sensing image of the sheep in the pasture; in this way, through the adaptive step size parameter strategy, the convolution kernel can scan the image more finely, and by analyzing the proximity information of the sheep in the target frame, the model can more accurately determine the position and size of the target frame, thereby improving the accuracy of detection; and the present invention can adapt to sheep flocks of different densities, and can still maintain a high detection accuracy under complex backgrounds and different lighting conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.
[0035] Figure 1 A flowchart of a multi-target recognition method based on visual technology according to the present invention;
[0036] Figure 2 This is a feature relationship flow chart of a multi-target recognition method based on visual technology of the present invention. DETAILED DESCRIPTION
[0037] To further illustrate the technical means and effects of the present invention to achieve the intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail a multi-target recognition method and system based on visual technology proposed by the present invention, including its specific implementation, structure, features, and effects. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable form.
[0038] 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.
[0039] The following describes in detail a multi-target recognition method and system based on visual technology provided by the present invention with reference to the accompanying drawings.
[0040] See also Figure 1 , which shows a flowchart of a multi-target recognition method based on visual technology provided by an embodiment of the present invention, the method includes the following steps:
[0041] Step S001: Acquire a remote sensing image of a sheep flock in a pasture.
[0042] In a specific implementation of the embodiment of the present invention, a method for acquiring a remote sensing image of a flock of sheep in a pasture is as follows:
[0043] Choose a DJI Phantom 4 RTK drone equipped with a high-definition RGB camera and plan the flight route using remote sensing software such as DJITerra to ensure coverage of the entire sheep range. Set the drone's flight altitude to 50 meters and ensure regular image capture during flight, ensuring a certain degree of image overlap to facilitate later stitching. Use remote sensing image processing software (such as Pix4D) to stitch the captured images together to generate a remote sensing image of the sheep within the pasture.
[0044] At this point, the remote sensing image of the sheep flock in the pasture is obtained through the above method.
[0045] Step S002: Obtain several connected domains in the remote sensing image of the sheep flock in the pasture; obtain the suspected sheep flock distribution value of each connected domain based on the internal distribution of the connected domain; obtain the degree of proximity of the sheep flock in the connected domain based on the shape of the connected domain and the suspected sheep flock distribution value.
[0046] It should be noted that in the live broadcast grazing scenes, the sheep flocks often present the following characteristics: the sheep flocks are closely distributed to form dense areas, and the intervals between target sheep in the densely populated areas are small, which affects accurate identification and classification; when the remote sensing image of the sheep flocks in the pasture is segmented to obtain multiple connected domains, the dense distribution of the sheep flocks leads to the existence of multiple sheep in a single connected domain. That is, the closer the sheep flocks in the connected domain are, the greater the possibility of multiple sheep existing in a single connected domain, which in turn makes the accuracy of sheep identification lower.
[0047] Preferably, in some implementations of the present invention, since sheep and pastures have a clear color distinction, that is, sheep are white and pasture grass is green, the Otsu threshold segmentation algorithm can be used to segment the remote sensing image of the sheep in the pasture to separate the sheep from the grass; and obtain several connected domains in the remote sensing image of the sheep in the pasture. The specific process is as follows:
[0048] The remote sensing image of the sheep flock in the pasture is subjected to threshold segmentation using the Otsu threshold segmentation algorithm to obtain a binary image of the remote sensing image of the sheep flock in the pasture; a gradient image of the binary image of the remote sensing image of the sheep flock in the pasture is obtained, and a watershed segmentation algorithm is performed on the gradient image to obtain multiple regions of the binary image of the remote sensing image of the sheep flock in the pasture. Each region is regarded as a connected domain, and further a plurality of connected domains in the remote sensing image of the sheep flock in the pasture are obtained.
[0049] Among them, in the process of threshold segmentation of the remote sensing image of the sheep in the pasture, the grayscale value of the pixel points greater than the Otsu threshold is recorded as 1, and the pixel points less than the Otsu threshold is recorded as 0; then the sheep area will be white, and the grassland area will be black; the Otsu threshold segmentation algorithm and the watershed segmentation algorithm are existing technologies, and this embodiment will not be described in detail here.
[0050] Preferably, in some implementations of the present invention, the larger the connected domain, the more sheep there are in the connected domain. However, since sheep vary in size, there are multiple connected regions with gaps in the connected domain. Therefore, the corrosion operation can be used to separate these regions. The more these regions there are, the more suspected sheep there are in the connected domain. Based on the internal distribution of the connected domain, the suspected sheep herd distribution value of each connected domain is obtained. The specific process is as follows:
[0051] For the first The connected domain is corroded to obtain the A connected domain is divided into multiple connected domains after corrosion; The number of connected domains that are divided into multiple connected domains after corrosion is the first The number of suspected sheep in the connected domain; The normalized value of the number of suspected sheep in the first connected domain is The product of the areas of the connected domains is taken as the The suspected herd distribution value in a connected domain.
[0052] The etching operation is a conventional technique and will not be described in detail in this embodiment.
[0053] Preferably, in some implementations of the embodiments of the present invention, for any connected domain in a remote sensing image of a sheep flock in a pasture, when multiple sheep form a connected domain, there must be gaps between the sheep. The smaller the ratio between the area of the blank area within the connected domain and the area of the convex hull of the connected domain, the less significant the gaps between the sheep flocks, indicating that the distribution of the sheep flocks in the connected domain is dense. Based on the shape of the connected domain and the suspected sheep flock distribution value, the degree of close proximity of the sheep flocks in the connected domain is obtained. The specific process is as follows:
[0054] No. The difference between the convex hull area and the area of the first connected domain is taken as the The blank area of the connected domain; The ratio of the blank area of the first connected domain to the convex hull area is used as the The significance of gaps between flocks in a connected domain;
[0055] The first The inverse proportional normalized value of the gap significance between the flocks in the first connected domain is The product of the suspected herd distribution values in the connected domain is used as the The closeness of the flock within a connected domain;
[0056] The specific formula is:
[0057]
[0058] Where, Indicates the The closeness of the flock within a connected domain; Indicates the Suspected herd distribution value within a connected domain; Indicates the The significance of gaps between flocks in a connected domain; Represents an exponential function with a natural constant as its base.
[0059] Wherein, obtaining the convex hull area of the connected domain is a prior art and will not be described in detail in this embodiment.
[0060] So far, the close proximity of the flocks in the connected domain is obtained through the above method.
[0061] Step S003: Perform multi-target recognition on the connected domain to obtain several target frames and corresponding target probabilities in the connected domain; obtain the sheep segmentation inaccuracy of each target frame in the connected domain based on the difference before and after the opening operation of the connected domain; obtain the false detection degree value of each target frame in the connected domain based on the edge distribution of the connected domain between the target frame and other target frames, as well as the sheep segmentation inaccuracy and target probability; obtain the comprehensive sheep recognition accuracy of the connected domain based on the close proximity of the sheep in the connected domain and the false detection degree value of the target frame; and obtain the optimal step size parameter of the convolutional neural network for multi-target recognition of sheep in the pasture based on the comprehensive sheep recognition accuracy.
[0062] It should be noted that when herders show their flocks to netizens, they usually drive the flocks to a fixed area to facilitate netizens to observe the activities between the flocks. This will cause the flocks to be close together, and the corrosion operation cannot effectively segment the connected domain corresponding to each sheep. Therefore, neural networks can be used to further perform multi-target recognition of the flocks. Traditional methods identify and classify each sheep in the flock using a fixed-step convolutional neural network for target positioning. However, due to the dense distribution of the flocks, when the target detection model is used to identify individual sheep, when there are multiple sheep in a connected domain, the target box will be segmented. However, due to the close proximity of the flocks, a target box may contain not only a complete single sheep but also incomplete parts of other sheep, or there may be incomplete parts of multiple sheep without a complete single sheep. These are all falsely detected target boxes. Therefore, it is necessary to analyze the falsely detected target boxes generated by the convolutional neural network under different iterative step sizes, evaluate the accuracy of the convolutional neural network for individual sheep detection under each step size, and then obtain the convolutional neural network with the optimal step size parameter.
[0063] Preferably, in some implementations of the present invention, multi-target recognition is performed on the connected domain to obtain several target frames and corresponding target probabilities within the connected domain. The specific process is as follows:
[0064] Preset an initial maximum step size parameter and a minimum step size parameter , input the remote sensing image of the sheep flock in the pasture to the initial maximum step length parameter In the target detection model combining the region proposal network (RPN) and the convolutional neural network (CNN), several target boxes and corresponding target probabilities are obtained;
[0065] Among them, the target detection model combining the region proposal network (RPN) and the convolutional neural network (CNN) is an existing technology and will not be described in detail in this embodiment.
[0066] It should be noted that when there are multiple sheep in the connected domain, in the process of using the target frame for identification and segmentation, due to the close proximity of the sheep, not only a complete single sheep but also incomplete parts of other sheep may exist in a target frame; therefore, it is necessary to analyze the target frame in the connected domain to determine whether it belongs to this situation; when the target frame is a normal target frame, first of all, its target probability is relatively high; secondly, when compared with other normal target frames, the edge contours of the sheep in the two frames are similar, so the chain code can be used to obtain the matching similarity between the two; however, if the direction of the sheep's head is inconsistent, the chain code direction will also be inconsistent, so the direction of the sheep's head needs to be classified as consistent. After obtaining the matching similarity between the two, the matching similarity between the target frame and other target frames is analyzed to obtain the false detection degree value of the target frame; and then a comprehensive analysis is conducted to obtain the sheep recognition accuracy of the connected domain.
[0067] Preferably, in some implementations of the embodiments of the present invention, due to the close proximity of the flock of sheep, not only a complete single sheep but also incomplete parts of other sheep may exist in a target frame; therefore, when the connected domain in the target frame is corroded and expanded using the opening operation, the area change of the connected domain before and after the opening operation is quite different; and after the corrosion operation is performed on the connected domain in the target frame, the eroded connected domain is divided into multiple connected domains, and the center position of the largest connected domain must be significantly different from the center position of the target frame; and when the target frame is a normal target frame, there is only one sheep in the frame, and the center position of the largest connected domain must be close to the center position of the target frame; according to the difference before and after the opening operation of the connected domain, the sheep segmentation inaccuracy of each target frame in the connected domain is obtained; the specific method is:
[0068] Use opening operation to The first The connected domain within the target box is corroded and expanded to obtain the first The connected domain within the target box; The area of the connected domain within the target box is equal to the area of the first The absolute value of the difference between the connected domains within the target box is recorded as the target difference;
[0069] In the The first The connected domain within the target frame is corroded and divided into multiple connected domains. The center position of the largest connected domain is connected to the first connected domain. The Euclidean distance between the center positions of the target boxes is recorded as the target distance; the product of the target difference and the target distance is used as the The first Inaccuracy in the segmentation of sheep in each target box;
[0070]
[0071] Where, Indicates the inaccuracy of sheep segmentation in the target box; Represents the Euclidean distance between the center position of the target box and its erosion center position; It represents the absolute value of the difference between the area of the connected domain in the target box before the opening operation and the area of the connected domain in the target box after the opening operation.
[0072] The opening operation is a prior art and will not be described in detail in this embodiment.
[0073] Preferably, in some implementations of the embodiments of the present invention, when the target frame is a normal target frame, first, its target probability is relatively high; second, when compared with other normal target frames, the edge contours of the sheep in the two frames are similar, so the chain code can be used to obtain the matching similarity between the two; however, if the sheep head directions are inconsistent, the chain code directions will also be inconsistent, so the sheep head directions of the two need to be classified as consistent. After obtaining the matching similarity between the two, the matching similarity between the target frame and the other target frames is analyzed to obtain the false detection degree value of the target frame; according to the shape distribution of the connected domain between the target frame and the other target frames, and the target probability, the false detection degree value of each target frame in the connected domain is obtained; the specific method is:
[0074] For the For any two target frames in a connected domain, the target frame with a larger target probability is selected as the standard target frame, and the other one is selected as the comparison target frame; the image pyramid technology is used to scale the comparison target frame until it is the same size as the standard target frame;
[0075] In the vertical direction within the standard target frame, the highest pixel point on the edge of the connected domain within the standard target frame is selected as the starting point, and the chain code sequence of the standard target frame is obtained clockwise. In the vertical direction within the comparison target frame, the highest pixel point on the edge of the connected domain within the standard target frame is selected as the starting point, and the chain code sequence of the comparison target frame is obtained clockwise. The inverse proportional normalized value of the DTW value between the chain code sequence of the standard target frame and the chain code sequence of the comparison target frame is used as the matching similarity between the standard target frame and the comparison target frame.
[0076] The chain code sequence of the target frame is the chain code sequence of the edge of the connected domain within the target frame, and the chain code sequence of the edge of the connected domain and the image pyramid technology are existing technologies, which will not be described in detail in this embodiment.
[0077] Preset a rotation parameter , rotate the comparison target frame clockwise each time , and obtain the matching similarity between the standard target frame and the comparison target frame after each rotation; among the matching similarities between the standard target frame and the comparison target frame corresponding to all rotations, the maximum matching similarity is taken as the final matching similarity between the standard target frame and the comparison target frame;
[0078] Get the The first The final matching similarity between the target box and each target box in all connected domains is calculated by normalizing the inverse proportional value of the maximum value of the final matching similarity to the first The first The product of the segmentation inaccuracies of the target boxes is used as the The first The false detection degree value of the target box;
[0079] The specific formula is:
[0080] Where, Indicates the The first The false detection degree value of the target box; Indicates the The first Inaccuracy in the segmentation of sheep in each target box; Represents the number of all target boxes in all connected domains; Indicates the The target box and The first The final matching similarity between target boxes; represents the maximum value function; Represents an exponential function with a natural constant as its base.
[0081] Among them, during the rotation process, the highest pixel point at the edge of the connected domain in the vertical direction is still selected as the starting point of the chain code; The greater the final matching similarity between the first target frame and other target frames, the greater the The greater the probability that the first target box is a normal target box; on the contrary, The greater the probability that the first target frame is a false detection target frame, the The larger the false detection degree of the target box, the greater the false detection degree of the target box.
[0082] Preferably, in some implementations of the embodiments of the present invention, since the smaller the degree of close proximity of the sheep in the connected domain, it should be easier to segment, but a larger segmentation error occurs at this time, indicating that the convolutional neural network under the step size parameter has a lower accuracy in identifying the sheep in the connected domain; and the high sheep overlap rate will cause repetition between target frames in the connected domain. When the repeated area is larger, the separation effect of the sheep in the connected domain is worse, and when the false detection degree value of the target frame in the domain is larger, and the closer the sheep in each connected domain is, the less accurate the result of the output target frame is, the less suitable the multi-target recognition is, that is, the lower the accuracy of the comprehensive sheep recognition of the connected domain is; according to the close proximity of the sheep in the connected domain and the false detection degree value of the target frame, the specific method for obtaining the comprehensive sheep recognition accuracy of the connected domain is:
[0083] The first The area of the connected domain is The absolute value of the difference between the cumulative sum of the areas of all connected domains in the target box in the first connected domain is recorded as the first difference; The average of the false detection degree values of all target boxes in the first connected domain is The ratio of the closeness of the flocks in the connected domain is recorded as the first ratio; the inverse proportional normalized value of the product of the first difference and the first ratio is recorded as the first Comprehensive sheep recognition accuracy of connected domains;
[0084] The specific formula is:
[0085]
[0086] Where, Indicates the Comprehensive sheep recognition accuracy of connected domains; Indicates the The area of a connected domain; Indicates the The first The area of the connected domain in the target box; Indicates the The number of all target boxes in a connected domain; Indicates the The mean of the false detection degree values of all target boxes in a connected domain; Indicates the The closeness of the flock within a connected domain; Represents an exponential function with a natural constant as its base.
[0087] It should be noted that for any convolutional neural network with a step size parameter, the greater the comprehensive sheep recognition accuracy of the connected domain in the remote sensing image of the sheep flock in the pasture, the higher the degree of preference of the convolutional neural network with this step size parameter; therefore, the optimal step size parameter of the convolutional neural network for multi-target recognition of the sheep flock in the pasture is obtained based on the comprehensive sheep recognition accuracy.
[0088] Preferably, in some implementations of the embodiments of the present invention, the specific method for obtaining the optimal step size parameter of the convolutional neural network for multi-target recognition of sheep in a pasture is:
[0089] For a convolutional neural network with any one step size parameter, when performing multi-target recognition on a remote sensing image of a sheep flock in a pasture using the convolutional neural network with any one step size parameter, the mean of the comprehensive sheep recognition accuracy of all connected domains in the remote sensing image of the sheep flock in the pasture is used as the optimization degree of the convolutional neural network with any one step size parameter;
[0090] Change the step size parameter of the convolutional neural network from Start to gradually decrease to , obtain the optimization degree of the convolutional neural network for each step parameter; the step parameter with the largest optimization degree is used as the optimal step parameter of the convolutional neural network for multi-target recognition of sheep in the pasture.
[0091] At this point, the optimal step size parameters of the convolutional neural network for multi-target recognition of sheep in the pasture are obtained through the above method.
[0092] Step S004: Identify multiple target sheep in the remote sensing image of the sheep flock in the pasture based on the convolutional neural network with the optimal step size.
[0093] It should be noted that by analyzing the proximity information of the sheep in the live grazing scene, the model can more accurately determine the update position of the target frame and improve the accuracy of detection; this embodiment can adapt to sheep flocks of different densities in the live grazing scene, and can still maintain a high detection accuracy under complex backgrounds and different lighting conditions.
[0094] In a specific implementation of the embodiment of the present invention, the optimal step size parameter of the remote sensing image of the sheep flock in the pasture is input into the target detection model combining the region proposal network (RPN) and the convolutional neural network (CNN) to obtain a number of target boxes, each of which corresponds to each sheep in the pasture;
[0095] The specific method to obtain the data set of the neural network is:
[0096] A large number of remote sensing images of sheep flocks in pastures are collected, and the position of each sheep in each remote sensing image of the sheep flocks in the pasture is manually marked with a bounding box. This marking result is recorded as the label of each remote sensing image of the sheep flocks in the pasture; a large number of remote sensing images of sheep flocks in the pasture and their corresponding labels are collected to form a data set; the neural network is trained using the data set, and the loss function used in the training process is the mean square error loss function; the specific training process is well known in neural networks, and this solution will not repeat the specific training process.
[0097] See also Figure 2 , which shows a feature relationship flow chart of a multi-target recognition method based on visual technology;
[0098] Through the above steps, a multi-target recognition method based on visual technology is completed.
[0099] Another embodiment of the present invention provides a multi-target recognition system based on vision technology, the system comprising a memory and a processor, and when the processor executes the computer program stored in the memory, it performs steps S001 to S004 of the above method.
[0100] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A multi-target recognition method based on visual technology, characterized in that: The method comprises the following steps: Obtain remote sensing images of sheep flocks in pastures; Obtain several connected domains in the remote sensing image of the sheep flock in the pasture; obtain the suspected sheep flock distribution value of each connected domain based on the internal distribution of the connected domain; obtain the degree of proximity of the sheep flocks in the connected domain based on the shape of the connected domain and the suspected sheep flock distribution value; Perform multi-target recognition on the connected domain to obtain several target frames and corresponding target probabilities within the connected domain; obtain the sheep segmentation accuracy of each target frame within the connected domain based on the difference before and after the connected domain opening operation; obtain the false detection degree value of each target frame within the connected domain based on the edge distribution of the connected domain between the target frame and other target frames, as well as the sheep segmentation accuracy and target probability; obtain the comprehensive sheep recognition accuracy of the connected domain based on the close proximity of the sheep in the connected domain and the false detection degree value of the target frame; and obtain the optimal step size parameter of the convolutional neural network for multi-target recognition of sheep in the pasture based on the comprehensive sheep recognition accuracy; The convolutional neural network based on the optimal step size is used to identify multiple sheep in the remote sensing images of the sheep flock in the pasture; The specific method for obtaining the suspected herd distribution value of each connected domain according to the internal distribution of the connected domain is: For the first The connected domain is corroded to obtain the A connected domain is divided into multiple connected domains after corrosion; The number of connected domains that are divided into multiple connected domains after corrosion is the first The number of suspected sheep in the connected domain; The normalized value of the number of suspected sheep in the first connected domain is The product of the areas of the connected domains is taken as the Suspected herd distribution value within a connected domain; The specific method for obtaining the close proximity of the sheep herds in the connected domain according to the shape of the connected domain and the suspected sheep herd distribution value is as follows: According to the shape of the connected domain, obtain the significance of the gaps between the flocks in the connected domain; The first The inverse proportional normalized value of the gap significance between the flocks in the first connected domain is The product of the suspected herd distribution values in the connected domain is used as the The closeness of the flock within a connected domain.
2. The multi-target recognition method based on visual technology according to claim 1, characterized in that: The specific method for obtaining the significance of gaps between sheep in a connected domain according to the shape of the connected domain is: No. The difference between the convex hull area and the area of the first connected domain is taken as the The blank area of the connected domain; The ratio of the blank area of the first connected domain to the convex hull area is used as the The significance of gaps between flocks in a connected domain.
3. The multi-target recognition method based on visual technology according to claim 1, characterized in that: The specific method for obtaining the sheep segmentation inaccuracy of each target frame in the connected domain based on the difference before and after the opening operation of the connected domain is: Use opening operation to The first The connected domain within the target box is corroded and expanded to obtain the first The connected domain within the target box; The area of the connected domain within the target box is equal to the area of the first The absolute value of the difference between the connected domains within the target box is recorded as the target difference; In the The first The connected domain within the target frame is corroded and divided into multiple connected domains. The center position of the largest connected domain is connected to the first connected domain. The Euclidean distance between the center positions of the target boxes is recorded as the target distance; the product of the target difference and the target distance is used as the The first The segmentation accuracy of sheep in each target box is 0.
4. The multi-target recognition method based on visual technology according to claim 1, characterized in that: The specific method for obtaining the false detection degree value of each target frame in the connected domain according to the edge distribution of the connected domain between the target frame and other target frames, as well as the sheep segmentation inaccuracy and target probability is as follows: For the For any two target frames in a connected domain, select the target frame with a larger target probability as the standard target frame and the other as the comparison target frame; Use image pyramid technology to scale the comparison target box until it is the same size as the standard target box; Obtain the final matching similarity between the standard target frame and the comparison target frame; Get the The first The final matching similarity between the target box and each target box in all connected domains is calculated by normalizing the inverse proportional value of the maximum value of the final matching similarity to the first The first The product of the segmentation inaccuracies of the target boxes is used as the The first The false detection degree value of the target box.
5. The multi-target recognition method based on visual technology according to claim 4, characterized in that: The specific method for obtaining the final matching similarity between the standard target frame and the comparison target frame is: In the vertical direction within the standard target frame, the highest pixel point on the edge of the connected domain within the standard target frame is selected as the starting point, and the chain code sequence of the standard target frame is obtained clockwise. In the vertical direction within the comparison target frame, the highest pixel point on the edge of the connected domain within the comparison target frame is selected as the starting point, and the chain code sequence of the comparison target frame is obtained clockwise. The inverse proportional normalized value of the DTW value between the chain code sequence of the standard target frame and the chain code sequence of the comparison target frame is used as the matching similarity between the standard target frame and the comparison target frame. Preset a rotation parameter , rotate the comparison target frame clockwise each time , and obtain the matching similarity between the standard target frame and the comparison target frame after each rotation; among the matching similarities between the standard target frame and the comparison target frame corresponding to all rotations, the maximum matching similarity is taken as the final matching similarity between the standard target frame and the comparison target frame.
6. The multi-target recognition method based on visual technology according to claim 1, characterized in that: The specific method for obtaining the comprehensive sheep identification accuracy of the connected domain based on the close proximity of the sheep in the connected domain and the false detection degree value of the target frame is: The first The area of the connected domain is The absolute value of the difference between the cumulative sum of the areas of all connected domains in the target box in the first connected domain is recorded as the first difference; The average of the false detection degree values of all target boxes in the first connected domain is The ratio of the closeness of the flocks in the connected domain is recorded as the first ratio; The inverse normalized value of the product of the first difference and the first ratio is used as the first The comprehensive sheep recognition accuracy of the connected domains.
7. The multi-target recognition method based on visual technology according to claim 1, characterized in that: The specific method for obtaining the optimal step size parameter of the convolutional neural network for multi-target recognition of sheep in a pasture based on the comprehensive sheep recognition accuracy is as follows: For a convolutional neural network with any one step size parameter, when performing multi-target recognition on a remote sensing image of a sheep flock in a pasture using the convolutional neural network with any one step size parameter, the mean of the comprehensive sheep recognition accuracy of all connected domains in the remote sensing image of the sheep flock in the pasture is used as the optimization degree of the convolutional neural network with any one step size parameter; Preset an initial maximum step size parameter and a minimum step size parameter , change the step size parameter of the convolutional neural network from Start to gradually decrease to , obtain the optimization degree of the convolutional neural network for each step parameter; the step parameter with the largest optimization degree is used as the optimal step parameter of the convolutional neural network for multi-target recognition of sheep in the pasture.
8. A multi-target recognition system based on visual technology, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by a processor, the steps of the multi-target recognition method based on visual technology as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Video subject content detection method and system based on deep learning
CN115601688A
Vision-assisted milk sheep quantity counting method and system
CN118628984A