Image recognition method, device, storage medium, and program product
By identifying limb points and contour points of the human body through a joint model, the problem of inaccurate human body edge detection in the existing technology is solved, a complete analysis of the human body image is achieved, and the performance of body beautification, action understanding and behavior recognition is improved.
Patent Information
- Application Number
- PCT/CN2024/081692
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-24
- Filing Date
- 2024-03-14
- Publication Date
- 2024-10-03
AI Technical Summary
The existing technology lacks accurate identification and contour detection of key points on the human body's edges in human body images, and cannot completely analyze various parts of the human body, resulting in poor performance in body beautification, action understanding, and behavior recognition tasks.
By designing an image recognition method, the joint model of the feature extraction module, limb point decoding module and contour point decoding module is used to simultaneously identify the limb points and contour points of the human body to achieve complete analysis of the image to be processed.
This method can identify limb points and contour points of the human body faster and more efficiently, support real-time performance in tasks such as body beautification, action understanding, and behavior recognition, and provide stable technical support.
Smart Images

Figure CN2024081692_03102024_PF_FP_ABST
Abstract
Description
Image recognition method, device, storage medium and program product
[0001] This application is based on the Chinese application with application number 202310309219.9 and application date March 24, 2023, and claims its priority. The disclosed content of the Chinese application is hereby introduced as a whole into this application. Technical Field
[0002] The embodiments of the present disclosure relate to the field of computer and network communication technology, and more particularly to an image recognition method, device, storage medium, and program product. Background Art
[0003] In tasks such as body beautification (slimming down the body, slimming down the legs), motion understanding, and behavior recognition based on human images, it is usually necessary to detect key points of the human body in the image.
[0004] In related technologies, human body key point detection is mostly human pose estimation. This method usually focuses on identifying the positions of 17 key points on the human body, such as the eyes, nose, ears, shoulders, elbows, and wrists. As shown in Figure 1a, this method provides a rough estimate of the human skeleton. However, this method lacks the ability to accurately identify key points on the edges of the human body and lacks the technology to detect the edge contours of the human body. Therefore, it cannot fully analyze various parts of the human body and cannot effectively support tasks such as body beauty (slimming and leg slimming), motion understanding, and behavior recognition.
[0005] Summary of the Invention
[0006] The embodiments of the present disclosure provide an image recognition method, device, storage medium, and program product to simultaneously realize the recognition tasks of limb points and contour points in an image to be processed containing a human body, and completely analyze various parts of the human body.
[0007] In a first aspect, an embodiment of the present disclosure provides an image recognition method, comprising:
[0008] Acquire an image to be processed containing a human body;
[0009] Inputting the image to be processed into an image recognition model, wherein the image recognition model includes a feature extraction module, a limb point decoding module and a contour point decoding module;
[0010] The feature extraction module extracts image features from the image to be processed;
[0011] The limb point decoding module obtains a limb point recognition result according to the image features;
[0012] The contour point decoding module obtains a contour point recognition result according to the image feature and the limb point recognition result;
[0013] Limb points and contour points are respectively determined in the image to be processed according to the limb point recognition results and the contour point recognition results.
[0014] In a second aspect, an embodiment of the present disclosure provides an image recognition device, comprising:
[0015] An acquisition unit, configured to acquire an image to be processed containing a human body;
[0016] a processing unit configured to input the image to be processed into an image recognition model, the image recognition model comprising a feature extraction module, a limb point decoding module, and a contour point decoding module; the feature extraction module extracting image features from the image to be processed; the limb point decoding module obtaining a limb point recognition result based on the image features; and the contour point decoding module obtaining a contour point recognition result based on the image features and the limb point recognition result;
[0017] A key point determination unit is used to determine limb points and contour points in the image to be processed according to the limb point recognition result and the contour point recognition result respectively.
[0018] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;
[0019] The memory stores computer-executable instructions;
[0020] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the image recognition method described in the first aspect and various possible designs of the first aspect.
[0021] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the image recognition method described in the first aspect and various possible designs of the first aspect is implemented.
[0022] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, comprising computer-executable instructions. When a processor executes the computer-executable instructions, the image recognition method as described in the first aspect and various possible designs of the first aspect is implemented.
[0023] The image recognition method, device, storage medium and program product provided by the embodiments of the present disclosure are as follows: obtaining an image to be processed containing a human body; inputting the image to be processed into an image recognition model, wherein the image recognition model includes a feature extraction module, a limb point decoding module and a contour point decoding module; the feature extraction module extracts image features from the image to be processed; the limb point decoding module obtains a limb point recognition result based on the image features; the contour point decoding module obtains a contour point recognition result based on the image features and the limb point recognition result; and determining limb points and contour points in the image to be processed based on the limb point recognition result and the contour point recognition result. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0025] Figure 1a is an example diagram of human limb points;
[0026] FIG1b is an example diagram of human body contour points provided by an embodiment of the present disclosure;
[0027] FIG2 is a flow chart of an image recognition method according to an embodiment of the present disclosure;
[0028] FIG3 is a schematic diagram of the structure of an image recognition model provided by an embodiment of the present disclosure;
[0029] FIG4 is a flow chart of a method for training an image recognition model according to an embodiment of the present disclosure;
[0030] FIG5 is a schematic diagram of loss composition provided by an embodiment of the present disclosure;
[0031] FIG6 is a structural block diagram of an image recognition device provided by an embodiment of the present disclosure;
[0032] FIG7 is a structural block diagram of an image recognition device provided by another embodiment of the present disclosure;
[0033] FIG8 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0035] In tasks such as body beautification (slimming down the body, slimming down the legs), motion understanding, and behavior recognition based on human images, it is usually necessary to detect key points of the human body in the image.
[0036] In related technologies, human body key point detection is mostly human pose estimation. This method usually focuses on identifying the positions of key points (limb points) such as the eyes, nose, ears, shoulders, elbows, and wrists. The limb points in the schematic diagram shown in Figure 1a provide a rough estimate of the human skeleton. However, this method lacks accurate identification of key points on the edges of the human body and lacks the technology to detect the edge contours of the human body. It cannot fully analyze various parts of the human body and cannot well support tasks such as body beauty (slimming and leg slimming), motion understanding, and behavior recognition.
[0037] In order to support tasks such as body beautification (slimming down, slimming down legs), motion understanding, and behavior recognition, it is also necessary to detect the edge contours of the human body image, such as the edge points in the schematic diagram shown in Figure 1b. However, the detection of human edge contours in related technologies mostly uses traditional image processing methods to extract the features of relevant edge information to obtain the contours of the human body. Therefore, in order to identify limb points and edge contours, it is necessary to execute limb point detection methods (such as the above-mentioned human posture estimation) and edge contour detection methods separately. The serial execution of these two tasks takes a long time, resulting in downstream tasks such as body beautification (slimming down, slimming down legs), motion understanding, and behavior recognition failing to achieve real-time performance. In addition, edge contour detection lacks semantic information about the edges of the human body. For example, it can only determine the position of the edge of the human body, but cannot determine where the edge of the palm is or where the edge of the leg is.
[0038] In order to shorten the processing time and improve the processing efficiency, the present disclosure considers simultaneously identifying limb points and contour points of an image to be processed containing a human body. Therefore, the present disclosure provides an image recognition method, which comprises obtaining an image to be processed containing a human body; inputting the image to be processed into an image recognition model, wherein the image recognition model includes a feature extraction module, a limb point decoding module, and a contour point decoding module; the feature extraction module extracts image features from the image to be processed; the limb point decoding module obtains a limb point recognition result based on the image features; the contour point decoding module obtains a contour point recognition result based on the image features and the limb point recognition result; and the limb points and contour points are respectively determined in the image to be processed based on the limb point recognition result and the contour point recognition result. This embodiment can simultaneously realize the recognition task of limb points and contour points in an image to be processed containing a human body through the image recognition model, and completely analyze various parts of the human body. It takes less time and has higher processing efficiency, and provides stable technical support for subsequent body beautification, movement understanding, behavior recognition, etc.
[0039] Through the research and statistics of human body contours, the present disclosure finds that the human body contour can be formed by connecting multiple contour points, as shown in Figure 1b. For example, 1-4 are head contour points, and 5-8 are arm contour points. By connecting these key points in sequence, a rough outline of the human body edge is formed, and it has strong semantic information.
[0040] One application scenario of the image recognition method disclosed herein is application in a terminal device or a server.
[0041] Optionally, if the image recognition method is applied to a terminal device (such as a mobile phone, tablet computer, etc.), the image to be processed containing a human body can be captured by a camera, or an image to be processed containing a human body transmitted by other devices can be received, or an image to be processed containing a human body stored in a storage unit can be read, and then the image recognition method of the present disclosure can be executed;
[0042] Optionally, if the image recognition method is applied to a server, the terminal device can obtain the image to be processed containing the human body and upload it to the server. The server executes the image recognition method of the present disclosure and then sends the determined limb points and contour points to the terminal device.
[0043] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0044] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0045] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0046] It is understandable that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0047] The image recognition method disclosed herein will be described in detail below with reference to specific embodiments.
[0048] Refer to Figure 2, which is a flow chart of an image recognition method provided by an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device or a server, and the image recognition method includes:
[0049] S201: Acquire an image to be processed containing a human body.
[0050] In this embodiment, an image to be processed containing a human body can be captured by an image capture device, or an image to be processed containing a human body transmitted by other devices can be received, or an image to be processed containing a human body stored in a storage unit can be read, or an image to be processed containing a human body can be obtained by other means, which will not be repeated here.
[0051] S202: Input the image to be processed into an image recognition model, where the image recognition model includes a feature extraction module, a limb point decoding module, and a contour point decoding module.
[0052] In this embodiment, to avoid the time-consuming and slow processing of two separate recognition models serially identifying limb points and contour points in the image to be processed, a single image recognition model can be constructed and trained to simultaneously perform both limb point and contour point recognition tasks. Optionally, this joint model can be a convolutional neural network model.
[0053] Optionally, as shown in FIG3 , the joint model includes a feature extraction module (shared encoder), a limb point decoding module (skeleton decoder), and a contour point decoding module (contour decoder), wherein the feature extraction module is the backbone network of the model and can be used to extract image features from the image to be processed; the limb point decoding module and the contour point decoding module are recognition modules for respectively realizing the recognition tasks of limb points and contour points, that is, a backbone network connects two-branch recognition modules. More specifically, the limb point decoding module can output limb point recognition results, and optionally, the limb point recognition results can be limb point heatmaps. The contour point decoding module can output contour point recognition results, and optionally, the contour point recognition results can be contour point heatmaps. The limb point decoding module and the contour point decoding module can adopt a network structure that can realize the key point heatmap method.
[0054] In this embodiment, after obtaining the image to be processed containing the human body, the image to be processed can be input into the image recognition model, and the image to be processed is processed by the joint model to output the limb point recognition results and the contour point recognition results.
[0055] S203: The feature extraction module extracts image features from the image to be processed.
[0056] In this embodiment, after the image to be processed is input into the image recognition model, the feature extraction module can extract image features from the image to be processed.
[0057] S204: The limb point decoding module obtains a limb point recognition result according to the image features.
[0058] In this embodiment, the image features are input into the limb point decoding module, which obtains the limb point recognition result based on the image features. Optionally, the limb point decoding module can obtain a limb point heat map based on the image features and determine the limb point heat map as the limb point recognition result.
[0059] S205 , the contour point decoding module obtains a contour point recognition result according to the image feature and the limb point recognition result.
[0060] In this embodiment, considering that limb points have stronger semantic information than contour points, are relatively easy to learn, and are intuitively strongly associated with human contour points, after obtaining limb point recognition results based on image features, the contour point decoding module can be guided to learn contour point features based on both the image features and the limb point recognition results. That is, the contour point recognition results are obtained based on the image features and the limb point recognition results, thereby ensuring that the contour points also have strong semantic information. For example, the contours of the left and right hands, the location of the abdomen edge, and the location of the leg edge can be accurately determined, providing basic capabilities for subsequent automated body shaping (slimming, leg slimming) and other technologies. Specifically, the contour point decoding module can fuse the image features and the limb point recognition results, and obtain the contour point recognition results based on the fusion results. To simply and effectively improve the effect, the feature fusion here uses a simple concatenation method (concat), which concatenates the image features and image features related to the limb point recognition results (obtained by performing a detach operation on the limb point recognition results).
[0061] S206 , determining limb points and contour points in the image to be processed respectively according to the limb point recognition results and the contour point recognition results.
[0062] In this embodiment, after obtaining the limb point recognition results and the contour point recognition results, the coordinates of the limb points and the contour points can be determined based on the limb point recognition results and the contour point recognition results. Specifically, the coordinates of the limb points can be determined according to the limb point heat map, and the coordinates of the contour points can be determined according to the contour point heat map, thereby obtaining the limb points and contour points in the image to be processed.
[0063] The image recognition method provided in this embodiment comprises the following steps: obtaining an image to be processed containing a human body; obtaining an image to be processed containing a human body; inputting the image to be processed into an image recognition model, wherein the image recognition model comprises a feature extraction module, a limb point decoding module, and a contour point decoding module; extracting image features from the image to be processed by the feature extraction module; and determining limb points and contour points in the image to be processed based on the limb point recognition results and the contour point recognition results, respectively. This embodiment, through the image recognition model, can simultaneously recognize limb points and contour points in an image to be processed containing a human body, completely analyzing various parts of the human body. This method is more time-efficient and more efficient, providing stable technical support for subsequent body beautification, movement understanding, and behavior recognition.
[0064] Refer to Figure 4, which is a flow chart of a method for training an image recognition model provided by an embodiment of the present disclosure. The method of this embodiment can be applied to a terminal device or server, which can be a terminal device or server that executes the above-mentioned image recognition method, or of course, other terminal devices or servers. In order to train the image recognition model in the above-mentioned embodiment, the training method of the image recognition model includes:
[0065] S301: Acquire multiple sample images containing human bodies, wherein the sample images are annotated with limb point labels and contour point labels.
[0066] In this embodiment, because the image recognition model in the above embodiment can handle both limb point and contour point recognition tasks, the sample images containing human bodies used to train the joint model also need to be annotated with both limb point labels and contour point labels. This embodiment does not limit the method for acquiring the sample images, nor does it limit the method for annotating them; for example, manual annotation is possible.
[0067] Optionally, the form of the label can be determined according to the output type of the image recognition model. For example, when the predicted limb point recognition result of the output of the image recognition model is a predicted limb point heat map, and the predicted contour point recognition result is a predicted contour point heat map, the limb point label annotated in the sample image is represented by a sample limb point heat map, and the contour point label is represented by a sample contour point heat map; therefore, when obtaining multiple sample images containing human bodies, the corresponding sample limb point heat map and sample contour point heat map can be obtained as labels based on any sample image, and then the sample image and the corresponding sample limb point heat map and sample contour point heat map are used as a set of training data.
[0068] In this embodiment, since the image recognition model actually outputs a limb point heat map and a contour point heat map, it is necessary to obtain the corresponding limb point heat map and contour point heat map based on the sample image, convert each limb point position into a sample limb point heat map according to the limb point label, and convert each contour point position into a sample contour point heat map according to the contour point label, and then use the sample image and the corresponding sample limb point heat map and sample contour point heat map as a set of training data, where the sample image is used as the input of the model, and the sample limb point heat map and the sample contour point heat map are used as the groundtruth, so that a training data set can be obtained.
[0069] S302. Train the image recognition model according to the sample image and the joint training loss function to obtain a trained image recognition model, wherein the joint training loss function includes a limb point recognition loss and a contour point recognition loss.
[0070] In this embodiment, the image recognition model is trained based on the training data. Since the image recognition model can handle the recognition tasks of limb points and contour points at the same time, it is equivalent to the joint training of the two tasks. Each recognition task has a certain loss. Therefore, the loss function in the training process needs to combine the losses of the two tasks, that is, the joint training loss function is obtained based on the limb point recognition loss and the contour point recognition loss, and the image recognition model is adjusted according to the joint training loss function.
[0071] Specifically, when the joint model is trained based on the training data, the joint model obtains the predicted limb point recognition results and the predicted contour point recognition results based on the sample image, and obtains the limb point recognition loss L based on the predicted limb point recognition results and the limb point labels corresponding to the sample image (such as the sample limb point heat map (groundtruth)). 肢 Based on the predicted contour point recognition results and the contour point labels corresponding to the sample image (such as the sample contour point heat map (groundtruth)), the contour point recognition loss L is obtained. 轮 ; Then the limb point recognition loss L 肢 And perform weighted summation to obtain the joint training loss function L, which is calculated as follows: L = a*L 轮 +L 肢
[0072] Among them, a represents the contour point recognition loss L 轮 The weight is the limb point recognition loss L 肢 a times the weight of , where a can be set according to actual conditions.
[0073] The training method of the image recognition model of this embodiment can achieve good recognition effects for both limb point and contour point recognition tasks through joint training. Compared with training two recognition models separately, joint training is more efficient and less costly, and the recognition effect is no less than that of two separate recognition models.
[0074] Based on any of the above embodiments, the limb point labels and contour point labels annotated on the sample images can all be manually annotated, that is, the limb point labels and contour point labels are all real labels, but this consumes a lot of manpower costs; of course, they can also be automatically annotated using a specific algorithm. In particular, there may be a part of the sample images that are only annotated with limb point labels, and a part of the sample images that are only annotated with contour point labels. In this case, obtaining sample images annotated with both limb point labels and contour point labels may specifically include:
[0075] Acquire multiple first sample images and multiple second sample images, wherein the first sample images are annotated with limb point labels, and the second sample images are annotated with contour point labels;
[0076] A limb point recognition model is trained according to the first sample image, limb points in the second sample image are identified according to the limb point recognition model, and limb point pseudo-labels are added to the identified limb points, wherein the limb point recognition model is a model used alone to identify limb points, wherein the limb point recognition model can be a large model. Since the first sample image is accurately annotated with limb point labels, the trained limb point recognition model is a large model. The large model itself has a strong learning ability and can therefore achieve more accurate recognition under limited label conditions, and can be used to automatically annotate the second sample image with limb point pseudo-labels.
[0077] A contour point recognition model is trained based on the second sample image, contour points in the first sample image are identified based on the contour point recognition model, and contour point pseudo-labels are added to the identified contour points, wherein the contour point recognition model is a model used alone to identify contour points, wherein the contour point recognition model can be a large model. Since the second sample image is accurately annotated with contour point labels, the trained contour point recognition model is a large model, and the large model itself has a strong learning ability. Therefore, it can achieve more accurate recognition under limited labels and can be used to automatically annotate contour point pseudo-labels for the first sample image.
[0078] In this embodiment, all sample images can be labeled with limb point labels and contour point labels by labeling pseudo labels, which solves the problem that some sample images have only one label and ensures the amount of training data.
[0079] Based on the above embodiment, although the first sample image and the second sample image are both annotated with limb point labels and contour point labels, the pseudo-labels are annotated by the model and may be inaccurate. Therefore, when setting the weights of the limb point recognition loss and the contour point recognition loss in the joint training loss function, it is necessary to consider the number of first sample images and second sample images to avoid model imbalance. Specifically, if there are more first sample images than second sample images, the weight of the limb point recognition loss is less than the weight of the contour point recognition loss; if there are fewer first sample images than second sample images, the weight of the limb point recognition loss is greater than the weight of the contour point recognition loss.
[0080] For example, it is usually easier to label limb points than contour points, so the first sample image is much more than the second sample image (possibly more than 10 times). In order to avoid the model being inclined to the limb point recognition task during joint training, resulting in more accurate limb point recognition task and inaccurate contour point recognition task, the weight of the limb point recognition loss can be set to be smaller than the weight of the contour point recognition loss. For example, in the above embodiment, the calculation formula L=a*L 轮 +L 肢 , a can be taken as 3, which is the contour point recognition loss L轮 The weight is the limb point recognition loss L 肢 3 times the weight of , which makes the model training process more balanced, and both the limb point recognition task and the contour point recognition task can be accurate.
[0081] Based on the above embodiment, considering that the pseudo labels in the first sample image and the second sample image may be inaccurate, it is necessary to attenuate the loss related to the pseudo labels to reduce the impact of the pseudo labels on the joint training, as follows:
[0082] If the sample image used for training is the first sample image with added contour point pseudo-labels, that is, the corresponding limb point labels are accurate, but the contour point labels are uncertain in accuracy, the limb point recognition loss is accurate, but the contour point recognition loss is uncertain in accuracy. The weight of the contour point recognition loss can be attenuated, for example, reduced by 0.5 times;
[0083] If the sample image used for training is the second sample image with limb point pseudo-labels added, that is, the corresponding contour point labels are accurate, but the limb point labels are uncertain in accuracy, therefore the contour point recognition loss is accurate, but the limb point recognition loss is uncertain in accuracy. The weight of the limb point recognition loss can be attenuated, for example, reduced by 0.5 times.
[0084] Of course, if the limb point labels and contour point labels in the sample image are all true labels (manually labeled or manually confirmed), the weights of the limb point recognition loss and the contour point recognition loss do not need to be attenuated.
[0085] On the basis of any of the above embodiments, in order to improve the recognition effect of limb points and contour points, the current mainstream method adopts mean square loss (MSE (Mean-Square Error) Loss), but the heat map learned by MSE Loss only fits the distribution of the real heat map as much as possible, and does not constrain the distribution of the heat map well, resulting in the heat map being easily misjudged or having multiple peaks. In order to solve this problem, this embodiment proposes a KL (Kullback-Leibler) divergence loss (KL Divergence Loss) to predict the distribution of each key point heat map, as shown in Figure 5: the predicted heat map and the sample heat map (groundtruth) of the human body key points (including limb points and / or contour points) are summed in one-dimensional directions (x and y axis directions), and then the KL divergence loss is used to measure the difference between the predicted and true distributions. As shown in Figure 5, by decomposing the two-dimensional heat map into one dimension, the distribution of the heat map is constrained, the difficulty of fitting the distribution is reduced, and the model can simply and effectively improve the heat map fitting effect and improve the key point recognition effect. Finally, the loss of each key point of the human body (including limb points and / or contour points) is a weighted sum of the mean square loss and the KL divergence loss, and the calculation formula is as follows: L 关键点 =α*L MSE +β*KL_loss x +γ*KL_loss y
[0086] Among them, L MSE Represents mean square loss; KL_loss x Represents the KL divergence loss in the x-axis direction; KL_loss y represents the KL divergence loss in the y-axis direction; α, β, and γ represent weights, which are optional and are 1.0, 0.1, and 0.1 respectively in this embodiment.
[0087] The following uses the limb point recognition loss as an example to illustrate the method. The mean square loss between the predicted limb point heat map and the sample limb point heat map is obtained. The KL divergence loss in the one-dimensional direction is obtained based on the sum of the coordinates of each limb point in the predicted limb point heat map and the sum of the coordinates of each limb point in the sample limb point heat map. The one-dimensional direction includes the x-axis and the y-axis. The weighted sum of the mean square loss and the KL divergence loss in the one-dimensional direction is performed to obtain the limb point recognition loss.
[0088] Taking the contour point recognition loss as an example, the mean square loss between the predicted contour point heat map and the sample contour point heat map is obtained; according to the sum of the coordinates of each contour point in the predicted contour point heat map in the one-dimensional direction and the sum of the coordinates of each contour point in the sample contour point heat map in the one-dimensional direction, the KL divergence loss in the one-dimensional direction is obtained, where the one-dimensional direction includes the x-axis direction and the y-axis direction; the mean square loss and the KL divergence loss in the one-dimensional direction are weightedly summed to obtain the contour point recognition loss.
[0089] By constraining the distribution of heat maps, the joint model can better constrain the limb point heat maps and contour point heat maps, and make the limb point heat maps and contour point heat maps as close to the actual distribution as possible.
[0090] Corresponding to the image recognition method described in the preceding embodiment, FIG6 is a block diagram of an image recognition apparatus provided in an embodiment of the present disclosure. For ease of illustration, only portions relevant to the embodiment of the present disclosure are shown. Referring to FIG6 , the image recognition apparatus 600 includes an acquisition unit 601, a processing unit 602, and a key point determination unit 603.
[0091] The acquisition unit 601 is used to acquire an image to be processed containing a human body;
[0092] Processing unit 602 is configured to input the image to be processed into an image recognition model, the image recognition model comprising a feature extraction module, a limb point decoding module, and a contour point decoding module; the feature extraction module extracts image features from the image to be processed; the limb point decoding module obtains a limb point recognition result based on the image features; and the contour point decoding module obtains a contour point recognition result based on the image features and the limb point recognition result.
[0093] The key point determination unit 603 is configured to determine limb points and contour points in the image to be processed according to the limb point recognition results and the contour point recognition results, respectively.
[0094] In one or more embodiments of the present disclosure, when the limb point decoding module obtains the limb point recognition result according to the image feature, the processing unit 602 is configured to:
[0095] The limb point decoding module obtains a limb point heat map according to the image features, and determines the limb point heat map as the limb point recognition result;
[0096] The contour point decoding module obtains a contour point recognition result according to the image feature and the limb point recognition result, including:
[0097] The contour point decoding module fuses the image features and the limb point heat map, obtains a contour point heat map according to the fusion result, and determines the contour point heat map as the limb point recognition result.
[0098] In one or more embodiments of the present disclosure, as shown in FIG7 , the image recognition apparatus 600 further includes a training unit 604 configured to:
[0099] Acquire multiple sample images containing human bodies, wherein the sample images are annotated with limb point labels and contour point labels; train an image recognition model based on the sample images and a joint training loss function to obtain a trained image recognition model, wherein the joint training loss function includes a limb point recognition loss and a contour point recognition loss.
[0100] In one or more embodiments of the present disclosure, when acquiring a plurality of sample images containing human bodies, the training unit 604 is configured to:
[0101] Acquire a plurality of first sample images and a plurality of second sample images, wherein the first sample images are annotated with limb point labels, and the second sample images are annotated with contour point labels;
[0102] Training a limb point recognition model according to the first sample image, identifying limb points in the second sample image according to the limb point recognition model, and adding limb point pseudo labels to the identified limb points;
[0103] A contour point recognition model is trained according to the second sample image, contour points in the first sample image are identified according to the contour point recognition model, and contour point pseudo labels are added to the identified contour points.
[0104] In one or more embodiments of the present disclosure, when training the image recognition model according to the sample image and the joint training loss function, the training unit 604 is further configured to:
[0105] Obtaining the limb point recognition loss based on the predicted limb point recognition result obtained by the joint model according to the sample image and the limb point label corresponding to the sample image;
[0106] Obtaining the contour point recognition loss based on the predicted contour point recognition result obtained by the joint model according to the sample image and the contour point label corresponding to the sample image;
[0107] The limb point recognition loss and the contour point recognition loss are weightedly summed to obtain the joint training loss function.
[0108] In one or more embodiments of the present disclosure, the training unit 604 is further configured to:
[0109] Determining weights of the limb point recognition loss and the contour point recognition loss in the joint training loss function according to the number of the first sample images and the second sample images;
[0110] Among them, if the first sample image is more than the second sample image, the weight of the limb point recognition loss is less than the weight of the contour point recognition loss; if the first sample image is less than the second sample image, the weight of the limb point recognition loss is greater than the weight of the contour point recognition loss.
[0111] In one or more embodiments of the present disclosure, the training unit 604 is further configured to:
[0112] If the sample image is the first sample image to which contour point pseudo labels are added, the weight of the contour point recognition loss is attenuated; or
[0113] If the sample image is the second sample image with limb point pseudo labels added, the weight of the limb point recognition loss is attenuated.
[0114] In one or more embodiments of the present disclosure, the limb point labels annotated in the sample image are represented by a sample limb point heat map, and the contour point labels are represented by a sample contour point heat map;
[0115] The predicted limb point recognition result is a predicted limb point heat map; the predicted contour point recognition result is a predicted contour point heat map.
[0116] In one or more embodiments of the present disclosure, the training unit 604 is further configured to:
[0117] Obtaining the mean square loss between the predicted human body key point heat map and the sample human body key point heat map; wherein the human body key points include limb points and / or contour points;
[0118] Obtaining a KL divergence loss in one dimension according to the sum of coordinates of each human key point in the predicted human key point heat map in one dimension and the sum of coordinates of each human key point in the sample human key point heat map in one dimension; wherein the one dimension includes an x-axis direction and a y-axis direction;
[0119] The mean square loss and the KL divergence loss in the one-dimensional direction are weightedly summed to obtain the human key point recognition loss.
[0120] The image recognition device provided in this embodiment can be used to execute the technical solution of the above-mentioned image recognition method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.
[0121] Referring to FIG8 , a schematic diagram of the structure of an electronic device 800 suitable for implementing an embodiment of the present disclosure is shown. The electronic device 800 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG8 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.
[0122] As shown in Figure 8, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the electronic device 800 are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0123] Typically, the following devices may be connected to the I / O interface 805: an input device 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although FIG8 shows an electronic device 800 having various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0124] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of any embodiment of the present disclosure are performed.
[0125] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0126] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0127] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in any one of the above embodiments.
[0128] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).
[0129] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0130] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0131] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0132] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0133] It should be noted that the user information (including but not limited to images of the human body, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0134] In a first aspect, according to one or more embodiments of the present disclosure, there is provided an image recognition method, comprising:
[0135] Acquire an image to be processed containing a human body;
[0136] Inputting the image to be processed into an image recognition model, wherein the image recognition model includes a feature extraction module, a limb point decoding module and a contour point decoding module;
[0137] The feature extraction module extracts image features from the image to be processed;
[0138] The limb point decoding module obtains a limb point recognition result according to the image features;
[0139] The contour point decoding module obtains a contour point recognition result according to the image feature and the limb point recognition result;
[0140] Limb points and contour points are respectively determined in the image to be processed according to the limb point recognition results and the contour point recognition results.
[0141] According to one or more embodiments of the present disclosure, the limb point decoding module obtaining a limb point recognition result according to the image feature includes:
[0142] The limb point decoding module obtains a limb point heat map according to the image features, and determines the limb point heat map as the limb point recognition result;
[0143] The contour point decoding module obtains a contour point recognition result according to the image feature and the limb point recognition result, including:
[0144] The contour point decoding module fuses the image features and the limb point heat map, obtains a contour point heat map according to the fusion result, and determines the contour point heat map as the limb point recognition result.
[0145] According to one or more embodiments of the present disclosure, the training process of the image recognition model includes:
[0146] Acquire multiple sample images containing human bodies, wherein the sample images are annotated with limb point labels and contour point labels; train an image recognition model based on the sample images and a joint training loss function to obtain a trained image recognition model, wherein the joint training loss function includes a limb point recognition loss and a contour point recognition loss.
[0147] According to one or more embodiments of the present disclosure, acquiring a plurality of sample images containing a human body includes:
[0148] Acquire a plurality of first sample images and a plurality of second sample images, wherein the first sample images are annotated with limb point labels, and the second sample images are annotated with contour point labels;
[0149] Training a limb point recognition model according to the first sample image, identifying limb points in the second sample image according to the limb point recognition model, and adding limb point pseudo labels to the identified limb points;
[0150] A contour point recognition model is trained according to the second sample image, contour points in the first sample image are identified according to the contour point recognition model, and contour point pseudo labels are added to the identified contour points.
[0151] According to one or more embodiments of the present disclosure, when the image recognition model is trained according to the sample image and the joint training loss function, the method further includes:
[0152] Obtaining the limb point recognition loss based on the predicted limb point recognition result obtained by the joint model according to the sample image and the limb point label corresponding to the sample image;
[0153] Obtaining the contour point recognition loss based on the predicted contour point recognition result obtained by the joint model according to the sample image and the contour point label corresponding to the sample image;
[0154] The limb point recognition loss and the contour point recognition loss are weightedly summed to obtain the joint training loss function.
[0155] According to one or more embodiments of the present disclosure, the method further includes:
[0156] Determining weights of the limb point recognition loss and the contour point recognition loss in the joint training loss function according to the number of the first sample images and the second sample images;
[0157] Among them, if the first sample image is more than the second sample image, the weight of the limb point recognition loss is less than the weight of the contour point recognition loss; if the first sample image is less than the second sample image, the weight of the limb point recognition loss is greater than the weight of the contour point recognition loss.
[0158] According to one or more embodiments of the present disclosure, the method includes:
[0159] If the sample image is the first sample image to which contour point pseudo labels are added, the weight of the contour point recognition loss is attenuated; or
[0160] If the sample image is the second sample image with limb point pseudo labels added, the weight of the limb point recognition loss is attenuated.
[0161] According to one or more embodiments of the present disclosure, the limb point labels annotated in the sample image are represented by a sample limb point heat map, and the contour point labels are represented by a sample contour point heat map;
[0162] The predicted limb point recognition result is a predicted limb point heat map; the predicted contour point recognition result is a predicted contour point heat map.
[0163] According to one or more embodiments of the present disclosure, the method further includes:
[0164] Obtaining the mean square loss between the predicted human body key point heat map and the sample human body key point heat map; wherein the human body key points include limb points and / or contour points;
[0165] Obtaining a KL divergence loss in one dimension according to the sum of coordinates of each human key point in the predicted human key point heat map in one dimension and the sum of coordinates of each human key point in the sample human key point heat map in one dimension; wherein the one dimension includes an x-axis direction and a y-axis direction;
[0166] The mean square loss and the KL divergence loss in the one-dimensional direction are weightedly summed to obtain the human key point recognition loss.
[0167] In a second aspect, according to one or more embodiments of the present disclosure, there is provided an image recognition device, comprising:
[0168] An acquisition unit, configured to acquire an image to be processed containing a human body;
[0169] a processing unit configured to input the image to be processed into an image recognition model, the image recognition model comprising a feature extraction module, a limb point decoding module, and a contour point decoding module; the feature extraction module extracting image features from the image to be processed; the limb point decoding module obtaining a limb point recognition result based on the image features; and the contour point decoding module obtaining a contour point recognition result based on the image features and the limb point recognition result;
[0170] A key point determination unit is used to determine limb points and contour points in the image to be processed according to the limb point recognition result and the contour point recognition result respectively.
[0171] According to one or more embodiments of the present disclosure, when the limb point decoding module obtains a limb point recognition result according to the image feature, the processing unit is configured to:
[0172] The limb point decoding module obtains a limb point heat map according to the image features, and determines the limb point heat map as the limb point recognition result;
[0173] The contour point decoding module obtains a contour point recognition result according to the image feature and the limb point recognition result, including:
[0174] The contour point decoding module fuses the image features and the limb point heat map, obtains a contour point heat map according to the fusion result, and determines the contour point heat map as the limb point recognition result.
[0175] According to one or more embodiments of the present disclosure, the apparatus further includes a training unit configured to:
[0176] Acquire multiple sample images containing human bodies, wherein the sample images are annotated with limb point labels and contour point labels; train an image recognition model based on the sample images and a joint training loss function to obtain a trained image recognition model, wherein the joint training loss function includes a limb point recognition loss and a contour point recognition loss.
[0177] According to one or more embodiments of the present disclosure, when acquiring a plurality of sample images containing a human body, the training unit is configured to:
[0178] Acquire a plurality of first sample images and a plurality of second sample images, wherein the first sample images are annotated with limb point labels, and the second sample images are annotated with contour point labels;
[0179] Training a limb point recognition model according to the first sample image, identifying limb points in the second sample image according to the limb point recognition model, and adding limb point pseudo labels to the identified limb points;
[0180] A contour point recognition model is trained according to the second sample image, contour points in the first sample image are identified according to the contour point recognition model, and contour point pseudo labels are added to the identified contour points.
[0181] According to one or more embodiments of the present disclosure, when the training unit trains the image recognition model according to the sample image and the joint training loss function, it is further configured to:
[0182] Obtaining the limb point recognition loss based on the predicted limb point recognition result obtained by the joint model according to the sample image and the limb point label corresponding to the sample image;
[0183] Obtaining the contour point recognition loss based on the predicted contour point recognition result obtained by the joint model according to the sample image and the contour point label corresponding to the sample image;
[0184] The limb point recognition loss and the contour point recognition loss are weightedly summed to obtain the joint training loss function.
[0185] According to one or more embodiments of the present disclosure, the training unit is further configured to:
[0186] Determining weights of the limb point recognition loss and the contour point recognition loss in the joint training loss function according to the number of the first sample images and the second sample images;
[0187] Among them, if the first sample image is more than the second sample image, the weight of the limb point recognition loss is less than the weight of the contour point recognition loss; if the first sample image is less than the second sample image, the weight of the limb point recognition loss is greater than the weight of the contour point recognition loss.
[0188] According to one or more embodiments of the present disclosure, the training unit is further configured to:
[0189] If the sample image is the first sample image to which contour point pseudo labels are added, the weight of the contour point recognition loss is attenuated; or
[0190] If the sample image is the second sample image with limb point pseudo labels added, the weight of the limb point recognition loss is attenuated.
[0191] According to one or more embodiments of the present disclosure, the limb point labels annotated in the sample image are represented by a sample limb point heat map, and the contour point labels are represented by a sample contour point heat map;
[0192] The predicted limb point recognition result is a predicted limb point heat map; the predicted contour point recognition result is a predicted contour point heat map.
[0193] According to one or more embodiments of the present disclosure, the training unit is further configured to:
[0194] Obtaining the mean square loss between the predicted human body key point heat map and the sample human body key point heat map; wherein the human body key points include limb points and / or contour points;
[0195] Obtaining a KL divergence loss in one dimension according to the sum of coordinates of each human key point in the predicted human key point heat map in one dimension and the sum of coordinates of each human key point in the sample human key point heat map in one dimension; wherein the one dimension includes an x-axis direction and a y-axis direction;
[0196] The mean square loss and the KL divergence loss in the one-dimensional direction are weightedly summed to obtain the human key point recognition loss.
[0197] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;
[0198] The memory stores computer-executable instructions;
[0199] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the image recognition method described in the first aspect and various possible designs of the first aspect.
[0200] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the image recognition method described in the first aspect and various possible designs of the first aspect is implemented.
[0201] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, comprising computer-executable instructions. When a processor executes the computer-executable instructions, the image recognition method as described in the first aspect and various possible designs of the first aspect is implemented.
[0202] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0203] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0204] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. An image recognition method, comprising: Acquire an image to be processed containing a human body; Inputting the image to be processed into an image recognition model, wherein the image recognition model includes a feature extraction module, a limb point decoding module and a contour point decoding module; The feature extraction module extracts image features from the image to be processed; The limb point decoding module obtains a limb point recognition result according to the image features; The contour point decoding module obtains a contour point recognition result according to the image feature and the limb point recognition result; According to the limb point recognition result and the contour point recognition result, limb points and contour points are respectively determined in the image to be processed.
2. The method according to claim 1, wherein: The obtaining of the limb point recognition result by the limb point decoding module according to the image feature includes: The limb point decoding module obtains a limb point heat map according to the image features, and determines the limb point heat map as the limb point recognition result; The contour point decoding module obtains the contour point recognition result according to the image feature and the limb point recognition result, including: The image features and the limb point heat map are fused by the contour point decoding module, a contour point heat map is obtained according to the fusion result, and the contour point heat map is determined as the limb point recognition result.
3. The method according to claim 1 or 2, wherein: The training process of the image recognition model includes: Acquire multiple sample images containing human bodies, wherein the sample images are annotated with limb point labels and contour point labels; The image recognition model is trained according to the sample image and the joint training loss function to obtain a trained image recognition model, wherein the joint training loss function includes a limb point recognition loss and a contour point recognition loss.
4. The method according to claim 3, wherein: The obtaining of a plurality of sample images containing human bodies comprises: Acquire a plurality of first sample images and a plurality of second sample images, wherein the first sample images are annotated with limb point labels, and the second sample images are annotated with contour point labels; training a limb point recognition model according to the first sample image, identifying limb points in the second sample image according to the limb point recognition model, and adding limb point pseudo labels to the identified limb points; A contour point recognition model is trained according to the second sample image, and the first Contour points in the sample image and add contour point pseudo labels to the identified contour points.
5. The method according to claim 3 or 4, wherein: When the image recognition model is trained according to the sample image and the joint training loss function, it also includes: Obtaining the limb point recognition loss based on the predicted limb point recognition result obtained by the joint model according to the sample image and the limb point label corresponding to the sample image; Obtaining the contour point recognition loss based on the predicted contour point recognition result obtained by the joint model according to the sample image and the contour point label corresponding to the sample image; The limb point recognition loss and the contour point recognition loss are weightedly summed to obtain the joint training loss function.
6. The method according to claim 4, wherein: The method further comprises: Determining weights of the limb point recognition loss and the contour point recognition loss in the joint training loss function according to the number of the first sample images and the second sample images; Among them, if the first sample image is more than the second sample image, the weight of the limb point recognition loss is less than the weight of the contour point recognition loss; if the first sample image is less than the second sample image, the weight of the limb point recognition loss is greater than the weight of the contour point recognition loss.
7. The method according to claim 4 or 6, wherein: The method comprises: If the sample image is the first sample image to which contour point pseudo labels are added, the weight of the contour point recognition loss is attenuated; or If the sample image is the second sample image with limb point pseudo labels added, the weight of the limb point recognition loss is attenuated.
8. The method according to claim 5, wherein: The limb point labels annotated in the sample image are represented by a sample limb point heat map, and the contour point labels are represented by a sample contour point heat map; The predicted limb point recognition result is the predicted limb point heat map; the predicted contour point recognition result is the predicted contour point heat map.
9. The method according to claim 8, wherein: Also includes: Obtaining the mean square loss between the predicted human body key point heat map and the sample human body key point heat map; The key points of the human body include limb points and / or contour points; Obtain the KL divergence loss in one dimension according to the sum of coordinates of each human key point in the predicted human key point heat map in one dimension and the sum of coordinates of each human key point in the sample human key point heat map in one dimension; The one-dimensional direction includes an x-axis direction and a y-axis direction; The mean square loss and the KL divergence loss in one-dimensional direction are weightedly summed to obtain the human key point recognition loss.
10. An image recognition device, comprising: An acquisition unit, used for acquiring an image to be processed containing a human body; A processing unit is used to input the image to be processed into an image recognition model, wherein the image recognition model includes a feature extraction module, a limb point decoding module and a contour point decoding module; the feature extraction module extracts image features from the image to be processed; the limb point decoding module obtains a limb point recognition result according to the image features; and the contour point decoding module obtains a contour point recognition result according to the image features and the limb point recognition result; A key point determination unit is used to determine limb points and contour points in the image to be processed according to the limb point recognition result and the contour point recognition result respectively.
11. An electronic device, comprising: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the method according to any one of claims 1 to 9 is implemented.
13. A computer program product, comprising computer executable instructions, and when a processor executes the computer executable instructions, the method according to any one of claims 1 to 9 is implemented.
14. A computer program, when a processor executes the computer program, implements the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Image recognition method and device, electronic equipment and storage medium
CN111783626A
Action recognition method and device based on skeleton point distance, equipment and storage medium
CN114724241A
Key point identification method and device, model training method and device and storage medium
CN115482425A
Method and apparatus for training pose recognition model, and method and apparatus for image recognition
US20210279456A1
