Target detection method and apparatus
By acquiring panoramic images and their regional information at multiple different times in the cluster, and combining regional and contour overlap to filter out objects suspected of being dead, and using a target state detection model to determine their survival status, the problem of low detection efficiency and insufficient accuracy in the cluster is solved, and efficient and accurate survival status detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-28
- Publication Date
- 2026-03-24
AI Technical Summary
When detecting the survival status of an object in a cluster, existing technologies suffer from problems such as large image recognition workload, low recognition efficiency and inaccuracy, and the inability of infrared cameras to cover the entire cluster.
By acquiring panoramic images and their regional information at multiple different times, objects suspected of being dead are screened out using regional overlap and contour overlap, and the survival status of the objects is determined using a pre-trained target state detection model.
It achieves efficient and accurate detection of the life and death status of objects in the cluster, reduces the false alarm rate, and ensures the comprehensiveness and accuracy of the detection.
Smart Images

Figure CN116129513B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a target detection method and device. BACKGROUND
[0002] At present, how to detect the survival state of a to-be-detected object in a cluster is a big problem in the field of target detection. In the prior art, a camera device is usually used to capture a cluster image, and the cluster image is input into an image recognition model for recognition to identify the survival state of the to-be-detected object. However, when the cluster size is large, the workload of image recognition is large, and the survival state of the to-be-detected object is determined only by the recognition result of the image recognition model, which is prone to inaccurate recognition and low recognition efficiency. Alternatively, an infrared camera is used to capture a cluster image, and the survival state of the to-be-detected object is determined according to the body temperature information on the cluster image. Since the focal length of the infrared camera is generally too long, it cannot achieve a wide-angle effect, and therefore cannot cover the entire cluster, so it is difficult to comprehensively identify the survival state of the to-be-detected object in the cluster. SUMMARY
[0003] The purpose of the embodiments of the present application is to provide a target detection method and device, which can accurately and efficiently detect the survival state of a large number of objects in a cluster.
[0004] To solve the above technical problems, the embodiments of the present application are implemented as follows:
[0005] In one aspect, the embodiments of the present application provide a target detection method, comprising:
[0006] obtaining first panoramic images of a plurality of target candidate objects at N different time instants and region information in the first panoramic images, N being an integer greater than or equal to 2;
[0007] determining a region coincidence degree of each target candidate object at the N different time instants according to the region information, and determining at least one first target object according to the region coincidence degree; wherein the first target object is a target candidate object whose region coincidence degree is greater than or equal to a first preset coincidence degree threshold;
[0008] obtaining a region image and a contour image of each first target object in two first panoramic images with the latest time instant among the N first panoramic images according to the region information;
[0009] determining a contour coincidence degree of each first target object in the two first panoramic images with the latest time instant according to the contour image corresponding to each first target object, and determining a second target object according to the contour coincidence degree; wherein the second target object is a first target object whose contour coincidence degree is greater than or equal to a second preset coincidence degree threshold.
[0010] inputting the region image corresponding to the second target object into a pre-trained target state detection model, and outputting a probability that the second target object is in a death state and / or a survival state.
[0011] In another aspect, an embodiment of the present application provides a target detection device, comprising:
[0012] The first acquisition module is configured to acquire first panoramic images of a plurality of target candidate objects at N different time instants and region information in the first panoramic images, N being an integer greater than or equal to 2.
[0013] The first determination module is configured to determine a region coincidence degree of each target candidate object at the N different time instants according to the region information, and determine at least one first target object according to the region coincidence degree, wherein the first target object is a target candidate object whose region coincidence degree is greater than or equal to a first preset coincidence degree threshold.
[0014] The second acquisition module is configured to acquire, according to the region information, a region image and a contour image of each first target object in two first panoramic images with the latest time instants among the N first panoramic images.
[0015] The second determination module is configured to determine a contour coincidence degree of each first target object in the two first panoramic images with the latest time instants according to the contour image corresponding to each first target object, and determine a second target object according to the contour coincidence degree, wherein the second target object is a first target object whose contour coincidence degree is greater than or equal to a second preset coincidence degree threshold.
[0016] The target state detection module is configured to input the region image corresponding to the second target object into a pre-trained target state detection model, and output a probability that the second target object is in a death state and / or a survival state.
[0017] In still another aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory electrically connected to the processor, wherein the memory stores a computer program, and the processor is configured to call and execute the computer program from the memory to implement the target detection method.
[0018] In still another aspect, an embodiment of the present application provides a storage medium for storing a computer program, wherein the computer program can be executed by a processor to implement the target detection method.
[0019] By adopting the technical solutions of the embodiments of the present application, when the survival states of the plurality of target candidate objects in the cluster are detected, the first panoramic images of the plurality of target candidate objects at N different time instants and the region information in the first panoramic images are obtained, and according to the region information, the region coincidence degrees of each target candidate object at the N different time instants are determined. Since the object in the survival state will not be stationary, the region coincidence degree of a single object in the survival state in different panoramic images will be relatively small, or even completely not coincident. Therefore, by determining the target candidate object with a region coincidence degree greater than or equal to a first preset coincidence degree threshold as a first target object, the object suspected to be in a death state (i.e., the first target object) can be efficiently and accurately preliminarily screened out from the N first panoramic images. Moreover, since the panoramic image can cover all target candidate objects in the current scene, by screening in all target candidate objects, the comprehensiveness of the screening result (i.e., the object suspected to be in a death state) can be ensured.
[0020] Further, since the first target object is only the object suspected to be in a death state preliminarily screened out, in order to further improve the detection accuracy of the object in a death state and reduce the false positive rate of the object in a death state, the first target object needs to be further screened. According to the region information, the region image and the contour image of each first target object in the two first panoramic images with the latest time instant are obtained, so as to determine the contour coincidence degree of each first target object in the two first panoramic images with the latest time instant according to the contour image corresponding to each first target object, and the first target object with a contour coincidence degree greater than or equal to a second preset coincidence degree threshold is determined as a second target object. Since the contour coincidence degree calculation is only performed on the preliminarily screened first target object, but not on all target candidate objects, the amount of calculation is reduced, thereby improving the determination efficiency of the second target object. In addition, since the object in the survival state may not change position but change posture (i.e., only the contour changes) within a period of time, that is, the object in the survival state may have the following situation: the region coincidence degree in different panoramic images is relatively high, but the contour coincidence degree is relatively small. Therefore, by determining the contour coincidence degree of the object suspected to be in a death state (i.e., the first target object) in a plurality of panoramic images, the second target object with a higher possibility of being in a death state can be screened out from the first target object, thereby further improving the accuracy of the screened object in a death state. Further, the region image corresponding to the second target object is input into a pre-trained target state detection model, and the probability of the second target object being in a death state and / or a survival state is output.
[0021] It can be seen that in the process of detecting the survival state of a single object in the cluster, the area coincidence degree of the single object in the multiple panoramic images is used to preliminarily screen the first target object suspected to be in the death state from the multiple objects, so as to further screen the second target object with a higher possibility of being in the death state from the first target objects according to the contour coincidence degree of each first target object in the multiple panoramic images, and finally determine the state of the second target object by using the target state detection model. The position and posture of the single object at multiple moments are comprehensively considered, instead of only relying on the recognition result output by the image recognition model. After layer-by-layer screening of multiple limiting conditions, the object in the death state determined is more comprehensive and accurate, and the false positive rate of the object in the death state is reduced. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0023] Figure 1 is a schematic flow chart of a target detection method according to an embodiment of the present application;
[0024] Figure 2 is an implementation principle schematic diagram of a training process of a target region detection model according to an embodiment of the present application;
[0025] Figure 3 is an implementation principle schematic diagram of a training process of an image segmentation model according to an embodiment of the present application;
[0026] Figure 4 is an implementation principle schematic diagram of a training process of a target state detection model according to an embodiment of the present application;
[0027] Figure 5 is an implementation principle schematic diagram of a target detection method according to an embodiment of the present application;
[0028] Figure 6 is a structural schematic diagram of a target detection device according to an embodiment of the present application;
[0029] Figure 7 is a hardware structure schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] The embodiment of the present application provides a target detection method and device, which is beneficial to accurately and efficiently detecting the survival state of a large number of objects in a cluster.
[0031] In order for those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the protection scope of the present application.
[0032] In the detection of the survival state of the to-be-detected object in the cluster, the following methods are generally used for detection: one is to shoot a cluster image through a camera device, input the cluster image into an image recognition model for recognition, and thus recognize the survival state of the to-be-detected object. However, when the cluster size is large, the workload of image recognition is large, and the survival state of the to-be-detected object is determined by the recognition result of the image recognition model alone, which is prone to inaccurate recognition and low recognition efficiency. Another method needs to shoot a cluster image through an infrared camera, and determine the survival state of the to-be-detected object according to the body temperature information on the cluster image. Since the focal length of the infrared camera is generally too long, it cannot achieve a wide-angle effect, and thus cannot cover the entire cluster, so it is difficult to comprehensively recognize the survival state of the to-be-detected object in the cluster. It can be seen that if the survival state of the to-be-detected object is detected only by relying on the image recognition model or only by relying on the infrared image, neither of them can achieve a good detection effect. Based on this, the present application comprehensively considers the differences in the positions and postures of single objects in death state and survival state at multiple moments, preliminarily screens out first target objects suspected to be in death state from multiple objects through the area coincidence degree of single objects in multiple panoramic images, further screens out second target objects more likely to be in death state from the first target objects according to the contour coincidence degree of each first target object in multiple panoramic images, and finally determines the state of the second target object by using a target state detection model, so as to comprehensively and accurately determine the object in death state through multiple limiting conditions, and reduce the false positive rate of the object in death state.
[0033] Figure 1 is a schematic flow chart of a target detection method according to an embodiment of the present application, as shown in Figure 1 The method comprises the following steps.
[0034] S102, acquire first panoramic images of a plurality of target candidate objects at N different time instants and region information of the target candidate objects in the first panoramic images.
[0035] Optionally, the first panoramic images of the plurality of target candidate objects at the N different time instants can be acquired by shooting. N is an integer greater than or equal to 2. Optionally, the target candidate objects can be biological objects, such as chickens, ducks, geese, and the like.
[0036] Optionally, the N different time instants can be N arbitrary different time instants, or there is a certain rule between the N different time instants. For example, the certain rule between the N different time instants is to meet a preset time interval requirement. For example, the preset time interval is 2 hours, the first first panoramic image is obtained by shooting at 6 am, then if N is 3, the second first panoramic image will be obtained by shooting at 8 am, and the third first panoramic image will be obtained by shooting at 10 am. For another example, the preset time interval is 1 hour, the first first panoramic image is obtained by shooting at 7 am, then if N is 4, the second first panoramic image will be obtained by shooting at 8 am, the third first panoramic image will be obtained by shooting at 9 am, and the fourth first panoramic image will be obtained by shooting at 10 am.
[0037] Optionally, the region information of the target candidate objects in the first panoramic images can be the bounding box information corresponding to the target candidate objects. The bounding box information corresponding to the target candidate objects can be determined by the key point coordinates on the rectangular frame surrounding the target candidate objects. Optionally, the key point coordinates can be the diagonal coordinates of the rectangular frame. For example, the key point coordinates are the x-axis and y-axis coordinates of the upper left corner of the rectangular frame and the x-axis and y-axis coordinates of the lower right corner. For another example, the key point coordinates are the x-axis and y-axis coordinates of the lower left corner of the rectangular frame and the x-axis and y-axis coordinates of the upper right corner.
[0038] Optionally, the representation form of the bounding box information corresponding to a single target candidate object can be wherein, and is a set of x-axis and y-axis coordinates, and is another set of x-axis and y-axis coordinates.
[0039] S104, determine the region coincidence degree of each target candidate object at the N different time instants according to the region information, and determine at least one first target object according to the region coincidence degree.
[0040] wherein, the first target object is a target candidate object whose region coincidence degree is greater than or equal to a first preset coincidence degree threshold.
[0041] Optionally, the region coincidence degree of the target candidate object at the two adjacent time points can be determined according to region information of the target candidate object in a first panoramic image corresponding to the two adjacent time points (for example, a first time point and a second time point, where the second time point is later than the first time point), and at least one first target candidate object can be determined according to the region coincidence degree. If the second time point is the latest time point in the N time points, the first target candidate object is determined as the first target object. If the second time point is not the latest time point in the N time points, the region coincidence degree of the first target candidate object at the second time point and the next time point adjacent to the second time point is continuously calculated, and at least one second target candidate object is determined according to the region coincidence degree, until the region coincidence degree of the target candidate object filtered layer by layer at the latest time point and the previous time point adjacent to the latest time point is calculated, and the finally determined target candidate object is determined as the first target object.
[0042] Optionally, the region coincidence degree can be calculated by calculating the intersection-over-union. For example, for each target candidate object, the region information of the target candidate object in a first panoramic image corresponding to a first time point and the region information of the target candidate object in a first panoramic image corresponding to a second time point are subjected to intersection-over-union calculation to obtain an intersection-over-union result, and the obtained intersection-over-union result is taken as the region coincidence degree of the target candidate object. The first preset coincidence degree threshold value can be, for example, 0.7, 0.8, 0.9, etc., which is not limited herein.
[0043] S106, according to the region information, obtaining the region image and the contour image of each first target object in the two first panoramic images with the latest time point in the N first panoramic images.
[0044] The two first panoramic images with the latest time point in the N first panoramic images are two first panoramic images with the latest image shooting time in the N first panoramic images. The two first panoramic images with the latest time point can be obtained at the latest time point in the N time points and the previous time point adjacent to the latest time point.
[0045] The region image and the contour image each contain only a single first target object. Optionally, for each first target object, the region image corresponding to the first target object in the two first panoramic images with the latest time point can be obtained according to the region information of the first target object in the two first panoramic images with the latest time point.
[0046] S108, according to the contour image corresponding to each first target object, determining the contour coincidence degree of each first target object in the two first panoramic images with the latest time point, and determining the second target object according to the contour coincidence degree.
[0047] The second target object is a first target object with a profile coincidence degree greater than or equal to a second preset coincidence degree threshold. Optionally, the profile coincidence degree can be calculated by calculating the intersection over union. For example, the intersection over union between the profile images of the same first target object in the two first panoramic images with the latest time can be calculated to obtain an intersection over union result, and the obtained intersection over union result is taken as the profile coincidence degree of the first target object.
[0048] Optionally, in the case of a profile image being a binary image (i.e., a black and white image, wherein the profile image corresponding to the first target object is black), the intersection over union between the profile images of the same first target object in the two first panoramic images with the latest time is calculated, that is, the intersection over union between the pixel values of the same first target object in the two first panoramic images with the latest time is calculated.
[0049] Optionally, if the intersection over union is used to calculate the profile coincidence degree, when the intersection over union is 1, it means that the profile images of the first target object in the two first panoramic images with the latest time are completely coincident, that is, the posture of the first target object in the two first panoramic images with the latest time has not changed at all. The smaller the intersection over union is, the less the profile images of the first target object in the two first panoramic images with the latest time coincide, that is, the greater the degree of change in the posture of the first target object in the two first panoramic images with the latest time. Since the object in the survival state does not remain stationary, the greater the degree of change in the posture of the single object in the survival state in different panoramic images, the second preset coincidence degree threshold can be close to 1, such as 0.89, 0.9, 0.91, 0.95, and the like, which is not limited in the embodiment of the present application.
[0050] S110, inputting the region image corresponding to the second target object into the pre-trained target state detection model to output the probability of the second target object being in a death state and / or a survival state.
[0051] Optionally, if the two first panoramic images with the latest time in the N first panoramic images are denoted as panoramic image Z1 and panoramic image Z2, wherein the shooting time of panoramic image Z1 is earlier than that of panoramic image Z2, the region image corresponding to the second target object obtained based on panoramic image Z2 can be input into the pre-trained target state detection model. Alternatively, the region image corresponding to the second target object obtained based on panoramic image Z1 can be input into the pre-trained target state detection model.
[0052] The technical scheme of the embodiment of the present application can be used to detect the survival state of multiple target candidate objects in a cluster. The first panoramic image of each target candidate object at N different time points and the region information in the first panoramic image are obtained. According to the region information, the region coincidence degree of each target candidate object at N different time points is determined. Since the object in the survival state does not remain stationary, the region coincidence degree of a single object in the survival state in different panoramic images is relatively small, or even completely coincides. Therefore, by determining the target candidate object with a region coincidence degree greater than or equal to a first preset coincidence degree threshold as a first target object, the object suspected to be in a death state (i.e., the first target object) can be efficiently and accurately preliminarily screened from N first panoramic images. Moreover, since the panoramic image can cover all target candidate objects in the current scene, the comprehensiveness of the screening result (i.e., the object suspected to be in a death state) can be ensured by screening all target candidate objects. Further, since the first target object is only a preliminarily screened object suspected to be in a death state, further screening of the first target object is required to further improve the detection accuracy of the object in a death state and reduce the false positive rate of the object in a death state. According to the region information, the region image and the contour image of each first target object in the two first panoramic images with the latest time point in N first panoramic images are obtained, so as to determine the contour coincidence degree of each first target object in the two first panoramic images with the latest time point according to the contour image corresponding to each first target object, and determine the second target object by determining the first target object with a contour coincidence degree greater than or equal to a second preset coincidence degree threshold. Since the contour coincidence degree is calculated only for the preliminarily screened first target object, but not for all target candidate objects, the amount of calculation is reduced, thereby improving the determination efficiency of the second target object. In addition, since the object in the survival state may not change its position but change its posture (i.e., only the contour changes) within a period of time, that is, the object in the survival state may have the following situation: the region coincidence degree in different panoramic images is relatively high, but the contour coincidence degree is relatively small. Therefore, by determining the contour coincidence degree of the object suspected to be in a death state (i.e., the first target object) in multiple panoramic images, the second target object with a higher possibility of being in a death state can be screened from the first target object, thereby further improving the accuracy of the screened object in a death state. Furthermore, the region image corresponding to the second target object is input into a pre-trained target state detection model, and the probability of the second target object being in a death state and / or a survival state is output.It can be seen that in the process of detecting the survival state of a single object in the cluster, the area coincidence degree of the single object in the multiple panoramic images is used to preliminarily screen the first target object suspected to be in a death state from the multiple objects, so as to further screen the second target object with a higher possibility of being in a death state from the first target objects according to the contour coincidence degree of each first target object in the multiple panoramic images, and finally determine the state of the second target object by using the target state detection model. The position and posture of a single object at multiple times are comprehensively considered, instead of only relying on the recognition result output by the image recognition model. After multiple layers of screening under various restriction conditions, the object in a death state determined is more comprehensive and accurate, and the false positive rate of the object in a death state is reduced.
[0053] In one embodiment, the first panoramic images of the multiple target candidate objects at N different time points and the area information of the target candidate objects in the first panoramic images (i.e., S102) can be implemented as steps A1-A2 as follows:
[0054] Step A1: photographing the multiple target candidate objects at N different time points to obtain the first panoramic images of the multiple target candidate objects at N different time points, each of which includes the multiple target candidate objects.
[0055] Optionally, the N different time points can be N arbitrary different time points, or the N different time points satisfy a preset time interval requirement.
[0056] Optionally, the first panoramic images of the multiple target candidate objects at N different time points can be obtained by photographing the multiple target candidate objects at N different time points by using a camera. For example, if the target candidate objects correspond to a chicken cluster, a camera can be installed at a certain position of a chicken farm, and the installation position of the camera can ensure that the camera can photograph the panoramic image of the chicken farm. A timer can be arranged in the camera, and the timer triggers the camera to photograph the panoramic image of the chicken farm every preset time interval.
[0057] Step A2: inputting each first panoramic image into a pre-trained target area detection model to output the area information of the multiple target candidate objects in each first panoramic image.
[0058] The target area detection model is used to detect and label the area information corresponding to each target candidate object in the first panoramic image. The target area detection model can be trained based on a sample panoramic image and the area information actually corresponding to each sample object in the sample panoramic image. The specific training method will be described in the following embodiments.
[0059] In this embodiment, the first panoramic image of the target candidate object at N different time points is photographed, and the region information of each target candidate object in each first panoramic image is determined by the pre-trained target region detection model. Since the model processes the image, the speed and accuracy are superior to manual annotation and other methods, and therefore the region information corresponding to the target candidate object can be quickly and accurately determined, so that the region information of each target candidate object in each first panoramic image with high accuracy can be quickly obtained.
[0060] In one embodiment, the target region detection model can be trained according to steps B1-B2 as follows. Figure 2 As shown in the figure, the specific training process of the target region detection model is shown, which includes:
[0061] Step B1, obtain a plurality of first sample panoramic images and a plurality of second sample panoramic images corresponding to the first sample panoramic images respectively.
[0062] Each of the first sample panoramic images includes a plurality of first sample objects, and each of the second sample panoramic images includes target region information corresponding to the plurality of first sample objects. Optionally, the target region information included in the second sample panoramic image is the actual region information corresponding to each first sample object.
[0063] Step B2, input the first sample panoramic image and the second sample panoramic image into the target region detection model to be trained for iterative training, to obtain the trained target region detection model.
[0064] In one embodiment, the target region detection model includes a region detection layer, a first matching layer and a first full connection layer, and step B2 can be executed as steps B21-B23 as follows.
[0065] Step B21, for each first sample panoramic image, the region detection layer is used to detect the region where each first sample object in the first sample panoramic image is located, to obtain the reference region information corresponding to the first sample panoramic image.
[0066] Since each of the first sample panoramic images includes a plurality of first sample objects, the reference region information corresponding to the first sample panoramic image includes a plurality of reference region information, each first sample object corresponding to one reference region information.
[0067] Step B22, the first matching layer is used to calculate the first matching degree between the reference region information and the target region information in the second sample panoramic image.
[0068] Optionally, when calculating the first matching degree, the matching degrees between the corresponding (i.e. the same sample object) reference region information and target region information can be calculated respectively to obtain multiple matching degrees, and then the average of the multiple matching degrees is taken as the first matching degree. Alternatively, all the reference region information can be directly matched with the target region information in the second sample panoramic image as a whole to obtain a total matching degree as the first matching degree.
[0069] Optionally, the first matching degree can be calculated by calculating the intersection over union. Illustratively, the intersection over union between the corresponding (i.e. the same sample object) reference region information and target region information can be calculated to obtain multiple intersection over union results, and then the average of the multiple intersection over union results is taken as the first matching degree. Alternatively, all the reference region information can be matched with all the target region information once to obtain an intersection over union result, and the obtained intersection over union result is taken as the first matching degree.
[0070] In step B23, if the first matching degree is less than the first preset matching threshold, the model parameters of the target region detection model to be trained are adjusted, and the next round of iteration training is performed; if the first matching degree is greater than or equal to the first preset matching threshold, the iteration is stopped, and the trained target region detection model is obtained.
[0071] Optionally, if the first matching degree is calculated by calculating the intersection over union, the intersection over union is 1, which means that the reference region information and the target region information of the sample object are completely the same. The smaller the intersection over union is, the more different the reference region information and the target region information of the sample object are, that is, the lower the accuracy of the target region detection model is. In the embodiment, to train the target region detection model which can accurately determine the region information corresponding to each object from the panoramic image, the first preset matching threshold can be a value close to 1 such as 0.9. As the accuracy requirement decreases, the first preset matching threshold can also be 0.8, 0.7, 0.6, etc. according to the specific application scenario, and the embodiment of the present application does not limit this.
[0072] In the embodiment, by training the target region detection model, a model basis is provided for quickly and accurately determining the region information corresponding to each object from the panoramic image.
[0073] In one embodiment, according to the region information, the region coincidence degrees of each target candidate object at N different time points are determined, and at least one first target object (i.e. S104) is determined according to the region coincidence degrees, which can be executed as steps C1-C3:
[0074] Step C1, determining a first area coincidence degree of the target candidate object at the first time and the second time according to the area information of the target candidate object in the first panoramic image corresponding to the first time and the second time respectively, and determining at least one first target candidate object according to the first area coincidence degree.
[0075] The first time and the second time are two adjacent times in the N times, and the second time is later than the first time. The first target candidate object is a target candidate object whose first area coincidence degree is greater than or equal to a first preset coincidence degree threshold.
[0076] Optionally, according to the order of the time from the earliest time, the first time is the first time in the N times, and the second time is the second time in the N times. For example, if N is 3, the first panoramic image is taken at 6 o'clock in the morning, the second panoramic image is taken at 8 o'clock in the morning, and the third panoramic image is taken at 10 o'clock in the morning. Then, according to the order of the time from the earliest time, the first time is 6 o'clock in the morning, and the second time is 8 o'clock in the morning.
[0077] Optionally, the first area coincidence degree can be calculated by calculating the intersection over union. For example, the intersection over union of the area information of the target candidate object in the first panoramic image corresponding to the first time and the area information of the target candidate object in the first panoramic image corresponding to the second time can be calculated to obtain an intersection over union result, and the obtained intersection over union result is taken as the first area coincidence degree of the target candidate object.
[0078] Optionally, if the first area coincidence degree is calculated by calculating the intersection over union, the intersection over union is 1, which means that the area information corresponding to the two adjacent times is completely the same, that is, the position of the target candidate object in the panoramic image of the two adjacent times does not change. The smaller the intersection over union is, the more different the area information corresponding to the two adjacent times is, that is, the greater the change of the position of the target candidate object in the panoramic image of the two adjacent times is. Since the object in the survival state does not remain stationary, the greater the change of the position of the single object in the survival state in the different panoramic images is. In this embodiment, in order to select the object suspected to be in the death state from the N first panoramic images, the first preset coincidence degree threshold can be a value close to 1, such as 0.89, 0.9, 0.91, 0.95, and the like, which is not limited in the embodiment of the present application.
[0079] Step C2, determining a second area coincidence degree of the first target candidate object at the second time and the third time according to the area information of the first target candidate object in the first panoramic image corresponding to the second time and the third time respectively, and determining at least one second target candidate object according to the second area coincidence degree.
[0080] The third time is the next time adjacent to the second time in the N different times, and the second target candidate object is the first target candidate object whose second region coincidence degree is greater than or equal to the first preset coincidence degree threshold.
[0081] Optionally, the second region coincidence degree is calculated in a manner similar to the first region coincidence degree in step C1, which will not be described herein again.
[0082] Step C3, if the third time is not the latest time in the N different times, the region coincidence degrees of the second target candidate object at the third time and the next time are calculated. If the third time is the latest time in the N different times, the second target candidate object is determined as the first target object.
[0083] The region coincidence degrees of the second target candidate object at the third time and the next time are calculated in a manner similar to the first region coincidence degree in step C1, which will not be described herein again. At least one third target candidate object is determined according to the region coincidence degrees by calculating the region coincidence degrees of the second target candidate object at the third time and the next time (i.e., the fourth time adjacent to the third time and later than the third time). If the fourth time is the latest time in the N different times, the third target candidate object is determined as the first target object. If the fourth time is not the latest time in the N different times, the region coincidence degrees of the third target candidate object at the fourth time and the next time are calculated, until the region coincidence degrees of the target candidate object filtered layer by layer at the latest time in the N different times and the time adjacent to the latest time and earlier than the latest time are calculated, and the finally determined target candidate object is determined as the first target object.
[0084] In this embodiment, the first target candidate object whose region coincidence degree meets the preset coincidence degree requirement (i.e., greater than or equal to the first preset coincidence degree threshold) is filtered out by calculating the region coincidence degrees of the target candidate object at the first two times in the N times, so that the second target candidate object whose region coincidence degree meets the preset coincidence degree requirement is further filtered out according to the region coincidence degrees of the first target candidate object at the second time and the next time adjacent to the second time, until the filtering is stopped when there is no next time in the N times, and the first target object is obtained. Since the object in the death state should meet the preset coincidence degree requirement at each time, the first target object in the suspected death state can be accurately filtered out by filtering the target candidate object whose region coincidence degree meets the preset coincidence degree requirement layer by layer in the N times.
[0085] In one embodiment, according to the region information, the region image and the contour image of each first target object in the two first panoramic images with the latest time are obtained (i.e., S106), which can be implemented as steps D1-D2:
[0086] Step D1, for each first target object, according to the region information of the first target object in the two first panoramic images with the latest time, the region image of the first target object in the two first panoramic images with the latest time is obtained.
[0087] Optionally, for each first target object, the region image corresponding to the first target object in the two first panoramic images with the latest time can be respectively obtained according to the region information of the first target object in the two first panoramic images with the latest time. Wherein, each first target object corresponds to two region images, which are respectively: the region image cut from one of the first panoramic images taken at the latest time among the N different times, and the region image cut from one of the first panoramic images taken at the time adjacent to the latest time. For example, if the two first panoramic images with the latest time are denoted as panoramic image Z1 and panoramic image Z2, wherein the shooting time of panoramic image Z1 is earlier than that of panoramic image Z2, then the two region images corresponding to each first target object are respectively: the region image cut from panoramic image Z1 and the region image cut from panoramic image Z2.
[0088] Step D2, image segmentation processing is performed on each region image to obtain the contour image of the first target object in the two first panoramic images with the latest time.
[0089] In one embodiment, the region image can include the contour image and the region background image. Step D2 can be implemented as: inputting each region image into a pre-trained image segmentation model, segmenting the contour image and the region background image in each region image, and outputting the contour image corresponding to each region image.
[0090] Wherein, the image segmentation model is used for segmenting the contour image and the region background image in the region image. The image segmentation model can be trained based on sample region images and the contour images actually corresponding to the sample objects in the sample region images, and the specific training method will be described in the following embodiments.
[0091] Optionally, the contour image can be a binary image (i.e., a black and white image, wherein the contour image corresponding to the first target object is black). In this embodiment, the contour image is obtained by segmenting the region image through the pre-trained image segmentation model. Since the image is processed through the model, the speed and accuracy are superior to manual labeling and other methods, and therefore it is beneficial to quickly and accurately obtain the contour image corresponding to each region image.
[0092] In one embodiment, the image segmentation model can be trained according to steps E1-E2 as follows: Figure 3 As shown, a specific training process of the image segmentation model is shown, including:
[0093] Step E1, obtaining a plurality of first sample region images, and a sample contour image corresponding to each first sample region image.
[0094] Each sample region image includes a second sample object. The sample contour image is the actual contour image corresponding to the second sample object.
[0095] Step E2, inputting the first sample region image and the sample contour image into the image segmentation model to be trained for iterative training, to obtain the trained image segmentation model.
[0096] In one embodiment, the image segmentation model includes a contour detection layer, a second matching layer, and a second fully connected layer, and step E2 can be executed as steps E21-E23 as follows:
[0097] Step E21, for each first sample region image, the contour detection layer is used to detect the contour of the second sample object in the first sample region image to obtain a reference contour image corresponding to the second sample object.
[0098] Step E22, the second matching layer is used to calculate the second matching degree between the reference contour image and the sample contour image.
[0099] Optionally, when calculating the second matching degree, the matching degree between the corresponding (i.e. the same sample object) reference contour image and sample contour image can be calculated respectively to obtain a plurality of matching degrees, and then the mean value of the plurality of matching degrees is taken as the second matching degree. Alternatively, all reference contour images can be directly taken as a whole to match with the sample contour image as a whole to obtain a total matching degree as the second matching degree.
[0100] Optionally, the second matching degree can be calculated by calculating the intersection over union. Illustratively, the intersection over union between the corresponding (i.e. the same sample object) reference contour image and sample contour image can be calculated to obtain a plurality of intersection over union results, and then the mean value of the plurality of intersection over union results is taken as the second matching degree. Alternatively, all reference contour images can be calculated once with all sample contour images to obtain an intersection over union result, and the obtained intersection over union result is taken as the second matching degree. Optionally, in the case of a binary contour image, the intersection over union between the corresponding (i.e. the same sample object) reference contour image and sample contour image is calculated, i.e. the intersection over union between the pixel values of the corresponding reference contour image and sample contour image is calculated.
[0101] In step E23, the second fully connected layer is used to adjust the model parameters of the image segmentation model to be trained and perform the next round of iterative training if the second matching degree is less than the second preset matching threshold; if the second matching degree is greater than or equal to the second preset matching threshold, the iteration is stopped and the trained image segmentation model is obtained.
[0102] Optionally, if the second matching degree is calculated using the intersection-union ratio (IU / R), then an IU / R of 1 indicates that the reference contour image and the sample contour image corresponding to the sample region image completely overlap. A smaller IU / R indicates less overlap between the reference contour image and the sample contour image, meaning lower accuracy of the image segmentation model. In this embodiment, to train an image segmentation model capable of accurately determining the contour images corresponding to each object from the region image, the second preset matching threshold can be a value close to 1, such as 0.9. As accuracy requirements decrease, depending on the specific application scenario, the second preset matching threshold can also be values such as 0.8, 0.7, and 0.6; this embodiment does not limit this.
[0103] In this embodiment, by training an image segmentation model, a model foundation is provided for quickly and accurately determining the contour images corresponding to each object from a region image.
[0104] In one embodiment, the target state detection model can be trained according to the following steps F1-F2, as follows: Figure 4 The diagram illustrates the specific training process of the target state detection model, including:
[0105] Step F1: Acquire multiple second sample region images carrying label information. Each second sample region image includes a third sample object, and the label information includes the probability that the third sample object is in a dead state and / or a alive state.
[0106] Step F2: Input the image of the second sample region into the target state detection model to be trained for iterative training to obtain the trained target state detection model.
[0107] In one embodiment, the target state detection model includes a classification layer, a difference calculation layer, and a third fully connected layer. Step F2 can be executed as follows: steps F21-F23:
[0108] Step F21: For each second sample region image, the classification layer is used to determine the reference probability that the third sample object in the second sample region image is in a dead state and / or a alive state.
[0109] Step F22: The difference calculation layer is used to calculate the probability difference between the reference probability and the probability in the label information corresponding to the second sample region image.
[0110] The greater the probability difference is, the lower the accuracy of the target state detection model is; the smaller the probability difference is, the higher the accuracy of the target state detection model is. In this embodiment, to train the target state detection model that can more accurately determine the probability that the current object is in the death state and / or the survival state from the region image, the third preset matching threshold can be a value close to 0, such as 0.1, 0.11, and the like. With the decrease of the accuracy requirement, the third preset matching threshold can also be a value such as 0.2, 0.3, 0.4, according to the specific application scenario, and the present embodiment does not limit this.
[0111] In step F23, if the probability difference is greater than the third preset matching threshold, the model parameters of the target state detection model to be trained are adjusted, and the next round of iterative training is performed; if the probability difference is less than or equal to the third preset matching threshold, the iteration is stopped, and the trained target state detection model is obtained.
[0112] In this embodiment, by training the target state detection model, a model basis is provided for quickly and accurately outputting the probability that the object is in the death state and / or the survival state.
[0113] In one embodiment, if the probability that the second target object is in the death state is greater than or equal to the preset probability threshold, an early warning information is output. The early warning information includes at least one of the following: the probability that the second target object is in the death state, and the region information corresponding to the second target object. The specific content of the region information can refer to the related description in S102, which will not be described here.
[0114] The output of the early warning information can be in various ways. In the case that the region images corresponding to a plurality of second target objects are simultaneously input into the target state detection model, and the target state detection model simultaneously outputs the probability that each second target object is in the death state and / or the survival state, if there are a plurality of second target objects whose probability of being in the death state is greater than or equal to the preset probability threshold, the early warning information corresponding to the plurality of second target objects can be output at one time, such as displaying the early warning information corresponding to the plurality of second target objects in the same display interface, and the early warning information includes the probability that each second target object in the death state is greater than or equal to the preset probability threshold, the region information corresponding to each second target object in the death state is greater than or equal to the preset probability threshold, and the like. Alternatively, the early warning information of each second target object in the death state whose probability is greater than or equal to the preset probability threshold is output respectively, and each early warning information includes the probability that the second target object in the death state is greater than or equal to the preset probability threshold, and the region information corresponding to the second target object in the death state is greater than or equal to the preset probability threshold.
[0115] For example, in a case where the region images corresponding to the plurality of second target objects are sequentially input into the target state detection model, and the target state detection model sequentially outputs the probability of each second target object being in the death state and / or the survival state, the warning information of each second target object whose probability of being in the death state is greater than or equal to the preset probability threshold can be output, and each warning information includes the probability of the second target object currently being in the death state, the region information corresponding to the second target object currently being in the death state, and the like. Since the second target object is the first target object with the contour coincidence degree greater than or equal to the second preset coincidence degree threshold, and the calculation efficiency of each first target object is different when calculating the contour coincidence degree of the first target object, the determination timing of the second target object is different, the region image corresponding to each second target object can be sequentially input into the target state detection model according to the determination order of the plurality of second target objects, so that the target state detection model can sequentially output the probability of each second target object being in the death state and / or the survival state according to the region image corresponding to each second target object.
[0116] The target detection method provided in the embodiments of the present application is described below in detail in combination with a specific application scenario.
[0117] With the development of science and technology, the development of rural areas through scientific and technological means is one of the main means of rural revitalization. In view of the problem that dead poultry (such as dead chickens, dead ducks, etc.) in large-scale breeding farms are difficult to be discovered in time, there are currently two solutions as follows: one is to shoot poultry images through a camera device, input the poultry images into an image recognition model for recognition, so as to timely recognize the dead poultry, but when the number of poultry is too large, the workload of image recognition is large, and the recognition result of the image recognition model is used alone to determine the dead poultry, which is prone to inaccurate recognition and low recognition efficiency. The other solution needs to shoot poultry images through an infrared camera, and determine which are dead poultry according to the body temperature information on the poultry images. Since the focal length of the infrared camera is generally too long, it cannot achieve a wide-angle effect, and therefore cannot cover the breeding farm, so it is difficult to comprehensively recognize the dead poultry in the breeding farm. Based on this, the target detection method is applied to the dead poultry detection scene in the embodiments, which can balance the detection accuracy and comprehensiveness of the poultry in the death state, and reduce the false positive rate of the poultry in the death state.
[0118] The target detection method is applied to the dead chicken positioning scene as an example for detailed description. In the embodiments, the plurality of target candidate objects are a plurality of chickens, the first target object is a first target suspected dead chicken, the second target object is a second target suspected dead chicken, and N is 3.
[0119] Figure 5 is a schematic diagram of an implementation principle of a target detection method according to an embodiment of the present application. In the embodiment, it is assumed that there are M chickens in the chicken farm, and the survival state of the M chickens is detected through panoramic images at three different time points, that is, N = 3. In the implementation principle shown in the figure: Figure 5
[0120] First, panoramic images of the M chickens at three different time points are obtained by panoramic shooting, and each first panoramic image is input into a pre-trained target region detection model to obtain the region information of the M chickens in each first panoramic image.
[0121] Each first panoramic image includes M chickens. M is an integer greater than 0. Optionally, the region information of the chicken in the first panoramic image can be the bounding box information corresponding to the chicken. The bounding box information corresponding to the chicken can be determined by the key point coordinates on the rectangular frame surrounding the chicken. Optionally, the key point coordinates can be the diagonal coordinates of the rectangular frame. For example, the key point coordinates are the x-axis and y-axis coordinates of the upper left corner of the rectangular frame, and the x-axis and y-axis coordinates of the lower right corner. For another example, the key point coordinates are the x-axis and y-axis coordinates of the lower left corner of the rectangular frame, and the x-axis and y-axis coordinates of the upper right corner.
[0122] In the embodiment, the three different time points are represented by t1, t2, and t3 in chronological order. That is, the time point t1 is earlier than the time point t2, and the time point t2 is earlier than the time point t3.
[0123] Secondly, according to the region information of each chicken in the first panoramic image corresponding to the time point t1 and the time point t2, the first region coincidence degree of each chicken at the time point t1 and the time point t2 is determined, and at least one first target candidate suspected dead chicken is determined according to the first region coincidence degree.
[0124] The first target candidate suspected dead chicken is a chicken with a first region coincidence degree greater than or equal to a first preset coincidence degree threshold. Optionally, the calculation method of the first region coincidence degree is similar to that in step C1, and will not be described here.
[0125] Then, according to the region information of the first target candidate suspected dead chicken in the first panoramic image corresponding to the time point t2 and the time point t3, the second region coincidence degree of the first target candidate suspected dead chicken at the time point t2 and the time point t3 is determined, and at least one second target candidate suspected dead chicken is determined according to the second region coincidence degree.
[0126] The second target candidate suspected dead chicken is the first target suspected dead chicken. In addition, if N is not 3, that is, the time t3 is not the latest time, then the area coincidence degree of the second target candidate suspected dead chicken at the time t3 and the next time is continuously calculated, until the area coincidence degree of the target candidate suspected dead chicken finally determined at the latest time and the time adjacent to the latest time and earlier than the latest time in the N different times is calculated, and the target candidate suspected dead chicken finally determined is taken as the first target suspected dead chicken.
[0127] Again, for each first target suspected dead chicken, the area image of the first target suspected dead chicken in the first panoramic image at the time t2 and the time t3 is obtained according to the area information of the first target suspected dead chicken in the first panoramic image at the time t2 and the time t3, and each area image is input into the pre-trained image segmentation model, the contour image and the area background image in each area image are segmented, and the contour image corresponding to each area image is output.
[0128] Each first target suspected dead chicken corresponds to two contour images, which are the contour image obtained by segmenting the area image of the first target suspected dead chicken at the time t2 and the contour image obtained by segmenting the area image of the first target suspected dead chicken at the time t3.
[0129] Again, the contour coincidence degree of each first target suspected dead chicken at the time t2 and the time t3 is determined according to the contour image corresponding to each first target suspected dead chicken, and the first target suspected dead chicken is screened according to the contour coincidence degree, to obtain a second target suspected dead chicken.
[0130] The second target suspected dead chicken is the first target suspected dead chicken with a contour coincidence degree greater than or equal to a second preset coincidence degree threshold. The calculation method of the contour coincidence degree is similar to that in S108, which will not be described here.
[0131] Finally, the area image corresponding to the second target suspected dead chicken is input into the pre-trained target state detection model, and the probability that the second target suspected dead chicken is in a dead state and / or a survival state is output.
[0132] Optionally, the area image of the second target suspected dead chicken at the time t2 can be input into the pre-trained target state detection model, or the area image of the second target suspected dead chicken at the time t3 can be input into the pre-trained target state detection model.
[0133] In addition, if the probability of the second target suspected dead chicken being in a dead state is greater than or equal to a preset probability threshold, an early warning information is output. The early warning information can include the probability of the second target suspected dead chicken being in a dead state, the area information corresponding to the second target suspected dead chicken, and the like.
[0134] The technical scheme of the embodiment of the present application can be used to detect the survival state of multiple chickens in a chicken farm. The first panoramic images of M chickens at three different time points and the region information in the first panoramic images are obtained. The region coincidence degree of each chicken at the three different time points is determined according to the region information. Since the chickens in the survival state will not be stationary, the region coincidence degree of a single chicken in the survival state in different panoramic images will be relatively small, or even completely non-coincident. Therefore, by determining the chicken with a region coincidence degree greater than or equal to a first preset coincidence threshold as a first target suspected dead chicken, the chicken suspected to be in a death state can be efficiently and accurately preliminarily screened from the three first panoramic images. Moreover, since the panoramic image can cover all the chickens in the current scene, the screening result (i.e., the first target suspected dead chicken) can be ensured to be comprehensive by screening in all the chickens. Further, since only the chicken suspected to be in a death state is preliminarily screened, in order to further improve the detection accuracy of the chicken in a death state and reduce the false positive rate of the chicken in a death state, the first target suspected dead chicken needs to be further screened. According to the region information, the region image and the contour image of each first target suspected dead chicken in the two first panoramic images with the latest time point are obtained, so as to determine the contour coincidence degree of each first target suspected dead chicken in the two first panoramic images with the latest time point according to the contour image corresponding to each first target suspected dead chicken, and determine the first target suspected dead chicken with a contour coincidence degree greater than or equal to a second preset coincidence threshold as a second target suspected dead chicken. Since only the contour coincidence degree of the first target suspected dead chicken is calculated, rather than the contour coincidence degree of all the chickens, the amount of calculation is reduced, thereby improving the determination efficiency of the second target suspected dead chicken. In addition, since the chicken in the survival state may not change its position but change its posture (i.e., only the contour changes) within a period of time, that is, a single chicken in the survival state may have the following situation: the region coincidence degree in different panoramic images is relatively high, but the contour coincidence degree is relatively small. Therefore, by determining the contour coincidence degree of the first target suspected dead chicken in multiple panoramic images, the first target suspected dead chicken is further screened, which can further improve the accuracy of the chicken screened in a death state. Further, the region image corresponding to the second target suspected dead chicken is input into a pre-trained target state detection model, and the probability of the second target suspected dead chicken being in a death state and / or a survival state is output.It can be seen that in the process of detecting the survival state of the single chicken in the chicken farm, the first target suspected dead chicken is preliminarily screened out from the plurality of chickens through the area coincidence degree of the single chicken in the plurality of panoramic images, so as to further screen the first target suspected dead chicken according to the contour coincidence degree of each first target suspected dead chicken in the plurality of panoramic images, and finally determine the state of the second target suspected dead chicken by using the target state detection model, which comprehensively considers the position and posture of the single chicken at a plurality of times, and not only depends on the recognition result output by the image recognition model, and after layer-by-layer screening of a plurality of limiting conditions, the chicken in the death state determined is more comprehensive and accurate, and the false positive rate of the chicken in the death state is reduced.
[0135] In summary, particular embodiments of the present subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions noted in the claims can be performed in a different order and still achieve desirable results. Additionally, the processes depicted in the attached figures can not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.
[0136] The target detection method provided in the above embodiment of the application is based on the same idea, and the application also provides a target detection device.
[0137] Figure 6 Fig. 1 is a structural schematic diagram of a target detection device according to an embodiment of the application. Referring to Fig. 1, Figure 6 The target detection device can include:
[0138] The first acquisition module 610 is configured to acquire a first panoramic image of a plurality of target candidate objects at N different time instants and region information in the first panoramic image, where N is an integer greater than or equal to 2.
[0139] The first determination module 620 is configured to determine, according to the region information, a region coincidence degree of each target candidate object at the N different time instants, and determine at least one first target object according to the region coincidence degree, where the first target object is a target candidate object with a region coincidence degree greater than or equal to a first preset coincidence degree threshold.
[0140] The second acquisition module 630 is configured to acquire, according to the region information, a region image and a contour image of each first target object in two first panoramic images with the latest time instant among the N first panoramic images.
[0141] The second determination module 640 is configured to determine, according to the contour image corresponding to each first target object, the contour coincidence degree of each first target object in the two first panoramic images at the latest time, and determine the second target object according to the contour coincidence degree; the second target object is the first target object whose contour coincidence degree is greater than or equal to a second preset coincidence degree threshold.
[0142] The target state detection module 650 is configured to input the region image corresponding to the second target object into a pre-trained target state detection model, and output the probability that the second target object is in a death state and / or a survival state.
[0143] In an embodiment, the first acquisition module 610 includes:
[0144] The photographing unit is configured to photograph the plurality of target candidate objects at N different times to obtain first panoramic images of the plurality of target candidate objects at the N different times, each of the first panoramic images including the plurality of target candidate objects.
[0145] The target region detection unit is configured to input each of the first panoramic images into a pre-trained target region detection model to output region information of the plurality of target candidate objects in each of the first panoramic images.
[0146] In an embodiment, the training process of the target region detection model includes:
[0147] The plurality of first sample panoramic images and the second sample panoramic images corresponding to the first sample panoramic images respectively are acquired; each of the first sample panoramic images includes a plurality of first sample objects, and each of the second sample panoramic images includes target region information corresponding to the plurality of first sample objects.
[0148] The first sample panoramic images and the second sample panoramic images are input into the target region detection model to be trained for iterative training, to obtain the trained target region detection model.
[0149] In an embodiment, the target region detection model includes a region detection layer, a first matching layer, and a first full connection layer.
[0150] The first sample panoramic images and the second sample panoramic images are input into the target region detection model to be trained for iterative training, to obtain the trained target region detection model, including:
[0151] For each of the first sample panoramic images, the region detection layer is configured to detect a region where each of the first sample objects in the first sample panoramic image is located, to obtain reference region information corresponding to the first sample panoramic image.
[0152] The first matching layer is configured to calculate a first matching degree between the reference region information and the target region information in the second panoramic image.
[0153] The first full connection layer is configured to, if the first matching degree is less than a first preset matching threshold, adjust model parameters of the target region detection model to be trained, and perform an iteration training in a next round; if the first matching degree is greater than or equal to the first preset matching threshold, stop the iteration, and obtain the trained target region detection model.
[0154] In an embodiment, the first determination module 620 includes:
[0155] The first determination unit is configured to determine a first region coincidence degree of the target candidate object at the first time and the second time according to region information of the target candidate object in the first panoramic image corresponding to the first time and the second time respectively, and determine at least one first target candidate object according to the first region coincidence degree; wherein the first time and the second time are two adjacent times in the N different times, the second time is later than the first time, and the first target candidate object is a target candidate object whose first region coincidence degree is greater than or equal to a first preset coincidence degree threshold.
[0156] The second determination unit is configured to determine a second region coincidence degree of the first target candidate object at the second time and the third time according to region information of the first target candidate object in the first panoramic image corresponding to the second time and the third time respectively, and determine at least one second target candidate object according to the second region coincidence degree; wherein the third time is a next time adjacent to the second time in the N different times, and the second target candidate object is a first target candidate object whose second region coincidence degree is greater than or equal to the first preset coincidence degree threshold.
[0157] The execution unit is configured to, if the third time is not the latest time in the N different times, continue to calculate a region coincidence degree of the second target candidate object at the third time and a next time; if the third time is the latest time in the N different times, determine that the second target candidate object is the first target object.
[0158] In an embodiment, the second acquisition module 630 includes:
[0159] The acquisition unit is configured to, for each first target object, acquire a region image of the first target object in the two first panoramic images of the latest time according to region information of the first target object in the two first panoramic images of the latest time.
[0160] The image segmentation unit is configured to perform image segmentation processing on each region image to obtain an outline image of the first target object in the two first panoramic images of the latest time.
[0161] In an embodiment, the region image comprises a contour image and a region background image.
[0162] The image segmentation unit is specifically configured to:
[0163] input each region image into a pre-trained image segmentation model, segment the contour image and the region background image in each region image, and output a contour image corresponding to each region image.
[0164] In an embodiment, the training process of the image segmentation model comprises:
[0165] obtaining a plurality of first sample region images and sample contour images corresponding to the first sample region images respectively, wherein each sample region image comprises a second sample object;
[0166] inputting the first sample region images and the sample contour images into the image segmentation model to be trained for iterative training, and obtaining the trained image segmentation model.
[0167] In an embodiment, the image segmentation model comprises a contour detection layer, a second matching layer, and a second fully connected layer.
[0168] inputting the first sample region images and the sample contour images into the image segmentation model to be trained for iterative training, and obtaining the trained image segmentation model, comprising:
[0169] for each first sample region image, the contour detection layer is configured to detect the contour of the second sample object in the first sample region image to obtain a reference contour image corresponding to the second sample object;
[0170] the second matching layer is configured to calculate a second matching degree between the reference contour image and the sample contour image;
[0171] the second fully connected layer is configured to, if the second matching degree is less than a second preset matching threshold, adjust the model parameters of the image segmentation model to be trained and perform the next round of iterative training; if the second matching degree is greater than or equal to the second preset matching threshold, stop the iteration to obtain the trained image segmentation model.
[0172] In an embodiment, the training process of the target state detection model comprises:
[0173] obtaining a plurality of second sample region images carrying label information, wherein each second sample region image comprises a third sample object, and the label information comprises the probability of the third sample object being in a death state and / or a survival state;
[0174] inputting the second sample region images into the target state detection model to be trained for iterative training, and obtaining the trained target state detection model.
[0175] In one embodiment, the target state detection model comprises a classification layer, a difference calculation layer and a third full connection layer.
[0176] The second sample region image is input into the target state detection model to be trained for iterative training, to obtain a trained target state detection model, comprising:
[0177] For each second sample region image, the classification layer is configured to determine a reference probability of a third sample object in the second sample region image being in a death state and / or a survival state;
[0178] The difference calculation layer is configured to calculate a probability difference between the reference probability and a probability in the label information corresponding to the second sample region image;
[0179] The third full connection layer is configured to, if the probability difference is greater than a third preset matching threshold, adjust model parameters of the target state detection model to be trained, and perform a next round of iterative training; and if the probability difference is less than or equal to the third preset matching threshold, stop iteration to obtain the trained target state detection model.
[0180] In one embodiment, the target detection device further comprises:
[0181] The output module is configured to, if the probability of the second target object being in the death state is greater than or equal to a preset probability threshold, output a warning information; wherein the warning information comprises at least one of the following: the probability of the second target object being in the death state, and the region information corresponding to the second target object.
[0182] The device of the embodiment of the present application can efficiently and accurately preliminarily screen out objects suspected to be in a death state (i.e., the first target object) from the N first panoramic images by determining the target candidate object with a region coincidence degree greater than or equal to the first preset coincidence degree threshold as the first target object. Moreover, since the panoramic image can cover all target candidate objects in the current scene, the comprehensiveness of the screening result (i.e., the object suspected to be in a death state) can be ensured by screening among all target candidate objects. Further, since the first target object is only the object suspected to be in a death state preliminarily screened out, the first target object needs to be further screened to further improve the detection accuracy of the object in a death state and reduce the false positive rate of the object in a death state. The device obtains the region image and the contour image of each first target object in the two first panoramic images with the latest time according to the region information, so as to determine the contour coincidence degree of each first target object in the two first panoramic images with the latest time according to the contour image corresponding to each first target object, and determines the second target object by determining the first target object with a contour coincidence degree greater than or equal to a second preset coincidence degree threshold. Since the contour coincidence degree is calculated only for the first target object preliminarily screened out, but not for all target candidate objects, the amount of calculation is reduced, thereby improving the determination efficiency of the second target object. In addition, since the object in a survival state may not change position but change posture (i.e., only the contour changes) within a period of time, that is, the object in a survival state may have the following situation: the region coincidence degree in different panoramic images is high, but the contour coincidence degree is small. Therefore, by determining the contour coincidence degree of the object suspected to be in a death state (i.e., the first target object) in the multiple panoramic images, the second target object with a higher possibility of being in a death state can be screened out from the first target object, thereby further improving the accuracy of the object screened out in a death state. Further, the region image corresponding to the second target object is input into the pre-trained target state detection model, and the probability of the second target object being in a death state and / or a survival state is output.It can be seen that, in the process of detecting the survival state of a single object in the cluster, the device preliminarily screens out the first target object suspected to be in the death state from the plurality of objects by the area coincidence degree of the single object in the plurality of panoramic images, and further screens out the second target object with a higher possibility of being in the death state from the first target object according to the contour coincidence degree of each first target object in the plurality of panoramic images, and finally determines the state of the second target object by using the target state detection model, comprehensively considers the position and posture of the single object at a plurality of time points, and does not only rely on the recognition result output by the image recognition model, and after layer-by-layer screening of a plurality of limiting conditions, the object in the death state determined is more comprehensive and accurate, and the false positive rate of the object in the death state is reduced.
[0183] Those skilled in the art should understand that, Figure 6 The target detection device in the above embodiment can be used to realize the target detection method described above, and the details described above should be similar to the description of the method part above. To avoid tediousness, no further description is given here.
[0184] Based on the same idea, the present application also provides an electronic device, as shown in Figure 7 The electronic device can have a large difference due to different configurations or performances, and can include one or more processors 701 and memories 702, and the memories 702 can store one or more storage applications or data. The memory 702 can be temporary storage or persistent storage. The application stored in the memory 702 can include one or more modules (not shown in the figure), and each module can include a series of computer executable instructions in the electronic device. Further, the processor 701 can be configured to communicate with the memory 702 and execute a series of computer executable instructions in the memory 702 on the electronic device. The electronic device can also include one or more power supplies 703, one or more wired or wireless network interfaces 704, one or more input / output interfaces 705, and one or more keyboards 706.
[0185] In particular, in the present embodiment, the electronic device includes a memory and one or more programs, wherein one or more programs are stored in the memory, and the one or more programs can include one or more modules, and each module can include a series of computer executable instructions in the electronic device, and the one or more processors are configured to execute the one or more programs including the following computer executable instructions:
[0186] Obtain the first panoramic image of a plurality of target candidate objects at N different time points and the area information of the first panoramic image, N is an integer greater than or equal to 2;
[0187] determine a region coincidence degree of each target candidate object at N different time instants according to the region information, and determine at least one first target object according to the region coincidence degree; wherein the first target object is a target candidate object whose region coincidence degree is greater than or equal to a first preset coincidence degree threshold;
[0188] According to the region information, the region image and the contour image of each first target object in the two first panoramic images with the latest time instants are obtained.
[0189] According to the contour image corresponding to each first target object, the contour coincidence degree of each first target object in the two first panoramic images with the latest time instants is determined, and a second target object is determined according to the contour coincidence degree; wherein the second target object is a first target object whose contour coincidence degree is greater than or equal to a second preset coincidence degree threshold.
[0190] The region image corresponding to the second target object is input into a pre-trained target state detection model, and the probability that the second target object is in a death state and / or a survival state is output.
[0191] The device of the embodiment of the present application can efficiently and accurately preliminarily screen out objects suspected to be in a death state (i.e., the first target object) from the N first panoramic images by determining the target candidate object with a region coincidence degree greater than or equal to the first preset coincidence degree threshold as the first target object. Moreover, since the panoramic image can cover all target candidate objects in the current scene, the comprehensiveness of the screening result (i.e., the object suspected to be in a death state) can be ensured by screening among all target candidate objects. Further, since the first target object is only the object suspected to be in a death state preliminarily screened out, the first target object needs to be further screened to further improve the detection accuracy of the object in a death state and reduce the false positive rate of the object in a death state. The device obtains the region image and the contour image of each first target object in the two first panoramic images with the latest time according to the region information, so as to determine the contour coincidence degree of each first target object in the two first panoramic images with the latest time according to the contour image corresponding to each first target object, and determines the second target object by determining the first target object with a contour coincidence degree greater than or equal to a second preset coincidence degree threshold. Since the contour coincidence degree is calculated only for the first target object preliminarily screened out, but not for all target candidate objects, the amount of calculation is reduced, thereby improving the determination efficiency of the second target object. In addition, since the object in a survival state may not change position but change posture (i.e., only the contour changes) within a period of time, that is, the object in a survival state may have the following situation: the region coincidence degree in different panoramic images is high, but the contour coincidence degree is small. Therefore, by determining the contour coincidence degree of the object suspected to be in a death state (i.e., the first target object) in the multiple panoramic images, the second target object with a higher possibility of being in a death state can be screened out from the first target object, thereby further improving the accuracy of the object screened out in a death state. Further, the region image corresponding to the second target object is input into the pre-trained target state detection model, and the probability of the second target object being in a death state and / or a survival state is output.It can be seen that, in the process of detecting the survival state of a single object in the cluster, the device preliminarily screens out the first target object suspected to be in the death state from the plurality of objects by the area coincidence degree of the single object in the plurality of panoramic images, and further screens out the second target object with a higher possibility of being in the death state from the first target objects according to the contour coincidence degree of each first target object in the plurality of panoramic images, and finally determines the state of the second target object by using the target state detection model, comprehensively considers the position and posture of a single object at multiple times, and does not only rely on the recognition result output by the image recognition model, and after layer-by-layer screening of multiple restriction conditions, the object in the death state determined is more comprehensive and accurate, and the false positive rate of the object in the death state is reduced.
[0192] The embodiment of the application also provides a storage medium storing one or more computer programs, the one or more computer programs comprising instructions that, when executed by an electronic device comprising a plurality of application programs, can enable the electronic device to perform the processes of the target detection method embodiment, and are specifically used for performing:
[0193] obtaining first panoramic images of a plurality of target candidate objects at N different time points and area information of the target candidate objects in the first panoramic images, N being an integer greater than or equal to 2;
[0194] determining, according to the area information, area coincidence degrees of each target candidate object at the N different time points, and determining at least one first target object according to the area coincidence degrees; wherein the first target object is a target candidate object with an area coincidence degree greater than or equal to a first preset coincidence degree threshold;
[0195] obtaining, according to the area information, area images and contour images of each first target object in two first panoramic images with the latest time point among the N first panoramic images;
[0196] determining, according to the contour images corresponding to each first target object, contour coincidence degrees of each first target object in the two first panoramic images with the latest time point, and determining a second target object according to the contour coincidence degrees; wherein the second target object is a first target object with a contour coincidence degree greater than or equal to a second preset coincidence degree threshold;
[0197] inputting the area images corresponding to the second target object into a pre-trained target state detection model, and outputting probabilities of the second target object being in a death state and / or a survival state.
[0198] The storage medium of the embodiment of the present application can be used to detect the survival state of a plurality of target candidate objects in a cluster. The first panoramic image of each target candidate object at N different time points and the region information in the first panoramic image are obtained. According to the region information, the region coincidence degree of each target candidate object at N different time points is determined. Since the object in the survival state does not remain stationary, the region coincidence degree of a single object in the survival state in different panoramic images is relatively small, or even completely coincides. Therefore, by determining the target candidate object with a region coincidence degree greater than or equal to a first preset coincidence degree threshold as a first target object, the object suspected to be in a death state (i.e., the first target object) can be efficiently and accurately preliminarily screened from N first panoramic images. Moreover, since the panoramic image can cover all target candidate objects in the current scene, the comprehensiveness of the screening result (i.e., the object suspected to be in a death state) can be ensured by screening all target candidate objects. Further, since the first target object is only a preliminarily screened object suspected to be in a death state, the first target object needs to be further screened to further improve the detection accuracy of the object in a death state and reduce the false positive rate of the object in a death state. According to the region information, the storage medium obtains the region image and the contour image of each first target object in the two first panoramic images with the latest time point in N first panoramic images. Thus, according to the contour image corresponding to each first target object, the contour coincidence degree of each first target object in the two first panoramic images with the latest time point is determined, and the first target object with a contour coincidence degree greater than or equal to a second preset coincidence degree threshold is determined as a second target object. Since the contour coincidence degree is only calculated for the preliminarily screened first target object, rather than for all target candidate objects, the amount of calculation is reduced, thereby improving the determination efficiency of the second target object. In addition, since the object in the survival state may not change its position but change its posture (i.e., only the contour changes) within a period of time, that is, the object in the survival state may have the following situation: the region coincidence degree in different panoramic images is relatively high, but the contour coincidence degree is relatively small. Therefore, by determining the contour coincidence degree of the object suspected to be in a death state (i.e., the first target object) in a plurality of panoramic images, the second target object with a higher possibility of being in a death state can be screened from the first target object, thereby further improving the accuracy of the screened object in a death state. Furthermore, the region image corresponding to the second target object is input into a pre-trained target state detection model, and the probability of the second target object being in a death state and / or a survival state is output.It can be seen that, in the process of detecting the survival state of a single object in the cluster, the storage medium preliminarily screens out the first target object suspected to be in the death state from the plurality of objects according to the area coincidence degree of the single object in the plurality of panoramic images, and further screens out the second target object with a higher possibility of being in the death state from the first target object according to the contour coincidence degree of each first target object in the plurality of panoramic images, and finally determines the state of the second target object by using the target state detection model, comprehensively considers the position and posture of the single object at a plurality of moments, and does not only rely on the recognition result output by the image recognition model, and the object in the death state is determined through a plurality of limiting conditions, so that the object in the death state is more comprehensive and accurate, and the false positive rate of the object in the death state is reduced.
[0199] The systems, apparatuses, modules or units illustrated in the above embodiments can be specifically implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer. Specifically, the computer may, for example, be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0200] For ease of description, the above apparatuses are described as various units respectively by functions. Of course, functions of the units can be implemented in a software and / or hardware manner in one or more software and / or hardware.
[0201] Those skilled in the art will understand that embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0202] The present application is described with reference to flowcharts and / or block diagrams according to the methods, devices (systems) and computer program products of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one flow or multiple flows and / or blocks Figure 1an apparatus to perform one or more of the functions specified in a block or blocks.
[0203] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flow Figure 1 one or more of the flow or flows and / or blocks Figure 1 an apparatus to perform one or more of the functions specified in a block or blocks.
[0204] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flow Figure 1 one or more of the flow or flows and / or blocks Figure 1 an apparatus to perform one or more of the functions specified in a block or blocks.
[0205] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0206] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory. The memory can also include non-volatile memory, such as read-only memory (ROM), electrically programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or non-volatile random access memory (NVRAM). The memory is an example of computer readable media.
[0207] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile discs (DVDs) or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.
[0208] It is also to be noted that the terms "comprising", "including", and "having" or variations thereof herein, are intended to be open-ended terms that specify the presence of any stated elements. The term "comprising" is not used in a restrictive sense, and is used to provide for "additional" or "optional" elements, as further set forth herein. It is noted that the use of the term "comprising" does not exclude other elements being present in addition to those elements listed. It is also noted that the use of the term "including" does not exclude other elements being present in addition to those elements listed. It is also noted that the use of the term "having" does not exclude other elements being present in addition to those elements listed.
[0209] The application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including memory storage devices.
[0210] Each of the embodiments in the present specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, the system embodiments are described simply because they are basically similar to the method embodiments, and the relevant parts can be referred to the part of the method embodiments.
[0211] The above only describes the embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of the claims of the present application.
Claims
1. A target detection method, characterized in that, include: Obtain first panoramic images of multiple target candidate objects at N different times and region information in the first panoramic images, where N is an integer greater than or equal to 2; The overlap degree of each target candidate object is determined at N different times based on the regional information, and at least one first target object is determined based on the regional overlap degree; wherein, the first target object is a target candidate object whose regional overlap degree is greater than or equal to a first preset overlap degree threshold. Based on the region information, obtain the region image and contour image of each first target object in the two latest first panoramic images among the N first panoramic images; Based on the contour image corresponding to each first target object, the contour overlap degree of each first target object in the two latest first panoramic images at the time is determined, and a second target object is determined based on the contour overlap degree; wherein, the second target object is a first target object whose contour overlap degree is greater than or equal to a second preset overlap degree threshold; The region image corresponding to the second target object is input into a pre-trained target state detection model, which outputs the probability that the second target object is in a dead state and / or a alive state. The region image corresponding to the second target object is obtained from the panoramic image with the latest shooting time among the two first panoramic images with the latest shooting time.
2. The method according to claim 1, characterized in that, The step of acquiring first panoramic images of multiple target candidates at N different times and region information within the first panoramic images includes: At N different times, images are taken of the plurality of target candidates to obtain first panoramic images of the plurality of target candidates at N different times, and each first panoramic image includes the plurality of target candidates. Each of the first panoramic images is input into a pre-trained target region detection model, and the output is the region information of the multiple target candidates in each of the first panoramic images.
3. The method according to claim 2, characterized in that, The training process of the target region detection model includes: Multiple first sample panoramic images and second sample panoramic images corresponding to each first sample panoramic image are acquired; wherein each first sample panoramic image includes multiple first sample objects, and each second sample panoramic image includes target area information corresponding to the multiple first sample objects. The first sample panoramic image and the second sample panoramic image are input into the target region detection model to be trained for iterative training to obtain the trained target region detection model.
4. The method according to claim 3, characterized in that, The target region detection model includes: a region detection layer, a first matching layer, and a first fully connected layer; The step of inputting the first sample panoramic image and the second sample panoramic image into the target region detection model to be trained for iterative training to obtain the trained target region detection model includes: For each first sample panoramic image, the region detection layer is used to detect the region where each first sample object is located in the first sample panoramic image to obtain the reference region information corresponding to the first sample panoramic image. The first matching layer is used to calculate a first matching degree between the reference region information and the target region information in the second sample panoramic image; The first fully connected layer is used to adjust the model parameters of the target region detection model to be trained and perform the next round of iterative training if the first matching degree is less than the first preset matching threshold; if the first matching degree is greater than or equal to the first preset matching threshold, the iteration is stopped and the trained target region detection model is obtained.
5. The method according to claim 1, characterized in that, The step of determining the regional overlap degree of each of the target candidate objects at N different times based on the regional information, and determining at least one first target object based on the regional overlap degree, includes: Based on the region information in the first panoramic image corresponding to the target candidate object at the first time and the second time respectively, the first region overlap degree of the target candidate object at the first time and the second time is determined, and at least one first target candidate object is determined based on the first region overlap degree; wherein, the first time and the second time are two adjacent times among the N different times, the second time is later than the first time, and the first target candidate object is a target candidate object whose first region overlap degree is greater than or equal to the first preset overlap degree threshold; Based on the region information of the first target candidate in the first panoramic image corresponding to the second time and the third time respectively, the second region overlap degree of the first target candidate is determined at the second time and the third time, and at least one second target candidate is determined based on the second region overlap degree; wherein, the third time is the next time adjacent to the second time among the N different times, and the second target candidate is the first target candidate whose second region overlap degree is greater than or equal to the first preset overlap degree threshold; If the third time is not the latest time among the N different times, then the region overlap of the second target candidate is calculated between the third time and the next time; if the third time is the latest time among the N different times, then the second target candidate is determined to be the first target object.
6. The method according to claim 1, characterized in that, The step of obtaining the region image and contour image of each first target object in the two latest first panoramic images among N first panoramic images based on the region information includes: For each of the first target objects, based on the region information of the first target object in the two latest first panoramic images at the time, obtain the region image of the first target object in the two latest first panoramic images at the time; Image segmentation processing is performed on each of the said regions to obtain the contour images of the first target object in the two latest first panoramic images at the said time.
7. The method according to claim 6, characterized in that, The region image includes the contour image and the region background image; The step of performing image segmentation processing on each of the said region images to obtain the contour images of the first target object in the two latest first panoramic images at the said time includes: Each region image is input into a pre-trained image segmentation model, which segments the contour image and the region background image in each region image, and outputs the contour image corresponding to each region image.
8. The method according to claim 7, characterized in that, The training process of the image segmentation model includes: Multiple first sample region images and sample contour images corresponding to each first sample region image are acquired; wherein each sample region image includes a second sample object. The first sample region image and the sample contour image are input into the image segmentation model to be trained for iterative training to obtain the trained image segmentation model.
9. The method according to claim 8, characterized in that, The image segmentation model includes: a contour detection layer, a second matching layer, and a second fully connected layer; The step of inputting the first sample region image and the sample contour image into the image segmentation model to be trained for iterative training to obtain the trained image segmentation model includes: For each first sample region image, the contour detection layer is used to detect the contour of the second sample object in the first sample region image to obtain a reference contour image corresponding to the second sample object; The second matching layer is used to calculate a second matching degree between the reference contour image and the sample contour image; The second fully connected layer is used to adjust the model parameters of the image segmentation model to be trained and perform the next round of iterative training if the second matching degree is less than the second preset matching threshold; if the second matching degree is greater than or equal to the second preset matching threshold, the iteration is stopped and the trained image segmentation model is obtained.
10. The method according to claim 1, characterized in that, The training process of the target state detection model includes: Acquire multiple second sample region images carrying label information; wherein each second sample region image includes a third sample object, and the label information includes the probability that the third sample object is in a dead state and / or a alive state; The second sample region image is input into the target state detection model to be trained for iterative training to obtain the trained target state detection model.
11. The method according to claim 10, characterized in that, The target state detection model includes: a classification layer, a difference calculation layer, and a third fully connected layer; The step of inputting the second sample region image into the target state detection model to be trained for iterative training to obtain the trained target state detection model includes: For each second sample region image, the classification layer is used to determine a reference probability that the third sample object in the second sample region image is in a dead state and / or a alive state; The difference calculation layer is used to calculate the probability difference between the reference probability and the probability in the label information corresponding to the second sample region image; The third fully connected layer is used to adjust the model parameters of the target state detection model to be trained and perform the next round of iterative training if the probability difference is greater than the third preset matching threshold; if the probability difference is less than or equal to the third preset matching threshold, the iteration is stopped and the trained target state detection model is obtained.
12. The method according to claim 1, characterized in that, The method further includes: If the probability that the second target object is in a dead state is greater than or equal to a preset probability threshold, then a warning message is output; wherein, the warning message includes at least one of the following: the probability that the second target object is in a dead state, and the area information corresponding to the second target object.
13. A target detection device, characterized in that, include: The first acquisition module is used to acquire first panoramic images of multiple target candidate objects at N different times and region information in the first panoramic images, where N is an integer greater than or equal to 2; The first determining module is used to determine the regional overlap degree of each of the target candidate objects at N different times based on the regional information, and to determine at least one first target object based on the regional overlap degree; wherein, the first target object is a target candidate object whose regional overlap degree is greater than or equal to a first preset overlap degree threshold. The second acquisition module is used to acquire, based on the region information, the region image and the contour image of each first target object in the two latest first panoramic images among the N first panoramic images; The second determining module is used to determine the contour overlap degree of each first target object in the two latest first panoramic images at the time based on the contour image corresponding to each first target object, and to determine the second target object based on the contour overlap degree; wherein, the second target object is a first target object whose contour overlap degree is greater than or equal to a second preset overlap degree threshold. The target state detection module is used to input the region image corresponding to the second target object into a pre-trained target state detection model and output the probability that the second target object is in a dead state and / or a alive state. The region image corresponding to the second target object is obtained from the panoramic image with the latest shooting time among the two first panoramic images with the latest shooting time.
14. An electronic device, characterized in that, The device includes a processor and a memory electrically connected to the processor, the memory storing a computer program, and the processor being configured to call and execute the computer program from the memory to implement the target detection method as described in any one of claims 1-12.
15. A storage medium, characterized in that, The storage medium is used to store a computer program that can be executed by a processor to implement the target detection method as described in any one of claims 1-12.
Citation Information
Patent Citations
Individual behavior identification method and system
CN107273815A
Video object detection and segmentation method based on space-time double-branch network
CN110097568A