Image processing method and electronic device
By combining foreground and background segmentation features and skeleton structure features in image processing, artificial intelligence models are used to identify key points of objects such as the human body, which solves the problem of low detection accuracy in complex scenes and achieves more accurate key point identification and posture estimation. .
Patent Information
- Application Number
- CN202011263362.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-12
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-11-12
AI Technical Summary
In complex scenes, the accuracy of key point detection of objects such as the human body is not high, and it is easy to identify the image background as key points of the object, especially recognition errors caused by the key points being occluded, the background being complex, or the texture and color of the foreground being close.
By extracting the foreground segmentation features of the target object and the background part in the image and the skeletal structure features of the target object, we use the segmentation network, pose estimation network and fusion module in the artificial intelligence model to perform feature fusion, generate high-level semantic features and determine the importance information. , thereby identifying multiple key points and avoiding misidentification of the background as key points.
It improves the detection accuracy of key points in pose estimation of objects such as the human body, ensuring that the target object and the background can be accurately distinguished in complex scenes, and key points can be accurately identified to avoid misidentification of the background.
Smart Images

Figure CN112381837B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing, and in particular, relates to an image processing method and electronic equipment. Background Art
[0002] The pose estimation of objects such as human bodies involves the detection of key points of objects such as human bodies in images. When using a trained pose estimation model to detect key points of objects in images with complex scenes / backgrounds, the key point detection accuracy may be low due to partial occlusion of the key points of the object in the image, complex image background, or high similarity in texture and color between the foreground and background. This may result in a phenomenon in which a certain area in the image background is identified as the key point of the object. Summary of the invention
[0003] In view of this, the present application provides an image processing method and an electronic device, the purpose of which is to assist in the detection of key points of the object by utilizing the segmentation information of the foreground object such as the human body and the background part in the image, so as to achieve the purpose of improving the detection accuracy of key points in the posture estimation of objects such as the human body.
[0004] To this end, this application discloses the following technical solutions:
[0005] An image processing method, comprising:
[0006] Obtaining a target image to be processed;
[0007] Extracting foreground-background segmentation features between a target object and a background portion in the target image;
[0008] Extracting skeleton structure features of a target object in the target image;
[0009] According to the foreground and background segmentation features and the skeleton structure features, multiple key points of the target object in the target image are identified to obtain multiple key point information that can be used to estimate the posture of the target object.
[0010] Optionally, extracting foreground-background segmentation features between a target object and a background portion in the target image and extracting skeleton structure features of the target object in the target image includes:
[0011] Using the backbone network in the constructed artificial intelligence model, extracting predetermined low-level semantic features of the target image;
[0012] Using a segmentation network in the artificial intelligence model, converting the predetermined low-level semantic features into first high-level semantic features including foreground-background segmentation features between a target object and a background portion in the target image;
[0013] The predetermined low-level semantic features are converted into second high-level semantic features including skeleton structure features of the target object in the target image by using a posture estimation network in the artificial intelligence model.
[0014] Optionally, identifying a plurality of key points of the target object in the target image according to the foreground and background segmentation features and the skeleton structure features includes:
[0015] Using a fusion module in the artificial intelligence model, the first high-level semantic feature and the second high-level semantic feature are fused to obtain a fused high-level semantic feature, and importance information corresponding to each feature in the fused high-level semantic feature is determined;
[0016] Using a post-processing network in the artificial intelligence model, the fused high-level semantic features are deformed to obtain a predetermined number of heat maps according to the importance information corresponding to each feature in the fused high-level semantic features; wherein different heat maps correspond to different designated parts of the target object, each heat map includes a plurality of candidate key points corresponding to the corresponding designated parts, and each candidate key point corresponds to a confidence information;
[0017] The candidate key points that meet the confidence condition are selected from each heat map as the key points of the corresponding designated part corresponding to the heat map.
[0018] Optionally, determining the importance information corresponding to each feature in the fused high-level semantic features includes:
[0019] According to the attention mechanism, the importance of each feature in the fused high-level semantic features is determined, and weight information indicating the corresponding importance is assigned to each feature; different weight information represents different importance information.
[0020] Optionally, selecting candidate key points satisfying the confidence condition from each heat map as key points of the corresponding designated part corresponding to the heat map includes:
[0021] The candidate key point with the largest confidence value is selected from each heat map as the key point of the corresponding designated part corresponding to the heat map.
[0022] Optionally, before obtaining the target image to be processed, the method further includes: constructing an artificial intelligence model;
[0023] The construction process of the artificial intelligence model includes:
[0024] Training a segmentation model based on foreground-background images obtained by performing foreground-background segmentation on a plurality of sample images and foreground-background information respectively annotated on the foreground-background images;
[0025] Posture estimation training is performed based on the segmentation model to obtain the artificial intelligence model.
[0026] Optional, where:
[0027] The segmentation model includes a backbone network and a segmentation network; the backbone network is used to extract predetermined low-level semantic features of the image, and the segmentation network is used to convert the predetermined low-level semantic features into first high-level semantic features including foreground-background segmentation features between the foreground object and the background part in the image;
[0028] The step of performing posture estimation training on the basis of the segmentation model to obtain the artificial intelligence model comprises:
[0029] A pre-trained posture estimation network is used to receive predetermined low-level semantic features of the sample image output by the backbone network, and the predetermined low-level semantic features are converted into second high-level semantic features including skeleton structure features of the foreground object in the sample image, and output; the posture estimation network is pre-trained based on multiple sample images and key point information respectively annotated for the foreground objects in the multiple sample images.
[0030] Using a fusion module to fuse the first high-level semantic feature of the sample image output by the segmentation network and the second high-level semantic feature of the sample image output by the posture estimation network to obtain fused high-level semantic features, and determine the importance information corresponding to each feature in the fused high-level semantic features;
[0031] Using a post-processing network, according to the importance information corresponding to each feature in the fused high-level semantic features, the fused high-level semantic features are deformed to obtain a predetermined number of heat maps, and the heat maps are output; different heat maps correspond to different designated parts of the foreground object in the sample image, each heat map includes a plurality of candidate key points corresponding to the corresponding designated parts, and each candidate key point corresponds to a confidence information;
[0032] Determining loss information in posture estimation based on each heat map output by the post-processing network and the heat map obtained in advance based on manual annotation;
[0033] The posture estimation network, the fusion module and the post-processing network are optimized according to the loss information until the optimization target is reached, thereby obtaining the artificial intelligence model composed of the segmentation model, the posture estimation network, the fusion module and the post-processing network.
[0034] An electronic device, comprising:
[0035] A memory for storing at least one set of instructions;
[0036] A processor is used to call and execute the instruction set in the memory, and perform the following operations by executing the instruction set:
[0037] Obtaining a target image to be processed;
[0038] Extracting foreground-background segmentation features between a target object and a background portion in the target image;
[0039] Extracting skeleton structure features of a target object in the target image;
[0040] According to the foreground and background segmentation features and the skeleton structure features, multiple key points of the target object in the target image are identified to obtain multiple key point information that can be used to estimate the posture of the target object.
[0041] Optionally, the processor, in extracting foreground-background segmentation features between a target object and a background portion in the target image and extracting skeleton structure features of the target object in the target image, is specifically configured to:
[0042] Utilizing the backbone network in the constructed artificial intelligence model, predetermined low-level semantic features of the target image are extracted; utilizing the segmentation network in the artificial intelligence model, the predetermined low-level semantic features are converted into first high-level semantic features including foreground-background segmentation features between the target object and the background part in the target image; utilizing the posture estimation network in the artificial intelligence model, the predetermined low-level semantic features are converted into second high-level semantic features including skeleton structure features of the target object in the target image.
[0043] The processor, in terms of identifying a plurality of key points of a target object in the target image according to the foreground and background segmentation features and the skeleton structure features, is specifically configured to:
[0044] Using a fusion module in the artificial intelligence model, the first high-level semantic feature and the second high-level semantic feature are fused to obtain a fused high-level semantic feature, and importance information corresponding to each feature in the fused high-level semantic feature is determined;
[0045] Using a post-processing network in the artificial intelligence model, the fused high-level semantic features are deformed to obtain a predetermined number of heat maps according to the importance information corresponding to each feature in the fused high-level semantic features; wherein different heat maps correspond to different designated parts of the target object, each heat map includes a plurality of candidate key points corresponding to the corresponding designated parts, and each candidate key point corresponds to a confidence information;
[0046] The candidate key points that meet the confidence condition are selected from each heat map as the key points of the corresponding designated part corresponding to the heat map.
[0047] Optionally, the processor, before obtaining the target image to be processed, is further used to: construct an artificial intelligence model;
[0048] The process of the processor constructing the artificial intelligence model includes:
[0049] Training a segmentation model based on foreground-background images obtained by performing foreground-background segmentation on a plurality of sample images and foreground-background information respectively annotated on the foreground-background images;
[0050] Posture estimation training is performed based on the segmentation model to obtain the artificial intelligence model.
[0051] It can be seen that the image processing method and electronic device provided in the embodiments of the present application combine the foreground and background segmentation features between the target object and the background part in the target image and the skeleton structure features of the target object in the target image to perform key point detection on the target object in the target image. That is, it is equivalent to that when the present application detects and identifies multiple key points of the target object in the target image based on the skeleton structure features of the target object, the foreground and background segmentation information of the target object such as the human body and the background part in the target image is used as an auxiliary. In this way, for images with complex scene / background content, the foreground and background segmentation information of the target object and the background part can be used to accurately distinguish the target object from its background part and detect and identify the key points of the target object on this basis, thereby avoiding the phenomenon of identifying a certain area in the image background as the key point of the object, and improving the detection accuracy of key points in the posture estimation of objects such as the human body. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0053] Figure 1 It is a schematic diagram of the prior art's incorrect recognition of key points of corresponding parts of the human body;
[0054] Figure 2 It is a flowchart of an image processing method provided by an embodiment of the present application;
[0055] Figure 3 is another flowchart of the image processing method provided in the embodiment of the present application;
[0056] Figure 4 is a schematic diagram of a network architecture for using a segmentation network to assist in training a posture estimation network provided by an embodiment of the present application;
[0057] Figure 5 is a flowchart of a process for training a posture estimation model based on a segmentation model provided in an embodiment of the present application;
[0058] Figure 6 It is another flowchart of the image processing method provided in the embodiment of the present application;
[0059] Figure 7 This is a schematic diagram of a detection result obtained after performing object key point detection on an image using the image processing method of the present application provided in an embodiment of the present application;
[0060] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0062] When using a trained pose estimation model to detect key points of objects such as human bodies in images in complex scenes, the detection accuracy is usually not high due to reasons such as partial occlusion of the key points, complex background, or similar textures and colors of the foreground and background. Often, a certain area in the background is identified as the key point of the object.
[0063] The inventor has discovered through research that the existing solutions essentially only utilize the foreground information of the image when detecting key points of an object. Taking the human body as an example, only the information on the human body is used to detect key points. However, the accuracy is difficult to guarantee in an environment where the foreground and background are similar due to the above reasons. In addition, parts such as the shoulders and hips of the human body do not have obvious features, and it is difficult to accurately identify their key points only through foreground information.
[0064] For example, see Figure 1 , provides an example of incorrect recognition of key points of human shoulders and other parts. Due to the complex background and the texture and color similar to those of the shoulders and other parts, it interferes with the model recognition.
[0065] Therefore, the present application provides an image processing method and an electronic device for at least solving the above-mentioned technical problems, by utilizing the segmentation information of foreground objects such as human bodies and background parts in the image to assist in the detection of key points of the object, thereby achieving the purpose of improving the detection accuracy of key points in the posture estimation of objects such as human bodies.
[0066] See also Figure 2 , which is a flow chart of an image processing method provided in an optional embodiment of the present application. The method can be applied to but not limited to terminal devices such as mobile phones, tablet computers, personal PCs (such as notebooks, all-in-one computers, desktop computers) with image processing functions, or physical machines corresponding to private cloud / public cloud platforms, service nodes, etc. with image processing functions.
[0067] like Figure 2 As shown, the image processing method of this embodiment may include the following processing steps:
[0068] Step 201: Obtain a target image to be processed.
[0069] The target image to be processed can be an image in a scene of object posture estimation of a human body, etc., in which key point detection of the target object is to be performed to achieve posture estimation. Specifically, it can be at least one image of the target object collected in real time, such as a series of human body images collected in real time by a camera, etc., or it can be at least one image of the target object that has been collected and stored in history, but is not limited to this. It can also be an image from the network, and this embodiment does not impose any restrictions on this.
[0070] Step 202: extracting foreground and background segmentation features between the target object and the background part in the target image.
[0071] The target object refers to the object in the foreground of the image for which key points are to be detected and posture estimated based on this. Typically, it can be a foreground object such as a human body, an animal, or a drone.
[0072] When performing key point detection on a target object in a target image, the embodiment of the present application extracts foreground and background segmentation features between the target object and the background part in the target image, and introduces the extracted foreground and background segmentation features as auxiliary information into the key point recognition of the target object. After adding the foreground and background segmentation features, not only the information on the target object (such as a human body) (i.e., foreground information) can be used to detect key points, but also the background information can be used, and in particular, the foreground and background segmentation features that can effectively distinguish and segment the foreground information from the background information can be used, so as to improve the key point / feature point detection accuracy when the foreground and background are similar.
[0073] Step 203: extract skeleton structure features of the target object in the target image.
[0074] The skeleton structure feature of the target object is the skeleton relationship, structural relationship or positional relationship feature between different parts / components of the target object reflected in the foreground part corresponding to the target object in the target image.
[0075] Taking the target object as a human body as an example, the skeleton structure characteristics of the target object may include but are not limited to the skeleton relationship, structural relationship and / or position relationship characteristics between different parts of the human body such as eyes, nose, mouth, shoulders, hips, limbs, etc.
[0076] The essential purpose of extracting the skeleton structure features of the target object in the target image is to use the information of the target object itself (such as information on the human body) to detect key points.
[0077] Step 204: Identify multiple key points of the target object in the target image based on the foreground and background segmentation features and the skeleton structure features, and obtain multiple key point information that can be used to estimate the posture of the target object.
[0078] It can be seen from the above scheme that the image processing method provided in the embodiment of the present application combines the foreground and background segmentation features between the target object and the background part in the target image and the skeleton structure features of the target object in the target image to perform key point detection on the target object in the target image. That is, it is equivalent to that when the present application detects and identifies multiple key points of the target object in the target image based on the skeleton structure features of the target object, the foreground and background segmentation information of the target object such as the human body and the background part in the target image is used as an auxiliary. In this way, for images with complex scene / background content, the foreground and background segmentation information of the target object and the background part can be used to accurately distinguish the target object from its background part and detect and identify the key points of the target object on this basis, thereby avoiding the phenomenon of identifying a certain area in the image background as the key point of the object, and improving the detection accuracy of key points in the posture estimation of objects such as the human body.
[0079] Optionally, in order to address the problem of inaccurate key point detection of target objects caused by foreground and background problems, the embodiments of the present application specifically propose a strategy and training framework for utilizing the foreground and background segmentation information of foreground objects and background parts to assist the training process of the posture estimation network used for key point detection, and on this basis, utilize the posture estimation model (i.e., an artificial intelligence model) obtained by combining the foreground and background segmentation information to assist in the training, to perform key point detection of the target object in the target image, so as to provide a basis for posture estimation of the target object.
[0080] Hence, see Figure 3 FIG. 2 is a flow chart of an image processing method shown in FIG. 1 . In this embodiment, before step 201, the image processing method may further include:
[0081] Step 201': construct an artificial intelligence model.
[0082] The artificial intelligence model is a posture estimation model obtained by combining the foreground-background segmentation information between the foreground object and the background part in the image to assist the training process of the posture estimation model used for key point detection.
[0083] Based on the auxiliary training strategy, the construction process of the artificial intelligence model may include:
[0084] 1) training a segmentation model based on foreground and background images obtained by performing foreground and background segmentation on a plurality of sample images and foreground and background information respectively annotated on the foreground and background images;
[0085] Specifically, Figure 4 The training framework shown in the figure, the segmentation model obtained by training includes two parts: the backbone network backbone and the segmentation network SegNet.
[0086] The backbone network is used to extract predetermined low-level semantic features of the image, which may include but are not limited to a series of mathematical representation features in terms of color, texture, grayscale / brightness, etc. in the image.
[0087] The segmentation network is used to convert the predetermined low-level semantic features extracted by the backbone network into the first high-level semantic features including the foreground-background segmentation features between the foreground object and the background part in the image, which may include but are not limited to mathematical representation features based on the color, texture, grayscale / brightness, etc. in the image, and further obtain mathematical representation features at the regional segmentation level for different foreground and background areas in the image.
[0088] In the training process of the segmentation model, the loss information of the segmentation model in the image segmentation process is calculated based on the difference between the foreground and background segmentation results output by the model for processing a series of image samples and the foreground and background information manually annotated on the foreground and background images of the series of sample images, such as Figure 4 Loss in seg , and based on the loss information loss seg , optimize the segmentation model until the optimization target is reached (such as the loss value is lower than the threshold set for the segmentation model), and the training of the segmentation model is completed.
[0089] In implementation, the segmentation network SegNet can be any type of segmentation network, for example, a fully convolutional neural network (FCN), a convolutional neural network for medical image segmentation (U-net), a deep supervised network (DSN), and the like.
[0090] 2) Performing posture estimation training based on the segmentation model to obtain the artificial intelligence model.
[0091] The process of further performing posture estimation training on the basis of the segmentation model to obtain an artificial intelligence model is as follows: Figure 5 As shown, it may specifically include:
[0092] Step 501: using a pre-trained posture estimation network to receive predetermined low-level semantic features of the sample image output by the backbone network, converting the predetermined low-level semantic features into second high-level semantic features including skeleton structure features of the foreground object in the sample image, and outputting the second high-level semantic features;
[0093] The posture estimation network is pre-trained based on a plurality of sample images and key point information respectively annotated on foreground objects in the plurality of sample images.
[0094] The foreground object may be, for example, a human body or the like.
[0095] Figure 4 PoseNet in the figure represents the pose estimation network. The pose estimation network PoseNet and the segmentation network SegNet share the backbone network backbone, and the pose estimation network PoseNet and the segmentation network SegNet serve together as Figure 4 The head network part of the model architecture of the entire pose estimation model is shown.
[0096] The posture estimation network PoseNet receives predetermined low-level semantic features of the sample image output by the backbone network backbone, such as a series of mathematical representation features in terms of color, texture, grayscale / brightness, etc., converts the predetermined low-level semantic features into second-level semantic features including skeleton structural features of the foreground object in the sample image and outputs them. The second-level semantic features may include but are not limited to skeleton relationship, structural relationship or position relationship features between different parts / different components of the foreground object in the sample image, such as skeleton relationship, structural relationship and / or position relationship features between different parts of a person's eyes, nose, mouth, shoulders, hips, limbs, etc.
[0097] In implementation, the pose estimation network PoseNet may be any type of pose estimation network, for example, OpenPose, DeepCut, RMPE (Regional Multi-Person Pose Estimation), and the like.
[0098] Step 502: Use a fusion module to fuse the first high-level semantic features of the sample image output by the segmentation network and the second high-level semantic features of the sample image output by the posture estimation network to obtain fused high-level semantic features, and determine the importance information corresponding to each feature in the fused high-level semantic features.
[0099] The fusion module performs fusion processing on the first high-level semantic feature and the second high-level semantic feature, specifically, performs a concat operation on each feature in the first high-level semantic feature and each feature in the second high-level semantic feature. Figure 4 Specific use in Represents the operation through which the fused high-level semantic features are obtained.
[0100] Afterwards, the importance information corresponding to each feature in the fused high-level semantic features is determined.
[0101] Optional, such as Figure 4 As shown, specifically, according to the attention mechanism, the importance of each feature in the fused high-level semantic features can be screened to determine the importance of each feature, enhance the important features, and weaken the unimportant features. On this basis, each feature is assigned weight information indicating the corresponding importance, so as to represent different importance information based on different weight information.
[0102] Afterwards, each high-level semantic feature carrying importance information (such as weight) is input into the post-processing network, such as Figure 4 RefineNet shown in .
[0103] Step 503: using a post-processing network, according to the importance information corresponding to each feature in the fused high-level semantic features, deform the fused high-level semantic features to obtain a predetermined number of heat maps, and output them.
[0104] The post-processing network RefineNet includes multiple convolutional layers (conv layers), the purpose of which is to fuse and transform the high-level semantic features output by the fusion module that carry importance information (such as weights) into a predetermined number of heat maps, where different heat maps correspond to different specified parts of the foreground object in the sample image, such as the human eye, nose, shoulder, hip, limbs, etc. Each heat map includes multiple candidate key points corresponding to the corresponding specified parts, and each candidate key point corresponds to a confidence information.
[0105] Step 504: Determine loss information in posture estimation based on each heat map output by the post-processing network and the heat map obtained in advance based on manual annotation.
[0106] Step 505: Optimize the posture estimation network, the fusion module and the post-processing network according to the loss information until the optimization target is reached, thereby obtaining the artificial intelligence model composed of the segmentation model, the posture estimation network, the fusion module and the post-processing network.
[0107] In the right Figure 4When the overall network architecture of the artificial intelligence model (pose estimation model) pointed out is trained, first only the segmentation model branch is trained, that is, the Beckbone+SegNet part. After the segmentation model training is completed, other branches in the network architecture are further trained, that is, the PoseNet+fusion module+RefineNet part. The branch composed of the PoseNet+fusion module+RefineNet part is the pose estimation branch in the overall network architecture (it is easy to understand that the foreground and background segmentation information of the image is integrated into the pose estimation branch as auxiliary information for pose estimation). Based on this, after obtaining the various heat maps output by the post-processing network, the loss information of the pose estimation branch in the pose estimation can be further calculated according to the difference between the various heat maps output by the post-processing network and the heat maps obtained in advance based on manual annotation, such as Figure 4 The Loss shown in pose , and according to the loss information Loss pose The network part of the posture estimation branch is optimized until the optimization goal is reached. If the loss value is lower than the threshold set for the branch, the construction of the artificial intelligence model is completed. The constructed artificial intelligence model specifically includes an overall network architecture consisting of the segmentation model (Beckbone+SegNet), the posture estimation network, the fusion module and the post-processing network.
[0108] In implementation, Figure 4 The network architecture of the artificial intelligence model shown in the figure can be specifically set with the following loss value calculation formula:
[0109] Loss = α*loss seg +loss pose ;
[0110] Among them, loss seg is the loss of the segmentation network branch, loss pose is the loss of the pose estimation branch, and α is a preset coefficient, which is generally set to a smaller value.
[0111] Based on the above calculation formula, during the training process of different network branches, the network optimization of the corresponding branches is performed based on the corresponding loss values.
[0112] On the basis of constructing the artificial intelligence model (the posture estimation model combined with segmentation information), see Figure 6 The flowchart of the image processing method shown can further implement the image processing method of the present application into the following processing process based on the constructed artificial intelligence model:
[0113] Step 601: Obtain a target image to be processed.
[0114] Step 602: Utilize the backbone network in the constructed artificial intelligence model to extract predetermined low-level semantic features of the target image.
[0115] Specifically, it can be used Figure 4 The backbone network Beckbone in the network architecture shown extracts the skeleton relationship, structural relationship or positional relationship features between different parts / different components of the target object in the target image, such as extracting the skeleton relationship, structural relationship and / or positional relationship features between different parts of a person's eyes, nose, mouth, shoulders, hips, limbs, etc.
[0116] Step 603: Using the segmentation network in the artificial intelligence model, the predetermined low-level semantic features are converted into first high-level semantic features including foreground-background segmentation features between the target object and the background part in the target image.
[0117] Afterwards, the segmentation network SegNet is used to convert the above-mentioned low-level semantic features output by the backbone network Beckbone into the first high-level semantic features including the foreground-background segmentation features between the target object and the background part in the target image, such as the mathematical representation features of the color, texture, grayscale / brightness, etc. in the target image, and the mathematical representation features at the regional segmentation level for different foreground and background areas in the image are further obtained.
[0118] Step 604: Using the posture estimation network in the artificial intelligence model, the predetermined low-level semantic features are converted into second high-level semantic features including skeleton structure features of the target object in the target image.
[0119] At the same time, the posture estimation network PoseNet converts the above-mentioned low-level semantic features output by the backbone network Beckbone into second-level semantic features including the skeleton structure features of the target object in the target image, such as the skeleton relationship, structural relationship or position relationship features between different parts / different components of the target object in the target image (such as the skeleton relationship, structural relationship and / or position relationship features between different parts of a person's eyes, nose, mouth, shoulders, hips, limbs, etc.), and outputs them to the subsequent fusion module.
[0120] Step 605: Use the fusion module in the artificial intelligence model to fuse the first high-level semantic feature and the second high-level semantic feature to obtain a fused high-level semantic feature, and determine the importance information corresponding to each feature in the fused high-level semantic feature.
[0121] The fusion module concats the first high-level semantic features output by the segmentation network SegNet and the second high-level semantic features output by the posture estimation network PoseNet to achieve feature fusion, and based on the attention mechanism, it screens the importance of each feature in the fused high-level semantic features, determines the importance of each feature, enhances important features, weakens unimportant features, and on this basis assigns weight information to each feature to indicate the corresponding importance; different weight information represents different importance information.
[0122] Afterwards, each high-level semantic feature carrying importance information (such as weight) is input into the post-processing network RefineNet.
[0123] Step 606: using the post-processing network in the artificial intelligence model, according to the importance information corresponding to each feature in the fused high-level semantic features, deform the fused high-level semantic features to obtain a predetermined number of heat maps.
[0124] The post-processing network RefineNet fuses and transforms the high-level semantic features output by the fusion module that carry importance information (such as weights) into a predetermined number of heat maps based on the convolutional layers it includes.
[0125] Different heat maps correspond to different designated parts of the target object in the target image, each heat map includes a plurality of candidate key points corresponding to the corresponding designated parts, and each candidate key point corresponds to a confidence information.
[0126] Step 607: Select candidate key points that meet the confidence condition from each heat map as the key points of the corresponding designated part corresponding to the heat map.
[0127] Finally, candidate key points that meet the confidence conditions are selected from each heat map as the key points of the corresponding specified part corresponding to the heat map. For example, candidate key points that meet the confidence conditions are selected from the heat maps corresponding to different parts of the human body, such as the nose, eyes, shoulders, hips, limbs, etc., and used as the key points of different parts of the human body, etc., and correspondingly multiple key point information that can be used to estimate the posture of the target object is obtained.
[0128] Among them, selecting candidate key points that meet the confidence conditions from each heat map as the key points of the corresponding designated part corresponding to the heat map can be, but is not limited to: selecting candidate key points with the largest confidence value from each heat map as the key points of the corresponding designated part corresponding to the heat map.
[0129] The multiple key point information finally obtained that can be used to estimate the posture of the target object may include but is not limited to the position information corresponding to each key point and the corresponding confidence information. The confidence information corresponding to the key point is used to indicate the probability that the key point belongs to the key point of the corresponding designated part (such as eyes, nose).
[0130] In the implementation, key points are usually marked at the corresponding positions of the target object in the target image, so that the marked key points have their own position attributes, and at the same time, each marked key point carries a confidence information for it. For details, see Figure 7 As shown, the detection result obtained after performing object key point detection on an image using the image processing method of an embodiment of the present application is provided.
[0131] Jing and Figure 1 By comparing the test results of Figure 7 The detection results shown are more accurate and effectively avoid the phenomenon of identifying a certain area in the image background as an object key point when the foreground and background are similar.
[0132] This embodiment introduces a segmentation network to assist the training process of the posture estimation network, thereby realizing the fusion of the segmentation network with the posture estimation network capable of detecting object key points. Accordingly, in the posture estimation, the foreground and background segmentation information of the foreground object and the background part in the image can be combined to assist the key point detection of the foreground object. In this way, when detecting the key points of the object in the object posture estimation, not only the information on the foreground object (such as the human body) can be used to detect the key points, but also the background information can be used, especially the foreground and background segmentation features that effectively distinguish and segment the foreground information from the background information can be used to assist the key point detection process, thereby effectively improving the accuracy of key point detection when the foreground and background are similar.
[0133] An embodiment of the present application also provides an electronic device, which may be, but is not limited to, a terminal device such as a mobile phone, a tablet computer, a personal PC (such as a notebook, an all-in-one computer, a desktop computer) with an image processing function, or a physical machine corresponding to a private cloud / public cloud platform, a service node, etc. with an image processing function.
[0134] See also Figure 8 The electronic device shown is a schematic diagram of a structure of an electronic device, and the electronic device may include:
[0135] The memory 801 is used to store at least one set of instruction sets.
[0136] The computer instruction set may be implemented in the form of a computer program.
[0137] The memory 801 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0138] The processor 802 is configured to call and execute the instruction set in the memory, and perform the following operations by executing the instruction set:
[0139] Obtaining a target image to be processed;
[0140] Extracting foreground-background segmentation features between a target object and a background portion in the target image;
[0141] Extracting skeleton structure features of a target object in the target image;
[0142] According to the foreground and background segmentation features and the skeleton structure features, multiple key points of the target object in the target image are identified to obtain multiple key point information that can be used to estimate the posture of the target object.
[0143] Among them, the processor 802 can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, etc.
[0144] In addition, the electronic device may also include components such as a communication interface and a communication bus. The memory, the processor and the communication interface communicate with each other through the communication bus.
[0145] The communication interface is used for communication between electronic devices and other devices. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc.
[0146] In an optional implementation of the embodiment of the present application, the processor 802, in extracting the foreground-background segmentation features between the target object and the background part in the target image and extracting the skeleton structure features of the target object in the target image, is specifically configured to:
[0147] Utilizing the backbone network in the constructed artificial intelligence model, predetermined low-level semantic features of the target image are extracted; utilizing the segmentation network in the artificial intelligence model, the predetermined low-level semantic features are converted into first high-level semantic features including foreground-background segmentation features between the target object and the background part in the target image; utilizing the posture estimation network in the artificial intelligence model, the predetermined low-level semantic features are converted into second high-level semantic features including skeleton structure features of the target object in the target image.
[0148] In an optional implementation manner of the embodiment of the present application, the processor 802, in identifying a plurality of key points of the target object in the target image according to the foreground and background segmentation features and the skeleton structure features, is specifically configured to:
[0149] Using a fusion module in the artificial intelligence model, the first high-level semantic feature and the second high-level semantic feature are fused to obtain a fused high-level semantic feature, and importance information corresponding to each feature in the fused high-level semantic feature is determined;
[0150] Using a post-processing network in the artificial intelligence model, the fused high-level semantic features are deformed to obtain a predetermined number of heat maps according to the importance information corresponding to each feature in the fused high-level semantic features; wherein different heat maps correspond to different designated parts of the target object, each heat map includes a plurality of candidate key points corresponding to the corresponding designated parts, and each candidate key point corresponds to a confidence information;
[0151] The candidate key points that meet the confidence condition are selected from each heat map as the key points of the corresponding designated part corresponding to the heat map.
[0152] In an optional implementation of the embodiment of the present application, the processor 802, in determining the importance information corresponding to each feature in the fused high-level semantic feature, is specifically configured to:
[0153] According to the attention mechanism, the importance of each feature in the fused high-level semantic features is determined, and weight information indicating the corresponding importance is assigned to each feature; different weight information represents different importance information.
[0154] In an optional implementation of the embodiment of the present application, the processor 802, in selecting a candidate key point satisfying a confidence condition from each heat map as a key point of a corresponding designated part corresponding to the heat map, is specifically configured to:
[0155] The candidate key point with the largest confidence value is selected from each heat map as the key point of the corresponding designated part corresponding to the heat map.
[0156] In an optional implementation of the embodiment of the present application, the processor 802, before obtaining the target image to be processed, is further used to: construct an artificial intelligence model;
[0157] The construction process of the artificial intelligence model includes:
[0158] Training a segmentation model based on foreground-background images obtained by performing foreground-background segmentation on a plurality of sample images and foreground-background information respectively annotated on the foreground-background images;
[0159] Posture estimation training is performed based on the segmentation model to obtain the artificial intelligence model.
[0160] In an optional implementation of the embodiment of the present application, the segmentation model includes a backbone network and a segmentation network; the backbone network is used to extract predetermined low-level semantic features of the image, and the segmentation network is used to convert the predetermined low-level semantic features into first high-level semantic features including foreground-background segmentation features between the foreground object and the background part in the image;
[0161] The processor 802 performs posture estimation training based on the segmentation model to obtain the artificial intelligence model, specifically for:
[0162] A pre-trained posture estimation network is used to receive predetermined low-level semantic features of the sample image output by the backbone network, and the predetermined low-level semantic features are converted into second high-level semantic features including skeleton structure features of the foreground object in the sample image, and output; the posture estimation network is pre-trained based on multiple sample images and key point information respectively annotated for the foreground objects in the multiple sample images.
[0163] Using a fusion module to fuse the first high-level semantic feature of the sample image output by the segmentation network and the second high-level semantic feature of the sample image output by the posture estimation network to obtain fused high-level semantic features, and determine the importance information corresponding to each feature in the fused high-level semantic features;
[0164] Using a post-processing network, according to the importance information corresponding to each feature in the fused high-level semantic features, the fused high-level semantic features are deformed to obtain a predetermined number of heat maps, and the heat maps are output; different heat maps correspond to different designated parts of the foreground object in the sample image, each heat map includes a plurality of candidate key points corresponding to the corresponding designated parts, and each candidate key point corresponds to a confidence information;
[0165] Determining loss information in posture estimation based on each heat map output by the post-processing network and the heat map obtained in advance based on manual annotation;
[0166] The posture estimation network, the fusion module and the post-processing network are optimized according to the loss information until the optimization target is reached, thereby obtaining the artificial intelligence model composed of the segmentation model, the posture estimation network, the fusion module and the post-processing network.
[0167] For the electronic device disclosed in the embodiment of the present application, since it corresponds to the image processing method disclosed in any of the method embodiments above, the description is relatively simple. For relevant similarities, please refer to the description of the image processing method part in the method embodiments above, which will not be described in detail here.
[0168] In addition, an embodiment of the present application further discloses a computer-readable storage medium, in which a computer instruction set is stored. When the computer instruction set is executed by a processor, the image processing method disclosed in the above method embodiment is implemented.
[0169] When the instructions stored in the computer-readable storage medium are run, the key points of the target object in the target image are detected by combining the foreground and background segmentation features between the target object and the background part in the target image and the skeleton structure features of the target object in the target image. That is, this is equivalent to the application using the foreground and background segmentation information of the target object such as the human body and the background part in the target image as an aid when detecting and identifying multiple key points of the target object in the target image based on the skeleton structure features of the target object. In this way, for images with complex scene / background content, the foreground and background segmentation information of the target object and the background part can be used to accurately distinguish the target object from its background part and detect and identify the key points of the target object on this basis, thereby avoiding the phenomenon of identifying a certain area in the image background as the key point of the object, and improving the detection accuracy of key points in the posture estimation of objects such as the human body.
[0170] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0171] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0172] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0173] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0174] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An image processing method, comprising: Obtaining a target image to be processed; Extracting foreground and background segmentation features between the target object and the background part in the target image, wherein the foreground and background segmentation features at least include: mathematical representation features at the regional segmentation level for different foreground and background regions in the image; Extracting skeleton structure features of a target object in the target image; According to the foreground and background segmentation features and the skeleton structure features, multiple key points of the target object in the target image are identified to obtain multiple key point information that can be used to estimate the posture of the target object.
2. According to the method of claim 1, the step of extracting the foreground-background segmentation features between the target object and the background part in the target image and extracting the skeleton structure features of the target object in the target image comprises: Using the backbone network in the constructed artificial intelligence model, extracting predetermined low-level semantic features of the target image; Using a segmentation network in the artificial intelligence model, converting the predetermined low-level semantic features into first high-level semantic features including foreground-background segmentation features between a target object and a background portion in the target image; The predetermined low-level semantic features are converted into second high-level semantic features including skeleton structure features of the target object in the target image by using a posture estimation network in the artificial intelligence model.
3. The method according to claim 2, wherein the identifying multiple key points of the target object in the target image according to the foreground and background segmentation features and the skeleton structure features comprises: Using a fusion module in the artificial intelligence model, the first high-level semantic feature and the second high-level semantic feature are fused to obtain a fused high-level semantic feature, and importance information corresponding to each feature in the fused high-level semantic feature is determined; Using a post-processing network in the artificial intelligence model, the fused high-level semantic features are deformed to obtain a predetermined number of heat maps according to the importance information corresponding to each feature in the fused high-level semantic features; wherein different heat maps correspond to different designated parts of the target object, each heat map includes a plurality of candidate key points corresponding to the corresponding designated parts, and each candidate key point corresponds to a confidence information; The candidate key points that meet the confidence condition are selected from each heat map as the key points of the corresponding designated part corresponding to the heat map.
4. According to the method of claim 3, determining the importance information corresponding to each feature in the fused high-level semantic features comprises: According to the attention mechanism, the importance of each feature in the fused high-level semantic features is determined, and weight information indicating the corresponding importance is assigned to each feature; different weight information represents different importance information.
5. According to the method of claim 3, the step of selecting candidate key points satisfying the confidence condition from each heat map as key points of the corresponding designated part corresponding to the heat map comprises: The candidate key point with the largest confidence value is selected from each heat map as the key point of the corresponding designated part corresponding to the heat map.
6. The method according to claim 1, before obtaining the target image to be processed, further comprises: Build an artificial intelligence model; The construction process of the artificial intelligence model includes: Training a segmentation model based on foreground-background images obtained by performing foreground-background segmentation on a plurality of sample images and foreground-background information respectively annotated on the foreground-background images; Posture estimation training is performed based on the segmentation model to obtain the artificial intelligence model.
7. The method according to claim 6, wherein: The segmentation model includes a backbone network and a segmentation network; the backbone network is used to extract predetermined low-level semantic features of the image, and the segmentation network is used to convert the predetermined low-level semantic features into first high-level semantic features including foreground-background segmentation features between the foreground object and the background part in the image; The step of performing posture estimation training on the basis of the segmentation model to obtain the artificial intelligence model comprises: Using a pre-trained posture estimation network to receive predetermined low-level semantic features of the sample image output by the backbone network, converting the predetermined low-level semantic features into second high-level semantic features including skeleton structure features of the foreground object in the sample image, and outputting the second high-level semantic features; the posture estimation network is pre-trained based on a plurality of sample images and key point information respectively annotated on the foreground objects in the plurality of sample images; Using a fusion module to fuse the first high-level semantic feature of the sample image output by the segmentation network and the second high-level semantic feature of the sample image output by the posture estimation network to obtain fused high-level semantic features, and determine the importance information corresponding to each feature in the fused high-level semantic features; Using a post-processing network, according to the importance information corresponding to each feature in the fused high-level semantic features, the fused high-level semantic features are deformed to obtain a predetermined number of heat maps, and the heat maps are output; different heat maps correspond to different designated parts of the foreground object in the sample image, each heat map includes a plurality of candidate key points corresponding to the corresponding designated parts, and each candidate key point corresponds to a confidence information; Determining loss information in posture estimation based on each heat map output by the post-processing network and the heat map obtained in advance based on manual annotation; The posture estimation network, the fusion module and the post-processing network are optimized according to the loss information until the optimization target is reached, thereby obtaining the artificial intelligence model composed of the segmentation model, the posture estimation network, the fusion module and the post-processing network.
8. An electronic device comprising: A memory for storing at least one set of instructions; A processor is used to call and execute the instruction set in the memory, and perform the following operations by executing the instruction set: Obtaining a target image to be processed; Extracting foreground and background segmentation features between the target object and the background part in the target image, wherein the foreground and background segmentation features at least include: mathematical representation features at the regional segmentation level for different foreground and background regions in the image; Extracting skeleton structure features of a target object in the target image; According to the foreground and background segmentation features and the skeleton structure features, multiple key points of the target object in the target image are identified to obtain multiple key point information that can be used to estimate the posture of the target object.
9. The electronic device according to claim 8, wherein the processor, in extracting foreground-background segmentation features between the target object and the background portion in the target image and extracting skeleton structure features of the target object in the target image, is specifically configured to: Using the backbone network in the constructed artificial intelligence model, the predetermined low-level semantic features of the target image are extracted; using the segmentation network in the artificial intelligence model, the predetermined low-level semantic features are converted into first high-level semantic features including foreground-background segmentation features between the target object and the background part in the target image; Using a posture estimation network in the artificial intelligence model, converting the predetermined low-level semantic features into second high-level semantic features including skeleton structure features of a target object in the target image; The processor, in terms of identifying a plurality of key points of a target object in the target image according to the foreground and background segmentation features and the skeleton structure features, is specifically configured to: Using a fusion module in the artificial intelligence model, the first high-level semantic feature and the second high-level semantic feature are fused to obtain a fused high-level semantic feature, and importance information corresponding to each feature in the fused high-level semantic feature is determined; Using a post-processing network in the artificial intelligence model, the fused high-level semantic features are deformed to obtain a predetermined number of heat maps according to the importance information corresponding to each feature in the fused high-level semantic features; wherein different heat maps correspond to different designated parts of the target object, each heat map includes a plurality of candidate key points corresponding to the corresponding designated parts, and each candidate key point corresponds to a confidence information; The candidate key points that meet the confidence condition are selected from each heat map as the key points of the corresponding designated part corresponding to the heat map.
10. The electronic device according to claim 8, wherein the processor, before obtaining the target image to be processed, is further used to: construct an artificial intelligence model; in, The process of the processor constructing the artificial intelligence model includes: Training a segmentation model based on foreground-background images obtained by performing foreground-background segmentation on a plurality of sample images and foreground-background information respectively annotated on the foreground-background images; Posture estimation training is performed based on the segmentation model to obtain the artificial intelligence model.
