A method, device, electronic device and storage medium for detecting key points of an image

By combining the method of backbone network, foreground area segmentation sub-network and key point detection sub-network, image features are extracted and foreground area segmentation and dot multiplication operations are performed to generate key point heat maps, which solves the detection error problem of traditional methods in complex backgrounds. , improving the accuracy of image key point detection.

CN114119962BActive Publication Date: 2024-09-17SHENZHEN INST OF ARTIFICIAL INTELLIGENCE & ROBOTICS FOR SOC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111369117.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-18
Publication Date
2024-09-17
Estimated Expiration
2041-11-18

AI Technical Summary

Technical Problem

Traditional image key point detection methods are prone to detection errors in complex backgrounds, resulting in low accuracy.

Method used

Using a detection method including a backbone network, a foreground area segmentation sub-network and a key point detection sub-network, a key point heat map is generated to determine the key points in the image by extracting image features, performing foreground area segmentation and dot multiplication operations.

Benefits of technology

It effectively reduces background interference and improves the accuracy of key point detection, especially the positioning ability under complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119962B
    Figure CN114119962B
Patent Text Reader

Abstract

The present application discloses a method for detecting key points of an image, which is applied to a key point detection model. The key point detection model includes a backbone network, a foreground area segmentation subnetwork and a key point detection subnetwork. The detection method includes: extracting image features of a target image using the backbone network; inputting the image features into the foreground area segmentation subnetwork to obtain a foreground area feature map of the target image; inputting the dot product result of the foreground area feature map and the image features into the key point detection subnetwork to obtain a key point heat map of the target image; determining the key points in the target image according to the key point heat map. The present application can improve the key point detection accuracy. The present application also discloses a device for detecting key points of an image, an electronic device and a storage medium, which have the above beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method, device, electronic device and storage medium for detecting key points of an image. Background Art

[0002] Key point detection is widely used in fields such as face recognition, human posture recognition, visual positioning, and 3D reconstruction. Traditional image processing methods use various manually designed key point detection operators to perform key point detection. This method is often only applicable to certain specific scenarios and lacks generalization. In response to the above defects, related technologies usually detect image key points based on key point coordinate regression methods and methods based on heat map responses. However, when the detection background is complex, the key point detection method based on heat map responses will cause the peak of the heat map to appear in the background area due to background interference during key point detection, which will lead to large detection errors.

[0003] Therefore, how to improve the key point detection accuracy is a technical problem that technicians in this field currently need to solve. Summary of the invention

[0004] The purpose of this application is to provide a method for detecting key points of an image, a device for detecting key points of an image, an electronic device and a storage medium, which can improve the accuracy of key point detection.

[0005] In order to solve the above technical problems, the present application provides a method for detecting key points of an image, which is applied to a key point detection model. The key point detection model includes a backbone network, a foreground area segmentation subnetwork and a key point detection subnetwork. The detection method includes:

[0006] Extracting image features of a target image using the backbone network;

[0007] Inputting the image features into the foreground region segmentation subnetwork to obtain a foreground region feature map of the target image;

[0008] Input the dot product result of the foreground area feature map and the image feature into the key point detection subnetwork to obtain the key point heat map of the target image;

[0009] The key points in the target image are determined according to the key point heat map.

[0010] Optionally, extracting image features of the target image using the backbone network includes:

[0011] The backbone network is used to extract image features of the target image at multiple scales.

[0012] Optionally, inputting the dot product result of the foreground area feature map and the image feature into the key point detection subnetwork includes:

[0013] Select the top N image features with the highest resolution as the target image features;

[0014] The dot product result of the target image feature and the image feature is input into the key point detection subnetwork.

[0015] Optionally, before extracting the image features of the target image using the backbone network, the method further includes:

[0016] Training the key point detection model using a target network loss function;

[0017] Among them, the target network loss function includes the foreground area segmentation sub-network loss function and the key point detection sub-network loss function.

[0018] Optionally, inputting the image features into the foreground region segmentation subnetwork to obtain a foreground region feature map of the target image includes:

[0019] The image features are input into a branch of the foreground area segmentation subnetwork so as to perform convolution calculation operations and feature fusion operations on the image features to obtain a foreground area feature map of the target image.

