Target object detection method and device and electronic equipment
By using multiple upsampling layers to output heat maps and combine detection in the detection model, the problem of target object detection accuracy under occlusion is solved, the difficulty of model training is reduced, and effective detection in occlusion areas is achieved.
Patent Information
- Application Number
- CN202310187160.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2024-08-23
AI Technical Summary
It is difficult for the existing technology to accurately detect the position and category of the target object when it is blocked, especially when the receptive field is small, resulting in increased difficulty in training the detection model and a high false detection rate.
By using a pre-trained detection model, the image to be detected is input to multiple upsampling layers, each layer outputs a heat map and combined with these heat maps for detection, thereby achieving target objects in the occluded area in the process of decreasing the effective receptive field layer by layer. accurate detection and reduce the difficulty of model training.
It achieves effective and accurate detection when the target object is blocked, reduces the difficulty of training the detection model, and does not need to provide a large number of sample images under blocked conditions.
Smart Images

Figure CN118537572A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to a target object detection method, device and electronic device. Background Art
[0002] Image recognition refers to the technology of using computers to process, analyze and understand images to identify targets and objects of various different patterns. It is a practical application of deep learning algorithms.
[0003] For example, in an application, a trained hand joint model can be used to detect hand joints in an image. Summary of the invention
[0004] This disclosure section is provided to introduce concepts in a brief form, which will be described in detail in the detailed description section below. This disclosure section is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] The embodiments of the present disclosure provide a target object detection method, device and electronic device to achieve effective and accurate detection of a target object when the target object is blocked.
[0006] In a first aspect, an embodiment of the present disclosure provides a target object detection method, comprising: acquiring an image to be detected; inputting the image to be detected into a pre-trained detection model to obtain N heat maps; wherein the N heat maps are respectively output by N upsampling layers of the detection model, and each of the upsampling layers outputs a heat map; N is a positive integer greater than or equal to 2; based on the N heat maps, determining the target object in the image to be detected.
[0007] In a second aspect, an embodiment of the present disclosure provides a target object detection device, comprising: an acquisition unit, used to acquire an image to be detected; a detection unit, used to input the image to be detected into a pre-trained detection model to obtain N heat maps; wherein the N heat maps are outputted by N upsampling layers of the detection model respectively, and each of the upsampling layers outputs a heat map respectively; N is a positive integer greater than or equal to 2; and a determination unit, used to determine the target object in the image to be detected based on the N heat maps.
[0008] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the target object detection method as described in the first aspect.
[0009] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the target object detection method as described in the first aspect.
[0010] In the target object detection method, device and electronic device provided by the embodiments of the present disclosure, after the image to be detected is input into the detection model, each of the N upsampling layers in the detection model will output a heat map, and then the heat maps output by the N upsampling layers are combined to jointly realize the detection of the target object in the image to be detected. That is, in the process of sequential processing of the N upsampling layers, the effective receptive field is also decreasing layer by layer, and for the detection of the target object in the occluded area, a larger effective receptive field is often required to detect the specific position and category of the currently occluded target object from the features around the target object. Therefore, each of the N upsampling layers here outputs a heat map, and then the features when the effective receptive field has not reached the minimum are combined to jointly realize the detection of the target object from these features. It can be seen that through this method, the effective and accurate detection of the target object can be realized when there is occlusion in the area where the target object is located. At the same time, the training difficulty of the detection model can also be reduced, and there is no need to provide a large number of sample images in the case of occlusion. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0012] Figure 1 is a flow chart of an embodiment of a target object detection method according to the present disclosure;
[0013] Figure 2 is a schematic diagram of a detection model in one embodiment of a target object detection method according to the present disclosure;
[0014] Figure 3 is a schematic diagram of a detection result output by a hand joint point detection model in the related art;
[0015] Figure 4 is a schematic diagram of a detection result output by another hand joint point detection model in the related art;
[0016] Figure 5 is a schematic diagram of a detection result output by a detection model in one embodiment of a target object detection method according to the present disclosure;
[0017] Figure 6 is a schematic diagram of three heat maps output by a detection model in one embodiment of a target object detection method according to the present disclosure;
[0018] Figure 7 is a schematic diagram of a detection model in another embodiment of a target object detection method according to the present disclosure;
[0019] Figure 8 is a schematic diagram of a detection model in another embodiment of the target object detection method according to the present disclosure;
[0020] Fig. 9 is a schematic structural diagram of an embodiment of a target object detection device according to the present disclosure;
[0021] Fig.10 is an exemplary system architecture in which a target object detection method according to an embodiment of the present disclosure may be applied;
[0022] Fig.11 It is a schematic diagram of the basic structure of an electronic device provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0024] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0025] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0026] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0027] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0028] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0029] Please refer to Figure 1 , which shows the process of an embodiment of the target object detection method according to the present disclosure. The target object detection method can be applied to an electronic device (the composition structure of the electronic device is described in the subsequent embodiments). Figure 1 The target object detection method shown comprises the following steps:
[0030] Step 101: Acquire an image to be detected.
[0031] The image to be detected may be input by a user, such as uploading an image to be detected by a user, or may be captured by a camera directly or indirectly connected to the electronic device. Of course, the image to be detected may also be obtained in various ways, which are not limited here.
[0032] Step 102: input the image to be detected into a pre-trained detection model to obtain N heat maps.
[0033] Then, the image to be detected is input into the trained detection model, which is used to output N heatmaps. The N heatmaps are respectively output by the N upsampling layers of the detection model, and each upsampling layer outputs a heatmap; N is a positive integer greater than or equal to 2.
[0034] It should be noted that, here, the detection model includes but is not limited to X upsampling layers. Wherein, X is a positive integer greater than or equal to N. When X is greater than N, the detection model is used to output N heat maps from N upsampling layers in the X upsampling layers. When X is equal to N, each upsampling layer in the X upsampling layers outputs a heat map.
[0035] For example, please refer to Figure 2 , Figure 2 A schematic diagram of the structure of a detection model provided in an embodiment of the present application, wherein the detection model is an hourglass network structure, the first half of the model includes four feature extraction layers, and the second half of the model includes three upsampling layers.
[0036] It should be noted that after the image to be detected is input into the detection model, the image features are first extracted layer by layer through the four feature extraction layers in the first half of the model. At the same time, the size of the features is continuously reduced, but each element on the features has an increasingly larger receptive field. Then, in the second half of the model, the smallest features are continuously enlarged through three upsampling layers and fused with the larger features in the first half. In this process, as the feature size is enlarged, the effective receptive field that the model can see decreases layer by layer.
[0037] Finally, each upsampling layer outputs a heatmap (heatmap1, heatmap2, and heatmap3). Each heatmap includes the detection results of the target object in the image to be detected. When designing the model, a supervision signal can be added to each upsampling layer that needs to output a heatmap, so that the upsampling layer outputs a heatmap after fusion processing.
[0038] Here, the corresponding detection model can be trained according to actual needs. For example, the detection model can be a hand joint detection model, which is used to detect hand joints. In this case, the target object is the hand joints of the human body. Another example is that the detection model can be a human skeleton detection model, which is used to detect key bones of the human body (such as the spine and pelvis). In this case, the target object is the key bones of the human body. Another example is that the detection model can also be a facial features detection model, which is used to detect facial features (eyebrows, eyes, ears, nose, and mouth). In this case, the target object is the facial features.
[0039] Step 103: Determine the target object in the image to be detected based on the N heat maps.
[0040] Finally, based on the N heat maps output by the N upsampling layers, the target object in the image to be detected is jointly determined.
[0041] In related technologies, for the detection of target objects in an image, the detection results are often determined only by the heat map output by the last processing layer (i.e., the last upsampling layer), and the last processing layer often has the smallest effective receptive field, and it is often impossible to effectively detect target objects in occluded areas.
[0042] See also Figure 3 For example, for the hand joint detection model (which is used to detect a joint on the little finger), when the little finger is blocked by a book, the model will have serious errors in detecting the hand joints due to the lack of complete image information of the finger, and it will be unable to accurately determine the position of the joint of the blocked finger.
[0043] If a large number of objects occluding the hands are added when training the hand joint detection model, the model will easily learn to detect joints in non-hand areas, resulting in more false detections. For example, hand joints are detected on non-hand objects (such as books that are not occluded by the hands). Figure 4 As shown), therefore, it is currently impossible to effectively detect the position of the occluded target object.
[0044] In the target object detection method provided by the embodiment of the present application, after the image to be detected is input into the detection model, each of the N upsampling layers in the detection model will output a heat map, and then the heat maps output by the N upsampling layers will be combined to jointly realize the detection of the target object in the image to be detected. That is, in the process of sequential processing of the N upsampling layers, the effective receptive field is also decreasing layer by layer, and for the detection of the target object in the occluded area, a larger effective receptive field is often required to detect the specific position and category of the currently occluded target object from the features around the target object. Therefore, each of the N upsampling layers here outputs a heat map, and then combined with the features when the effective receptive field has not reached the minimum, the detection of the target object is jointly realized from these features. It can be seen that through this method, it is possible to realize the effective and accurate detection of the target object in the case of occlusion in the area where the target object is located, and at the same time, it can also reduce the difficulty of training the detection model without providing a large number of sample images in the case of occlusion.
[0045] The detection effect of the target object detection method provided by this application can be found in Figure 5 , Figure 5 The target object (a joint of the little finger) output by the detection model for the hand joint detection model is shown. When one of the fingers in the image to be detected is blocked by a book, the position of the blocked joint of the finger can still be effectively detected by this method, and there will be no false detection of joints on other books that are not blocked by the hand.
[0046] Optionally, the heat map output by the upsampling layer includes a confidence parameter of each region in the heat map, wherein the confidence parameter represents the confidence that the region includes the target object.
[0047] Here, a region can be understood as a pixel or a combination of multiple pixels. The combination of multiple pixels can be a region with four pixels or nine pixels, and the specific number is not limited here.
[0048] For example, when a single pixel is used as a region, the detection result in the heat map output by the upsampling layer includes the confidence score of each pixel. At this time, the pixel with the highest confidence is determined to include the target object. Assuming that the detection model is a hand joint model, the pixel with the highest confidence is determined to include the hand joint.
[0049] For another example, when four pixels are taken as a region, the detection result in the heat map output by the upsampling layer includes the confidence score of every four pixels as a region.
[0050] Here, the confidence parameter can be a decimal or a percentage, for example, the confidence parameter is 0.7, 0.6, 80%, 20%, and so on.
[0051] In this embodiment, the above-mentioned step 103 determines the target object in the image to be detected based on N heat maps, which can specifically include: obtaining the confidence parameters corresponding to each area in the N heat maps; comparing the confidence parameters corresponding to each area in the N heat maps, and determining the area corresponding to the largest confidence parameter as including the target object in the image to be detected.
[0052] Here, the confidence parameter corresponding to each area in each heat map can be obtained, and then the confidence parameters corresponding to each area in the N heat maps are compared together; finally, the area corresponding to the largest confidence parameter is determined to include the target object in the image to be detected.
[0053] In one embodiment, the above steps compare the confidence parameters corresponding to each area in the N heat maps, and determine the area corresponding to the largest confidence parameter as including the target object in the image to be detected. It can also specifically include: obtaining the confidence parameters corresponding to the target areas in the N heat maps; comparing the confidence parameters corresponding to the target areas in the N heat maps, and determining the target area corresponding to the largest confidence parameter as including the target object in the image to be detected.
[0054] It should be noted that the target area is the area with the largest confidence parameter in each heat map. That is, for each heat map, the area with the largest confidence parameter is usually determined to include the target object.
[0055] That is, here we first determine the area with the largest confidence parameter in each heat map, then compare the areas with the largest confidence parameters in the N heat maps (i.e., the target areas), and then determine the target area corresponding to the largest confidence parameter in the N heat maps as including the target object in the image to be detected.
[0056] For example, see Figure 6 , Figure 6There are three heatmaps, namely heatmap1, heatmap2 and heatmap3. In heatmap1, target area A is determined to include the target object, and the confidence parameter of target area A is 95%. Equivalent to the target area A of heatmap1 corresponds to the detected target object. In heatmap2, target area B is determined to include the target object, and the confidence parameter of target area B is 98%. Equivalent to the target area B of heatmap2 corresponds to the detected target object. In heatmap3, target area C is determined to include the target object, and the confidence parameter of target area C is 99%. Equivalent to the target area C of heatmap3 corresponds to the detected target object. Here, the confidence parameters corresponding to the target areas in the three heatmaps are compared, and then the target area C with the largest confidence parameter is determined to include the target object in the image to be detected. That is, the target object in the image to be detected finally corresponds to the position corresponding to the target area C in the detection image.
[0057] Optionally, in order to better compare the confidence parameters of each heat map, before obtaining the confidence parameters corresponding to each area in the N heat maps, the method also includes: adjusting the size of the N heat maps to be the same as the size of the target heat map; wherein the target heat map is the heat map output by the last upsampling layer among the N upsampling layers.
[0058] That is, all heatmaps are resized to be the same size as the heatmap output by the last upsampling layer.
[0059] Accordingly, the confidence parameters corresponding to each region in each heat map after resizing are subsequently compared, and the region with the largest confidence parameter is determined to include the target object in the image to be detected.
[0060] Taking three heatmaps, heatmap1, heatmap2 and heatmap3, as examples, the above process can be expressed by the following formula:
[0061] heatmap=max(resize(heatmap1), resize(heatmap2), heatmap3);
[0062] In the above formula, max means taking the area corresponding to the largest confidence parameter among the three, and resize means adjusting the size of heatmap1 and heatmap2, that is, adjusting the smaller heatmap1 and heatmap2 to the same size as heatmap3. In the above formula, heatmap3 is the heat map output by the last upsampling layer.
[0063] In one embodiment, each heat map may also include coordinate information of the detected target object.
[0064] Correspondingly, the above step 103 determines the target object in the image to be detected based on N heat maps, and can also specifically include: obtaining coordinate information corresponding to the target object in each heat map, and determining the target object with the most matching coordinate information as the target object in the image to be detected.
[0065] Here, matching can be understood as the same. For example, suppose there are three heatmaps (respectively heatmap1, heatmap2 and heatmap3), the coordinates of the target object in heatmap1 are (5, 5), the coordinates of the target object in heatmap2 are (4, 7), and the coordinates of the target object in heatmap1 are (5, 5). Since the coordinates of the target object in heatmap1 are the same as the coordinates of the target object in heatmap2, and the target object with the coordinates of (5, 5) is the largest, the target object with the coordinates of (5, 5) is determined to be the target object in the image to be detected.
[0066] It should be noted that if the coordinate information of the target object is different, the target object in the image to be detected can be determined by the method with the highest confidence in the aforementioned embodiment; of course, any target object output by the thermal map can also be used as the target object in the image to be detected.
[0067] It is understandable that the above matching can also be understood as the area where the coordinate information is located most. For example, the image can be divided into multiple areas, and the three heatmaps heatmap1, heatmap2 and heatmap3 are still used as examples. When the coordinates of the target object in heatmap1 and the coordinates of the target object in heatmap3 are both located in the same area, and the coordinates of the target object in heatmap2 belong to another area, then the target object in heatmap1 or the target object in heatmap2 can be determined as the target object in the image to be detected.
[0068] It can be seen that the embodiment of the present application also provides a method for determining the target object in the image to be detected by using the coordinate information of the target object, and this method can also effectively determine the target object in the image to be detected.
[0069] It should be noted that the target object detection method provided in the embodiment of the present application can be applied to the detection of a single target object. For example, the target object detection method can be specifically targeted at the detection of the thumb fingertip, where the thumb fingertip is the only output target object. For another example, the target object detection method can also be specifically targeted at the detection of the human pelvis, where the human pelvis is the only output target object.
[0070] In addition, the target object detection method provided in the embodiment of the present application can also be applied to the detection of multiple target objects. For example, the target object detection method can simultaneously output the detection results of 21 joints of the hand, and the 21 joints are different target objects in the image to be detected.
[0071] When the target object detection method is applicable to the detection of multiple target objects, each heat map includes the detection results of M target objects in the image to be detected; each heat map is formed by superimposing M sub-heat maps, and each sub-heat map includes the detection result of a target object in the image to be detected; the detection result in each sub-heat map includes a confidence parameter for each area; the confidence parameter is used to characterize the confidence that the area includes the target object; each sub-heat map is used to determine the area with the largest confidence parameter as including the target object.
[0072] Correspondingly, the above step 103 determines the target object in the image to be detected based on N heat maps, including: obtaining confidence parameters corresponding to M target objects in each heat map; comparing the confidence parameters corresponding to the same target objects in the N heat maps, and determining the target object corresponding to the largest confidence parameter among the same target objects as a target object in the image to be detected, so as to obtain M target objects in the image to be detected.
[0073] Among them, M can be determined according to needs. For example, when it is necessary to output the detection results of 21 joints of the hand, M can be 21.
[0074] It can be understood that each upsampling layer outputs a sub-heat map for each target object separately, and then the sub-heat maps are superimposed to obtain a heat map including M target objects. Then, the confidence parameters of the same target objects in the N heat maps are compared, and finally the detection results of the M target objects in the image to be detected can be obtained.
[0075] Exemplarily, assuming that the target objects include target object A, target object B, and target object C, each upsampling layer outputs a sub-heat map for detecting target object A, a sub-heat map for detecting target object B, and a sub-heat map for detecting target object C. Then, the three sub-heat maps are superimposed to obtain a heat map containing the detection results of target object A, target object B, and target object C. Next, the heat maps output by each upsampling layer are compared, and the comparison process is a comparison for the same target object. That is, the confidence parameters corresponding to target object A in each heat map are compared, and the target object A corresponding to the maximum confidence parameter is determined as the target object A in the image to be detected; the confidence parameters corresponding to target object B in each heat map are compared, and the target object B corresponding to the maximum confidence parameter is determined as the target object B in the image to be detected; the confidence parameters corresponding to target object C in each heat map are compared, and the target object C corresponding to the maximum confidence parameter is determined as the target object C in the image to be detected. Finally, the detection results of target object A, target object B, and target object C in the image to be detected can be obtained.
[0076] In one embodiment, the detection model is a hand joint detection model, and step 102 inputs the image to be detected into a pre-trained detection model to obtain N heat maps, including: inputting the image to be detected into the hand joint detection model to obtain N heat maps; wherein each heat map includes a confidence parameter for each area in the heat map, and the confidence parameter represents the confidence that the area includes a hand joint; wherein the hand joint is the target object.
[0077] Correspondingly, the above step 103 determines the target object in the image to be detected based on the N heat maps, including: determining the hand joint points in the image to be detected based on the N heat maps.
[0078] In one embodiment, N is three, that is, when designing the model, three upsampling layers can be triggered to output three heat maps.
[0079] It can be understood that in the process of hand joint point detection, the results of the three heat map outputs are used to determine the hand joint point detection results in the image to be detected, which will not increase the complexity of the model too much and can ensure the accuracy of the output results.
[0080] The model structure of the detection model is described below.
[0081] In the embodiment of the present application, the detection model can be an hourglass network structure or a U-shaped structure.
[0082] In one embodiment, the N upsampling layers in the detection model are in a sequentially connected structure.
[0083] See also Figure 7The model structure of a detection model shown in the figure includes five feature extraction layers in the first half of the detection model and four upsampling layers in the second half of the detection model. The N upsampling layers in the detection model are the last three upsampling layers connected in sequence. The last three upsampling layers connected in sequence are used to output heatmaps heatmap1, heatmap2 and heatmap3 respectively.
[0084] In one embodiment, the N upsampling layers in the detection model may be in an interval relationship.
[0085] See also Figure 8 The model structure of a detection model shown in the figure includes five feature extraction layers in the first half of the model and four upsampling layers in the second half of the model. The N upsampling layers in the detection model are two upsampling layers arranged at intervals among the four upsampling layers. The two upsampling layers arranged at intervals are used to input heatmaps heatmap1 and heatmap2 respectively.
[0086] Of course, in other embodiments, the connection relationship of the N upsampling layers can also be set according to requirements. In order to restore the size of the image to be detected, the N upsampling layers can at least include the last upsampling layer in the detection model.
[0087] In summary, since the occluded area requires a larger receptive field, and as the feature size of the second half of the model structure is enlarged, the effective receptive field that the model can see will decrease layer by layer. When the last layer output is reached, the effective receptive field is already very small. For the detection of target objects in the occluded area, a larger effective receptive field is required to detect the specific position and category of the currently occluded target object point from the surrounding features.
[0088] Therefore, in the embodiment of the present application, the features when the effective receptive field of the second half of the model structure has not yet reached the minimum are combined, and a rough estimate of the position of the target object is output from these features. Since these features have a large effective receptive field, the occlusion in these layers will reduce the hindrance to model training. That is, for the detection of target objects in unobstructed areas, the positioning accuracy of the heat map closer to the back is higher and the confidence score is higher; for the detection of target objects in obscured areas, the positioning accuracy of the heat map closer to the front (the larger the effective receptive field) is not very high, but it is easier to detect the information of the obscured area and obtain a higher confidence score. Therefore, the heat maps with different effective receptive fields are integrated as the final detection result. In this way, effective and accurate detection of the target object can be achieved when there is occlusion in the area where the target object is located. At the same time, the training difficulty of the detection model can be reduced without providing a large number of sample images in the presence of occlusion.
[0089] Further references Fig. 9As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a target object detection device. Figure 1 Corresponding to the target object detection method embodiment shown, the device can be specifically applied to various electronic devices.
[0090] like Fig. 9 As shown, the target object detection device of this embodiment includes: an acquisition unit 901, which is used to acquire an image to be detected. A detection unit 902, which is used to input the image to be detected into a pre-trained detection model to obtain N heat maps; wherein the N heat maps are respectively output by N upsampling layers of the detection model, and each of the upsampling layers outputs a heat map; N is a positive integer greater than or equal to 2. A determination unit 903, which is used to determine the target object in the image to be detected based on the N heat maps.
[0091] In some embodiments, each of the heat maps includes a confidence parameter for each region in the heat map; the confidence parameter represents the confidence that the region includes the target object.
[0092] In some embodiments, the determination unit 903 is further specifically used to obtain the confidence parameters corresponding to each area in the N heat maps; compare the confidence parameters corresponding to each area in the N heat maps, and determine the area corresponding to the largest confidence parameter as including the target object in the image to be detected.
[0093] In some embodiments, the device further includes an adjustment unit. The adjustment unit is used to adjust the size of the N heat maps to be the same as the size of a target heat map before obtaining the confidence parameter corresponding to each area in the N heat maps; wherein the target heat map is the heat map output by the last upsampling layer in the N upsampling layers.
[0094] In some embodiments, each of the heat maps includes detection results for M target objects in the image to be detected; each of the heat maps is formed by superimposing M sub-heat maps, and each of the sub-heat maps includes detection results for a target object in the image to be detected; the detection results in each of the sub-heat maps include a confidence parameter for each region; the confidence parameter is used to characterize the confidence that the region includes the target object; each of the sub-heat maps is used to determine the region with the largest confidence parameter as including the target object. Correspondingly, the determination unit 903 is also specifically used to obtain confidence parameters corresponding to the M target objects in each of the heat maps; compare the confidence parameters corresponding to the same target object in the N heat maps, and determine the target object corresponding to the largest confidence parameter among the same target objects as a target object in the image to be detected, so as to obtain the M target objects in the image to be detected.
[0095] In some embodiments, the detection model is a hand joint detection model; the detection unit 902 is further specifically used to input the image to be detected into the hand joint detection model to obtain the N heat maps; wherein each of the heat maps includes a confidence parameter for each region in the heat map, and the confidence parameter represents the confidence that the region includes a hand joint; the hand joint is the target object. Correspondingly, the determination unit 903 is further specifically used to determine the hand joint in the image to be detected based on the N heat maps.
[0096] In some embodiments, each of the heat maps includes coordinate information of the target object detected by the heat map; the determination unit 903 is also specifically used to obtain coordinate information corresponding to the target object in each of the heat maps, and determine the target object with the most matching coordinate information as the target object in the image to be detected.
[0097] In some embodiments, the N upsampling layers in the detection model are in a sequentially connected structure.
[0098] Please refer to Fig.10 , Fig.10 An exemplary system architecture is shown in which the target object detection method according to an embodiment of the present disclosure can be applied.
[0099] like Fig.10 As shown, the system architecture may include terminal devices 1001, 1002, 1003, a network 1004, and a server 1005. The network 1004 may be used to provide a medium for a communication link between the terminal devices 1001, 1002, 1003 and the server 1005. The network 1004 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0100] The terminal devices 1001, 1002, and 1003 can interact with the server 1005 through the network 1004 to receive or send messages, etc. Various client applications, such as web browser applications, search applications, and news information applications, can be installed on the terminal devices 1001, 1002, and 1003. The client applications in the terminal devices 1001, 1002, and 1003 can receive user instructions and perform corresponding functions according to the user instructions.
[0101] Terminal devices 1001, 1002, 1003 can be hardware or software. When terminal devices 1001, 1002, 1003 are hardware, they can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Compression Standard Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) players, laptop computers and desktop computers, etc. When terminal devices 1001, 1002, 1003 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0102] The server 1005 may be a server that provides various services, such as receiving information acquisition requests sent by the terminal devices 1001, 1002, and 1003, acquiring display information corresponding to the information acquisition requests in various ways according to the information acquisition requests, and sending the relevant data of the display information to the terminal devices 1001, 1002, and 1003.
[0103] It should be noted that the target object detection method provided in the embodiment of the present disclosure can be executed by a terminal device, and accordingly, the target object detection device can be set in the terminal devices 1001, 1002, and 1003. In addition, the target object detection method provided in the embodiment of the present disclosure can also be executed by a server 1005, and accordingly, the target object detection device can be set in the server 1005.
[0104] It should be understood that Fig.10 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0105] Reference below Fig.11 , which shows an electronic device (eg, Fig.10 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.11The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0106] like Fig.11 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage device 1108 to a random access memory (RAM) 1103. In RAM 1103, various programs and data required for the operation of the electronic device are also stored. The processing device 1101, ROM 1102, and RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0107] Typically, the following devices may be connected to the I / O interface 1105: input devices 1106 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 1107 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1108 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1109. The communication devices 1109 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Fig.11 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0108] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1109, or installed from the storage device 1108, or installed from the ROM 1102. When the computer program is executed by the processing device 1101, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0109] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0110] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0111] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0112] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains the image to be detected; inputs the image to be detected into a pre-trained detection model to obtain N heat maps; wherein the N heat maps are respectively output by N upsampling layers of the detection model, and each of the upsampling layers outputs a heat map; N is a positive integer greater than or equal to 2; based on the N heat maps, determine the target object in the image to be detected.
[0113] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0114] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0115] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the acquisition unit 901 may also be described as a "unit for acquiring an image to be detected."
[0116] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0117] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0118] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0119] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0120] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A target object detection method, characterized in that: include: Acquire the image to be detected; Input the image to be detected into a pre-trained detection model to obtain N heat maps; wherein the N heat maps are respectively output by N upsampling layers of the detection model, and each upsampling layer outputs a heat map; N is a positive integer greater than or equal to 2; Based on the N heat maps, a target object in the image to be detected is determined.
2. The method according to claim 1, characterized in that Each of the heat maps includes a confidence parameter for each region in the heat map; the confidence parameter represents the confidence that the region includes the target object.
3. The method according to claim 2, characterized in that The step of determining the target object in the image to be detected based on the N heat maps includes: Obtaining the confidence parameter corresponding to each region in the N heat maps; The confidence parameters corresponding to each region in the N heat maps are compared, and the region corresponding to the largest confidence parameter is determined to include the target object in the image to be detected.
4. The method according to claim 3, characterized in that Before obtaining the confidence parameter corresponding to each area in the N heat maps, the method further includes: The sizes of the N heat maps are adjusted to be the same as the size of a target heat map; wherein the target heat map is a heat map output by the last upsampling layer among the N upsampling layers.
5. The method according to claim 1, characterized in that Each of the heat maps includes detection results of M target objects in the image to be detected; each of the heat maps is formed by superimposing M sub-heat maps, and each of the sub-heat maps includes a detection result of a target object in the image to be detected; the detection results in each of the sub-heat maps include a confidence parameter for each area; the confidence parameter is used to characterize the confidence that the area includes the target object; each of the sub-heat maps is used to determine the area with the largest confidence parameter as including the target object; The step of determining the target object in the image to be detected based on the N heat maps includes: Obtain confidence parameters corresponding to the M target objects in each of the heat maps; Compare the confidence parameters corresponding to the same target objects in the N heat maps, and determine the target object corresponding to the largest confidence parameter among the same target objects as a target object in the image to be detected, so as to obtain M target objects in the image to be detected.
6. The method according to any one of claims 1 to 5, characterized in that The detection model is a hand joint point detection model; The image to be detected is input into a pre-trained detection model to obtain N heat maps, including: Inputting the image to be detected into the hand joint point detection model to obtain the N heat maps; wherein each of the heat maps includes a confidence parameter of each area in the heat map, and the confidence parameter represents the confidence that the area includes a hand joint point; the hand joint point is the target object; The step of determining the target object in the image to be detected based on the N heat maps includes: Based on the N heat maps, the hand joint points in the image to be detected are determined.
7. The method according to claim 1, characterized in that Each of the heat maps includes coordinate information of the detected target object; The step of determining the target object in the image to be detected based on the N heat maps includes: The coordinate information corresponding to the target object in each of the heat maps is obtained, and the target object with the most matching coordinate information is determined as the target object in the image to be detected.
8. The method according to claim 1, characterized in that The N upsampling layers in the detection model are in a sequentially connected structure.
9. A target object detection device, characterized in that: include: An acquisition unit, used for acquiring an image to be detected; A detection unit, used for inputting the image to be detected into a pre-trained detection model to obtain N heat maps; wherein the N heat maps are respectively output by N upsampling layers of the detection model, and each upsampling layer outputs a heat map; N is a positive integer greater than or equal to 2; A determination unit is used to determine the target object in the image to be detected based on the N heat maps.
10. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Equipment detection system based on multispectral images
CN112381784A
Expressway foreign matter recognition method and system based on deep learning target detection
CN112560693A
Image processing method and related device
CN113421196A
Artificial intelligence-based vehicle information image processing method, device and electronic equipment
CN113963060A
Target detection method and device, equipment and storage medium
CN114663671A