[0020] Optionally, after obtaining the foreground area feature map of the target image, the method further includes:

[0021] Performing a convolution operation and an activation function activation operation on the foreground area feature map output by the branch of the foreground area segmentation subnetwork to obtain a foreground area segmentation map;

[0022] The foreground area segmentation maps corresponding to all branches of the foreground area segmentation subnetwork are subjected to a scale transformation operation and a weighted average calculation to obtain a foreground area map of the target image.

[0023] Optionally, inputting the dot product result of the foreground area feature map and the image feature into the key point detection subnetwork to obtain a key point heat map of the target image, including:

[0024] Inputting the dot product result of the foreground area feature map and the image feature into the branch of the key point detection subnetwork, so as to perform a convolution operation and a feature fusion operation on the dot product result to obtain an intermediate heat map;

[0025] The intermediate heat map output by the branch of the key point detection subnetwork is subjected to a scale transformation operation and a weighted average calculation to obtain a key point heat map of the target image.

[0026] The present application also provides a device for detecting key points of an image, the device for detecting key points of an image comprising a key point detection model, the key point detection model comprising a backbone network, a foreground area segmentation subnetwork and a key point detection subnetwork, the detection device comprising:

[0027] A feature extraction module, used to extract image features of a target image using the backbone network;

[0028] A foreground segmentation module, used for inputting the image features into the foreground region segmentation subnetwork to obtain a foreground region feature map of the target image;

[0029] A heat map generation module, used for inputting the dot product result of the foreground area feature map and the image feature into the key point detection subnetwork to obtain a key point heat map of the target image;

[0030] A key point detection module is used to determine the key points in the target image according to the key point heat map.

[0031] The present application also provides a storage medium on which a computer program is stored, and when the computer program is executed, the steps of the above-mentioned method for detecting key points of an image are implemented.

[0032] The present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, the steps of the above-mentioned method for detecting key points of an image are implemented.

[0033] The present application provides a method for detecting key points of an image, which is applied to a key point detection model. The key point detection model includes a backbone network, a foreground area segmentation subnetwork and a key point detection subnetwork. The detection method includes: using the backbone network to extract image features of a target image; inputting the image features into the foreground area segmentation subnetwork to obtain a foreground area feature map of the target image; inputting the dot product result of the foreground area feature map and the image features into the key point detection subnetwork to obtain a key point heat map of the target image; and determining the key points in the target image according to the key point heat map.

[0034] After the present application uses the backbone network to extract the image features of the target image, it uses the foreground area segmentation self-network to determine the foreground area feature map of the target image based on the image features, and then uses the dot product result of the foreground area feature map and the image features as the input data of the key point detection sub-network. The present application uses the dot product result of the foreground area feature map and the image features to retain the foreground area features and suppress the background area features, thereby reducing the interference of the background of the target image on the detection of image key points. Therefore, the scheme of the present application can improve the accuracy of key point detection. The present application also provides a detection device for image key points, an electronic device and a storage medium, which have the above-mentioned beneficial effects and are not repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0036] Figure 1 A flowchart of a method for detecting key points of an image provided by an embodiment of the present application;

[0037] Figure 2 A flowchart of a key point detection method based on semantic information enhancement provided in an embodiment of the present application;

[0038] Figure 3 A schematic diagram of the detection principle of an image key point provided in an embodiment of the present application;

[0039] Figure 4 A schematic diagram of the structure of a device for detecting key points of an image provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are 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.

[0041] See below Figure 1 , Figure 1 A flowchart of a method for detecting key points of an image provided in an embodiment of the present application.

[0042] Specific steps may include:

[0043] S101: Extracting image features of a target image using the backbone network;

[0044] This embodiment can be applied to a key point detection model, which includes a backbone network, a foreground area segmentation subnetwork and a key point detection subnetwork. The backbone network may include multiple convolution stages, each of which includes a combination of multiple convolution layers, activation layers, batch normalization layers, and pooling layers, and features of different scales may be obtained after each convolution stage. As a feasible implementation method, the backbone network may be a backbone network shared by the foreground area segmentation subnetwork and the key point detection subnetwork, and the image features extracted by the backbone network may be input into the foreground area segmentation subnetwork and the key point detection subnetwork, respectively.

[0045] S102: Inputting the image features into the foreground region segmentation subnetwork to obtain a foreground region feature map of the target image;

[0046] Among them, the foreground area segmentation subnetwork may include multiple branches. In this step, the image features extracted by the backbone network may be input into the branches of the foreground area segmentation subnetwork so as to perform convolution calculation operations and feature fusion operations on the image features to obtain the foreground area feature map of the target image. The foreground area segmentation subnetwork is used to extract and detect the foreground area. It uses multi-scale feature fusion across the convolution stage to blend low-resolution convolution features with a larger field of view and high-resolution convolution features with more details, thereby improving the accuracy of foreground segmentation. The output foreground detection map is used to guide key point positioning. When the foreground area segmentation subnetwork and the key point detection subnetwork feature fusion are performed, different branches may be used for fusion, and the semantic information output by different branches of the foreground area segmentation subnetwork (such as the foreground area detection results output by the first branch or the third branch) may also be used to guide the key point detection subnetwork.

[0047] As a feasible implementation method, after obtaining the foreground area feature map of the target image, the foreground area feature map output by the branch of the foreground area segmentation subnetwork can also be subjected to convolution operation and activation function activation operation to obtain a foreground area segmentation map; the foreground area segmentation maps corresponding to all branches of the foreground area segmentation subnetwork are subjected to scale transformation operation and weighted average calculation to obtain the foreground area map of the target image. The above-mentioned scale transformation operation can adjust the size of all foreground area segmentation maps to the original image size of the target image. When performing the weighted operation, the weights of each branch of the foreground area segmentation subnetwork are the same. In the above manner, the foreground area segmentation result can be output while outputting the key point position.

[0048] S103: Inputting the dot product result of the foreground area feature map and the image feature into the key point detection subnetwork to obtain a key point heat map of the target image;

[0049] Among them, this embodiment can perform a dot product operation on the foreground area feature map output by the foreground area segmentation subnetwork and the image feature output by the backbone network to obtain a dot product result, and the dot product result can retain the foreground area features in the target image and suppress the background area features.

[0050] The key point detection subnetwork may include multiple branches. In this step, the dot product result of the foreground area feature map and the image feature is input into the branch of the key point detection subnetwork so as to perform convolution calculation operation and feature fusion operation on the dot product result to obtain an intermediate heat map; the intermediate heat map output by the branch of the key point detection subnetwork is scaled and weighted averaged to obtain the key point heat map of the target image.

[0051] S104: Determine key points in the target image according to the key point heat map.

[0052] After obtaining the key point heat map (also called the key point heat map), the key points in the target image are determined according to the peak positions of the key point heat map. After obtaining the key points, operations such as face recognition and human posture recognition can be performed based on the key points.

[0053] After the backbone network is used to extract the image features of the target image, the foreground region segmentation sub-network is used to determine the foreground region feature map of the target image according to the image features, and then the dot product result of the foreground region feature map and the image features is used as the input data of the key point detection sub-network. The dot product result of the foreground region feature map and the image features used in the present embodiment can retain the foreground region features and suppress the background region features, thereby reducing the interference of the background of the target image on the key point detection of the image, so the solution of the present embodiment can improve the key point detection accuracy.

[0054] As a feasible implementation method, the backbone network can be used to extract image features of the target image at multiple scales. Image features of different scales have different resolutions. In order to improve the recognition accuracy of the key point detection subnetwork for high-resolution features, the present application can select image features with the top N resolutions as target image features; and input the dot product result of the target image features and the image features into the key point detection subnetwork.

[0055] The process described in the above embodiment is explained below through an embodiment in actual application.

[0056] The method based on key point coordinate regression uses a fully connected layer to directly obtain the coordinates of the key points through coordinate regression, but coordinate regression is usually difficult, the model is difficult to train or converges slowly, and the regression accuracy is low. The method based on heat map response uses a Gaussian heat map centered on the key point position for "weak supervision", the model converges faster, and finally uses the predicted peak position in the heat map to determine the key point position. This method is the current mainstream key point detection method, but existing methods usually perform key point detection on low-resolution features, which is prone to errors when the key points are mapped to the original image.

[0057] See also Figure 2 , Figure 2 A flowchart of a key point detection method based on semantic information enhancement provided by an embodiment of the present application, the method can be based on a key point detection model, the key point detection model includes a backbone network, a key point detection subnetwork and a foreground area segmentation subnetwork. The key point detection subnetwork and the foreground area segmentation subnetwork share the backbone network, and the key point position can be obtained after the target image is input into the key point detection model. The shared backbone network has multiple convolution stages for basic feature extraction, and features of different scales can be obtained after each convolution stage. The features of different scales extracted in different convolution stages are used as the input of the two branch networks. The foreground area map segmented by the foreground area segmentation subnet is scale-transformed and point-multiplied with the features of different scales of the key point detection subnet to retain the foreground area features and suppress the background area features. The key point detection subnet is used to locate the key point position. In order to reduce the positioning error, a series of multi-scale feature fusions are performed between the high-resolution feature maps of multiple branches, and key point detection is performed at different scales. The key point detection results of different scales are scale-transformed and fused to obtain the final key point detection result.

[0058] The implementation process of the key point detection model includes the following steps:

[0059] Step 1: Obtain the target image (i.e., the image to be detected).

[0060] Step 2: Detect key points of the target image.

[0061] Among them, this step performs pixel-level foreground area segmentation on the target image, and uses the foreground area information to guide key point detection. During detection, a convolutional neural network is used, and a shared backbone network is used for feature extraction. Then the foreground area segmentation subnet performs foreground segmentation, and finally the key point detection subnet integrates the foreground semantic information to output a thermal response map.

[0062] Step 3: Determine the key point position in the image based on the peak position of the thermal response graph.

[0063] The key point detection model provided in the above embodiment uses a foreground area segmentation subnetwork with multi-scale feature fusion to distinguish the foreground and background in the image, and then uses the foreground semantic information learned by the foreground area segmentation subnetwork to guide the key point detection subnetwork through a top-down information guidance method, thereby improving the ability of the key point detection subnetwork to locate key points in complex backgrounds, effectively reducing detection errors and improving the performance of key point positioning.

[0064] The foreground region segmentation subnetwork is used to distinguish the foreground and background of key point detection. The outputs of multiple convolution stages of the shared backbone network are used as the inputs of multiple branches of the foreground region segmentation subnetwork. The input of each branch also undergoes a series of convolutions to continue to extract features of different scales. A series of feature fusions are also performed between feature maps of different scales between different branches. After activation, the outputs of different branches all obtain a foreground region map, and the value range of the foreground region map is (0, 1). After the foreground region maps output by different branches are scaled, the weighted average is used to output a fused foreground region map.

[0065] The key point detection subnetwork can generate a heat map for each key point to determine the key point location. In order to obtain more precise key point positioning coordinates, the outputs of multiple high-resolution convolution stages of the shared backbone network are used as multi-channel inputs of the key point detection subnetwork, and the segmentation results of the foreground area are used to perform pixel-level dot multiplication operations with the input feature maps of each branch of the key point detection subnetwork, which suppresses the background area features while highlighting the foreground area features. Similarly, the inputs of each branch of the key point detection subnetwork are also subjected to a series of convolutions to continue to extract features of different scales, and a series of feature fusions are also performed between the feature maps of different scales of each branch. Each branch outputs a corresponding heat map. After the heat maps output by different branches are scaled, they are weighted averaged according to the corresponding channels, and the fused heat map is output.

[0066] See also Figure 3 , Figure 3 A schematic diagram of the detection principle of an image key point provided in an embodiment of the present application. Figure 3 As shown in the figure, the backbone network includes five convolution stages, namely S1, S2, S3, S4 and S5. The length and width of the feature map output in each stage become half of the previous stage. The backbone network uses a lightweight inverted residual module (IRM) when performing convolution operations to extract features. The use of the IRM module can greatly reduce the parameters and calculation amount of the model without significantly reducing the performance of the model. Figure 3 The dashed arrows in the middle represent upsampling, and the solid arrows represent downsampling. Figure 3 The loss calculation layer is also included.

[0067] The outputs of the S1, S3, and S5 convolution modules of the backbone network are the inputs of the three paths of the foreground segmentation subnetwork. Each input of the branch network also undergoes a series of convolutions to obtain Seg1-1, Seg2-1, and Seg3-1. The features of different scales in different branches are scaled, concatenated in the feature channel dimension, and then fused after a series of convolution operations (IRM modules). For example, Seg1-1 and Seg2-1 are fused to obtain Seg1-2, Seg1-1, Seg2-1, and Seg3-1 are fused to obtain Seg2-2, and Seg2-1 and Seg3-1 are fused to obtain Seg3-2. The feature maps obtained after feature fusion undergo a series of convolution operations on the three branches, and then after activation by the activation function, a foreground area segmentation map is output, which are SegOut1, SegOut3, and SegOut5 respectively. The foreground area segmentation maps output by different branches are scaled to obtain the scale transformation result SegConCat. The scale transformation results are fused through a weighted average operation to obtain a fused foreground area segmentation map Segfuse.

[0068] The key point detection subnet generates a heat map (i.e., heat map) for each key point to determine the key point location. The foreground area segmentation map output by the foreground detection subnet is scaled and pixel-wise multiplied with the high-resolution feature map output by the backbone network in stages S1, S2, and S3, and then undergoes a series of convolutions to obtain the results Kp1-1, Kp2-1, and Kp3-1. Since the foreground part of the foreground area segmentation map has a value close to 1 and the background part has a value close to 0, after dot multiplication with the feature map, the foreground area part of the feature map is approximately unchanged and retained, while the background area part has a value close to 0, and is therefore suppressed. Features of different scales in different branches are also scaled and concatenated in the feature channel dimension and then fused after a series of convolution operations (IRM modules). For example, Kp1-1 and Kp2-1 are fused to obtain Kp1-2, Kp2-1, Kp1-1 and Kp3-1 are fused to obtain Kp2-2, Kp2-1 and Kp3-1 are fused to obtain Kp3-2, and Kp1-2, Kp2-2, Kp3-2 are fused to obtain Kpout1, Kpout2, Kpout3 after a series of convolutions. In this example, the number of channels of Kpout1, Kpout2, and Kpout3 is 21, and each channel is a heat map, which is used to detect 21 main key points of the human body, including the top of the head, facial features, neck, and main joints of the limbs. The heat maps corresponding to different key points of each branch are transformed to the same scale to obtain KpConcat, and KpConcat is weighted averaged to obtain the heat map Kpfuse after the fusion of different key points. The maximum values ​​of the heat maps of different key points are taken as the positions of their respective key points.

[0069] As for Figure 1 Further introduction to the corresponding embodiment, before using the backbone network to extract image features of the target image, the key point detection model can be trained using the target network loss function; wherein the target network loss function includes a foreground area segmentation sub-network loss function and a key point detection sub-network loss function.

[0070] Both the foreground region detection subnet and the key point detection subnet contain multiple branches and have multiple outputs, and the loss is also calculated on the multiple outputs. The total network loss includes the foreground region segmentation subnet loss and the key point detection subnet loss, wherein the foreground region segmentation subnet loss includes the foreground region segmentation result loss of each branch and the segmentation loss after fusion, and the key point detection subnet loss includes the key point detection result loss of each branch and the key point detection loss after fusion. This embodiment performs supervision at multiple scales, and the total network loss includes the foreground detection loss (i.e., cross entropy loss CEE) and the key point detection loss (i.e., mean square error MSE), both of which are the sum of the losses of each branch and the fusion loss.

[0071] The foreground area detection subnet in the network uses cross entropy loss (CEE), and the key point detection subnet uses mean square error (MSE) loss. The total loss of the model is E Total It can be defined as:

[0072] E Total =αE Seg +βE Kp ;

[0073] Among them, E Seg is the foreground region detection subnet loss, E Kp is the key point detection subnet loss, and α and β are the weights of the two respectively.

[0074]

[0075]

[0076] E SegOuti is the output result loss of the i-th branch of the foreground region segmentation subnet, n is the total number of its branches, E SegFuse is the loss of the foreground area segmentation fusion result; E KpOutj is the output loss of the jth branch of the key point detection subnet, m is the total number of its branches, E KpFuse is the loss of the key point detection fusion result.

[0077] The training process of the key point detection model is as follows: obtain the training image; scale the training image to the preset resolution, and after random rotation and other data enhancement, send it to the key point detection model. Use the foreground area segmentation subnet to output the foreground area segmentation result and the key point detection subnet to output the key point detection result and its corresponding label to calculate the loss. The foreground area segmentation label is a binary image, with the foreground area value being 1 and the background area value being 0; the key point detection label is a heat map with a Gaussian distribution. The formula for the Gaussian distribution is as follows:

[0078]

[0079] In the above formula, (center_x, center_y) is the coordinate of the key point, σ is used to control the diffusion degree of Gaussian distribution, and each key point generates a heat map label. The key point position in the heat map label takes the value of 1, and the values ​​of the surrounding pixels gradually decrease, with a value range of (0,1].

[0080] According to formula E Total =αE Seg +βE Kp The total loss is shown. The foreground area segmentation subnet and the key point detection subnet are trained at the same time. The model is updated through back propagation to obtain the trained key point detection model.

[0081] See also Figure 4 , Figure 4 A schematic diagram of the structure of a detection device for key points of an image provided in an embodiment of the present application, wherein the detection device for key points of an image includes a key point detection model, wherein the key point detection model includes a backbone network, a foreground area segmentation subnetwork and a key point detection subnetwork, and the detection device includes:

[0082] A feature extraction module 401 is used to extract image features of a target image using the backbone network;

[0083] A foreground segmentation module 402 is used to input the image features into the foreground region segmentation subnetwork to obtain a foreground region feature map of the target image;

[0084] A heat map generation module 403 is used to input the dot product result of the foreground area feature map and the image feature into the key point detection subnetwork to obtain a key point heat map of the target image;

[0085] The key point detection module 404 is used to determine the key points in the target image according to the key point heat map.

[0086] After the backbone network is used to extract the image features of the target image, the foreground region segmentation sub-network is used to determine the foreground region feature map of the target image according to the image features, and then the dot product result of the foreground region feature map and the image features is used as the input data of the key point detection sub-network. The dot product result of the foreground region feature map and the image features used in the present embodiment can retain the foreground region features and suppress the background region features, thereby reducing the interference of the background of the target image on the key point detection of the image, so the solution of the present embodiment can improve the key point detection accuracy.

[0087] Furthermore, the feature extraction module 401 is used to extract image features of the target image at multiple scales using the backbone network.

[0088] Furthermore, the heat map generation module 403 is used to select image features ranked in the top N positions in resolution as target image features; and is also used to input the dot product result of the target image feature and the image feature into the key point detection subnetwork.

[0089] Furthermore, it also includes:

[0090] A model training module, used for training the key point detection model using a target network loss function before using the backbone network to extract image features of the target image;

[0091] Among them, the target network loss function includes the foreground area segmentation sub-network loss function and the key point detection sub-network loss function.

[0092] Furthermore, the foreground segmentation module 402 is used to input the image features into the branch of the foreground area segmentation subnetwork so as to perform convolution calculation operations and feature fusion operations on the image features to obtain a foreground area feature map of the target image.

[0093] Furthermore, it also includes:

[0094] The foreground area map generation module is used to perform convolution operation and activation function activation operation on the foreground area feature map output by the branch of the foreground area segmentation subnetwork after obtaining the foreground area feature map of the target image, so as to obtain the foreground area segmentation map; and is also used to perform scale transformation operation and weighted average calculation on the foreground area segmentation maps corresponding to all branches of the foreground area segmentation subnetwork, so as to obtain the foreground area map of the target image.

[0095] Furthermore, the heat map generation module 403 is used to input the dot product result of the foreground area feature map and the image feature into the branch of the key point detection subnetwork, so as to perform convolution calculation operation and feature fusion operation on the dot product result to obtain an intermediate heat map; it is also used to perform scale transformation operation and weighted average calculation on the intermediate heat map output by the branch of the key point detection subnetwork to obtain the key point heat map of the target image.

[0096] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.

[0097] The present application also provides a storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0098] The present application also provides an electronic device, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps provided in the above embodiment may be implemented. Of course, the electronic device may also include various network interfaces, power supplies and other components.

[0099] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of this application.

[0100] It should also be noted that, in this specification, relational terms such as first and second, etc. 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 "comprises", "comprising" 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, an element defined by the statement "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A method for detecting key points of an image, characterized in that: Applied to a key point detection model, the key point detection model includes a backbone network, a foreground area segmentation subnetwork and a key point detection subnetwork, and the detection method includes: Extracting image features of a target image using the backbone network; Inputting the image features into the foreground region segmentation subnetwork to obtain a foreground region feature map of the target image; Input the dot product result of the foreground area feature map and the image feature into the key point detection subnetwork to obtain the key point heat map of the target image; Determine the key points in the target image according to the key point heat map; Wherein, extracting the image features of the target image by using the backbone network includes: Extracting image features of the target image at multiple scales using the backbone network; The step of inputting the dot product result of the foreground area feature map and the image feature into the key point detection subnetwork includes: Select the top N image features with the highest resolution as the target image features; Inputting the dot product result of the target image feature and the image feature into the key point detection subnetwork; The step of inputting the image features into the foreground region segmentation subnetwork to obtain a foreground region feature map of the target image includes: Inputting the image features into a branch of the foreground region segmentation subnetwork so as to perform convolution calculation operations and feature fusion operations on the image features to obtain a foreground region feature map of the target image; After obtaining the foreground area feature map of the target image, the method further includes: Performing a convolution operation and an activation function activation operation on the foreground area feature map output by the branch of the foreground area segmentation subnetwork to obtain a foreground area segmentation map; The foreground area segmentation maps corresponding to all branches of the foreground area segmentation subnetwork are subjected to a scale transformation operation and a weighted average calculation to obtain a foreground area map of the target image.

2. The method for detecting key points of an image according to claim 1, characterized in that: Before using the backbone network to extract the image features of the target image, the method further includes: Training the key point detection model using a target network loss function; Among them, the target network loss function includes the foreground area segmentation sub-network loss function and the key point detection sub-network loss function.

3. The method for detecting key points of an image according to claim 1 or 2, characterized in that: Inputting the dot product result of the foreground area feature map and the image feature into the key point detection subnetwork to obtain the key point heat map of the target image, including: Inputting the dot product result of the foreground area feature map and the image feature into the branch of the key point detection subnetwork, so as to perform a convolution operation and a feature fusion operation on the dot product result to obtain an intermediate heat map; The intermediate heat map output by the branch of the key point detection subnetwork is subjected to a scale transformation operation and a weighted average calculation to obtain a key point heat map of the target image.

4. A device for detecting key points of an image, characterized in that: The image key point detection device comprises a key point detection model, the key point detection model comprises a backbone network, a foreground area segmentation sub-network and a key point detection sub-network, and the detection device comprises: A feature extraction module, used to extract image features of a target image using the backbone network; A foreground segmentation module, used for inputting the image features into the foreground region segmentation subnetwork to obtain a foreground region feature map of the target image; A heat map generation module, used for inputting the dot product result of the foreground area feature map and the image feature into the key point detection subnetwork to obtain a key point heat map of the target image; A key point detection module, used to determine the key points in the target image according to the key point heat map; Wherein, the feature extraction module is used to extract image features of the target image at multiple scales using the backbone network; The heat map generation module is used to select the image features ranked in the top N positions in resolution as the target image features; and is also used to input the dot product result of the target image features and the image features into the key point detection subnetwork; The foreground segmentation module is used to input the image features into the branch of the foreground area segmentation subnetwork, so as to perform convolution calculation operations and feature fusion operations on the image features to obtain a foreground area feature map of the target image; Among them, it also includes: The foreground area map generation module is used to perform convolution operation and activation function activation operation on the foreground area feature map output by the branch of the foreground area segmentation subnetwork after obtaining the foreground area feature map of the target image, so as to obtain the foreground area segmentation map; and is also used to perform scale transformation operation and weighted average calculation on the foreground area segmentation maps corresponding to all branches of the foreground area segmentation subnetwork, so as to obtain the foreground area map of the target image.

5. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps of the method for detecting key points of an image as claimed in any one of claims 1 to 3 are implemented.

6. A storage medium, characterized in that: The storage medium stores computer executable instructions, and when the computer executable instructions are loaded and executed by the processor, the steps of the method for detecting key points of an image as claimed in any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Text recognition method and device, electronic equipment and storage medium

    CN112464798A

  • Human body image segmentation method and device, computer equipment and storage medium

    CN112749609A

  • Target detection method and apparatus

    WO2021098261A1