Image recognition method and device, storage medium and program product
By combining feature extraction and decoding modules in the image recognition model, the simultaneous recognition of limb points and contour points in human body images is achieved, which solves the problem of insufficient human edge detection in the existing technology and improves body beautification, action understanding and behavior recognition. performance.
Patent Information
- Application Number
- CN202310309219.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-24
- Publication Date
- 2024-09-24
AI Technical Summary
In the existing technology, human body key point detection mainly relies on human body posture estimation, lacks accurate identification and contour detection of human body edge key points, and cannot completely analyze various parts of the human body, resulting in poor performance in body beautification, action understanding, and behavior recognition tasks.
Provide an image recognition method by obtaining the image to be processed and inputting the image recognition model. The model includes a feature extraction module, a limb point decoding module and a contour point decoding module. It simultaneously identifies limb points and contour points and combines feature extraction and decoding. The fusion of modules enables accurate detection of human body edge contours.
It achieves simultaneous recognition of limb points and contour points in human body images, takes less time, and has higher processing efficiency. It supports real-time performance in tasks such as body contouring, action understanding, and behavior recognition, and provides stronger semantic information.
Smart Images

Figure CN118692136A
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer and network communication technology, and in particular, to an image recognition method, device, storage medium, and program product. Background Art
[0002] In the tasks of 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 the key points of the human body in the image.
[0003] In the prior art, most of the key point detection related to the human body is human pose estimation, which usually mainly identifies the positions of 17 key points of the human body, such as eyes, nose, ears, shoulders, elbows, wrists, etc. Figure 1a As shown, there is a rough estimate of the human skeleton, but this method lacks accurate recognition of key points on the edge of the human body, does not have the detection technology for the edge contour of the human body, cannot fully analyze various parts of the human body, and cannot well support tasks such as body beauty (slimming, slimming legs), motion understanding, and behavior recognition. Summary of the invention
[0004] 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.
[0005] In a first aspect, an embodiment of the present disclosure provides an image recognition method, including:
[0006] Acquire an image to be processed containing a human body;
[0007] 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;
[0008] The feature extraction module extracts image features from the image to be processed;
[0009] The limb point decoding module obtains a limb point recognition result according to the image features;
[0010] The contour point decoding module obtains a contour point recognition result according to the image feature and the limb point recognition result;
[0011] 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.
[0012] In a second aspect, an embodiment of the present disclosure provides an image recognition device, including:
[0013] An acquisition unit, used for acquiring an image to be processed containing a human body;
[0014] 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;
[0015] 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.
[0016] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;
[0017] The memory stores computer-executable instructions;
[0018] 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.
[0019] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the image recognition method described in the first aspect and various possible designs of the first aspect is implemented.
[0020] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including computer execution instructions. When a processor executes the computer execution instructions, the image recognition method described in the first aspect and various possible designs of the first aspect is implemented.
[0021] 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, the image recognition model including 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 respectively according to the limb point recognition result and the contour point recognition result. The embodiments of the present disclosure can simultaneously realize the recognition tasks of limb points and contour points in the image to be processed containing a human body through the image recognition model, and completely analyze various parts of the human body, which takes less time and has higher processing efficiency, and provides stable technical support for subsequent body beautification, action understanding, behavior recognition, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0023] Figure 1a This is an example diagram of human limb points;
[0024] Figure 1b An example diagram of human body contour points provided by an embodiment of the present disclosure;
[0025] Figure 2 A schematic diagram of the image recognition method flow provided by an embodiment of the present disclosure;
[0026] Figure 3 A schematic diagram of the structure of an image recognition model provided by an embodiment of the present disclosure;
[0027] Figure 4 A flowchart of a training method for an image recognition model provided in one embodiment of the present disclosure;
[0028] Figure 5 A schematic diagram of loss composition provided for an embodiment of the present disclosure;
[0029] Figure 6 A structural block diagram of an image recognition device provided by an embodiment of the present disclosure;
[0030] Figure 7 A structural block diagram of an image recognition device provided by another embodiment of the present disclosure;
[0031] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0033] In the tasks of 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 the key points of the human body in the image.
[0034] In the prior art, most of the key point detection related to the human body is human pose estimation, which usually mainly identifies the positions of key points (limb points) such as eyes, nose, ears, shoulders, elbows, wrists, etc. Figure 1a The limb points in the schematic diagram provide a rough estimate of the human skeleton, but this method lacks accurate recognition of key points on the human body edges, does not have the technology to detect the human body edge contours, cannot fully analyze various parts of the human body, and cannot well support tasks such as body beauty (slimming, leg slimming), motion understanding, and behavior recognition.
[0035] In order to support tasks such as body beautification (slimming, leg slimming), motion understanding, and behavior recognition, it is also necessary to detect the edge contours of the human body image, for example Figure 1b The edge points in the schematic diagram shown, and the detection of human body edge contours in the prior art mostly utilizes traditional image processing methods to extract the features of relevant edge information to obtain the human body contour. 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 the two tasks takes a long time, resulting in the performance of downstream tasks such as body beautification (slimming, slimming legs), action understanding, and behavior recognition failing to achieve real-time effects. 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.
[0036] In order to save time and improve processing efficiency, the present disclosure considers identifying limb points and contour points of an image to be processed containing a human body at the same time. Therefore, the present disclosure provides an image recognition method, which is obtained by obtaining an image to be processed containing a human body; inputting the image to be processed into an image recognition model, the image recognition model including 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 limb point recognition results according to the image features; the contour point decoding module obtains contour point recognition results according to the image features and the limb point recognition results; and the 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. This embodiment can simultaneously realize the recognition tasks of limb points and contour points in the image to be processed containing a human body through the image recognition model, and completely analyze various parts of the human body. It saves time and improves processing efficiency, and provides stable technical support for subsequent body beauty, action understanding, behavior recognition, etc.
[0037] The present invention studies and statistics the human body contour. The human body contour can be formed by connecting multiple contour points, such as Figure 1b As shown, for example, 1-4 are head contour points, 5-8 are arm contour points, and by connecting these key points in sequence, a rough outline of the human body edge is formed, and it has strong semantic information.
[0038] One application scenario of the image recognition method disclosed herein is application in a terminal device or a server.
[0039] Optionally, if the image recognition method is applied to a terminal device (such as a mobile phone, a 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;
[0040] 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.
[0041] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present 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.
[0042] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0043] As an optional but non-limiting implementation, in response to receiving an active request from the user, 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. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0044] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0045] The image recognition method disclosed in the present invention will be described in detail below in conjunction with specific embodiments.
[0046] refer to Figure 2 , Figure 2 A flowchart 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:
[0047] S201, obtaining an image to be processed containing a human body.
[0048] In this embodiment, the image to be processed containing the human body can be captured by an image capture device, or the image to be processed containing the human body transmitted by other devices can be received, or the image to be processed containing the human body stored in a storage unit can be read, or the image to be processed containing the human body can be obtained by other means, which will not be repeated here.
[0049] S202, 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.
[0050] In this embodiment, in order to avoid the need for two separate recognition models to serially recognize limb points and contour points in the image to be processed, which is time-consuming and slow to process, an image recognition model can be constructed and trained to simultaneously realize the recognition tasks of limb points and contour points in one model. Optionally, the joint model can be a convolutional neural network model.
[0051] Optional, such as Figure 3As shown, 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, which can be used to extract image features from the processed image; the limb point decoding module and the contour point decoding module are recognition modules for realizing the recognition tasks of limb points and contour points respectively, 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, and the contour point decoding module can output contour point recognition results, and optionally, the contour point recognition results can be contour point heatmaps, and the limb point decoding module and the contour point decoding module can adopt a network structure that can realize the key point heatmap method.
[0052] 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 result and the contour point recognition result.
[0053] S203: The feature extraction module extracts image features from the image to be processed.
[0054] 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.
[0055] S204: The limb point decoding module obtains a limb point recognition result according to the image features.
[0056] In this embodiment, the image features are input into the limb point decoding module, and the limb point decoding module obtains the limb point recognition result according to the image features. Optionally, the limb point decoding module can obtain the limb point heat map according to the image features and determine the limb point heat map as the limb point recognition result.
[0057] S205 , the contour point decoding module obtains a contour point recognition result according to the image feature and the limb point recognition result.
[0058] In this embodiment, considering that limb points have stronger semantic information than contour points, the learning difficulty is relatively low, and there is a strong intuitive association with human body contour points, after obtaining the limb point recognition results according to the image features, the contour point decoding module can be guided to learn the contour point features according to the image features and the limb point recognition results, that is, the contour point recognition results are obtained according to the image features and the limb point recognition results, so that the contour points also have strong semantic information, for example, the contours of the left and right hands, the edge positions of the abdomen, the edge positions of the legs, etc. can be accurately known, providing basic capabilities for subsequent automated body beauty (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 according to the fusion results. In order to simply and effectively improve the effect, the feature fusion here adopts a simple splicing method (concat), and the image features related to the limb point recognition results (obtained by detaching the limb point recognition results) can be concat spliced.
[0059] S206 , determining limb points and contour points in the image to be processed respectively according to the limb point recognition result and the contour point recognition result.
[0060] 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.
[0061] The image recognition method provided in this embodiment is as follows: 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 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; and according to the limb point recognition result and the contour point recognition result, the limb points and contour points are respectively determined in the image to be processed. Through the image recognition model, this embodiment can simultaneously realize the recognition tasks of limb points and contour points in the image to be processed containing a human body, 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, motion understanding, behavior recognition, etc.
[0062] refer to Figure 4 , Figure 4A flowchart of a training method for an image recognition model provided in an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device or a server, which can be a terminal device or a 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:
[0063] S301, obtaining a plurality of sample images containing human bodies, wherein the sample images are annotated with limb point labels and contour point labels.
[0064] In this embodiment, since the image recognition model in the above embodiment can handle the recognition tasks of limb points and contour points at the same time, the sample images containing human bodies used to train the joint model also need to be labeled with limb point labels and contour point labels at the same time. In this embodiment, there is no limitation on the acquisition method of the sample images, and there is no limitation on the labeling method, for example, manual labeling can be used.
[0065] 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 labels annotated in the sample image are represented by the sample limb point heat map, and the contour point labels are represented by the 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 the sample image and the corresponding sample limb point heat map and sample contour point heat map can be used as a set of training data.
[0066] 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, wherein 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 groundtruth, so that a training data set can be obtained.
[0067] 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.
[0068] 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.
[0069] Specifically, when the joint model is trained according to the training data, the joint model obtains the predicted limb point recognition results and the predicted contour point recognition results according to 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)), obtain the contour point recognition loss L 轮 ; Then the limb point recognition loss L 肢 And perform weighted summation to obtain the joint training loss function L, which is calculated as follows:
[0070] L=a*L 轮 +L 肢
[0071] 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.
[0072] 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. The joint training is more efficient and less costly than training two recognition models separately, and the recognition effect is no less than that of two separate recognition models.
[0073] On the basis of any of the above embodiments, the limb point labels and contour point labels annotated on the sample images may all be manually annotated, that is, the limb point labels and contour point labels are all real labels, but a large amount of manpower cost is consumed; of course, they may also be automatically annotated through a specific algorithm. In particular, there may be a part of the sample images only annotated with limb point labels, and a part of the sample images 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:
[0074] 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;
[0075] A limb point recognition model is trained according to the first sample image, limb points in the second sample image are recognized according to the limb point recognition model, and limb point pseudo-labels are added to the recognized limb points, wherein the limb point recognition model is a model used alone to recognize limb points, wherein the limb point recognition model may be a large model, since the first sample image is accurately labeled with limb point labels, the trained limb point recognition model is a large model, and the large model itself has a strong learning ability, so it can achieve more accurate recognition under limited labels, and can be used to automatically label the second sample image with limb point pseudo-labels;
[0076] 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, wherein the contour point recognition model is a model used alone to identify contour points, wherein the contour point recognition model may 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.
[0077] 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.
[0078] On the basis of 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 after all 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, the number of the first sample image and the second sample image needs to be considered to avoid the problem of model imbalance. 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.
[0079] 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 3, which is the contour point recognition loss L 轮 The weight is the limb point recognition loss L 肢 The weight of the model is 3 times, which makes the model training process more balanced, and both the limb point recognition task and the contour point recognition task can be accurate.
[0080] On the basis of 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 influence of the pseudo labels on the joint training, as follows:
[0081] 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, and the contour point labels are uncertain in accuracy, so the limb point recognition loss is accurate, and 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;
[0082] If the sample image used for training is the second sample image with added limb point pseudo-labels, that is, the corresponding contour point label is accurate, and the limb point label is uncertain in accuracy, therefore the contour point recognition loss is accurate, and 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.
[0083] Of course, if the limb point labels and contour point labels in the sample image are both true labels (manually labeled or manually confirmed), the weights of the limb point recognition loss and the weights of the contour point recognition loss do not need to be attenuated.
[0084] Based on any of the above embodiments, in order to improve the recognition effect of limb points and contour points, the current mainstream method uses mean square loss (MSE 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 divergence loss (KL Divergence Loss) to predict the distribution of each key point heat map, as shown in the following example. Figure 5As shown in Figure 1, the predicted heat map of human key points (including limb points and / or contour points) and the sample heat map (groundtruth) 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 1. Figure 5 As shown in the figure, 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 the key point recognition effect. Finally, the loss of each key point of the human body (including limb points and / or contour points) is the weighted sum of the mean square loss and the KL divergence loss. The calculation formula is as follows:
[0085] 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 is an example of limb point recognition loss to obtain the mean square loss between the predicted limb point heat map and the sample limb point heat map; according to the sum of the coordinates of each limb point in the predicted limb point heat map in one dimension and the sum of the coordinates of each limb point in the sample limb point heat map in one dimension, obtain the KL divergence loss in the one-dimensional direction, where the one-dimensional direction includes the x-axis direction and the y-axis direction; perform weighted summation on the mean square loss and the KL divergence loss in the one-dimensional direction 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 one dimension and the sum of the coordinates of each contour point in the sample contour point heat map in one dimension, 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 the heat map, the joint model can better constrain the limb point heat map and the contour point heat map, and make the limb point heat map and the contour point heat map as close to the actual distribution as possible.
[0090] Corresponding to the image recognition method of the above embodiment, Figure 6 This is a structural block diagram of an image recognition device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 6 The image recognition device 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] The processing unit 602 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;
[0093] The key point determination unit 603 is used to determine the limb points and the contour points in the image to be processed respectively according to the limb point recognition result and the contour point recognition result.
[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 used 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 the contour point recognition result according to the image feature and the limb point recognition result, including:
[0097] 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.
[0098] In one or more embodiments of the present disclosure, Figure 7 As shown, the image recognition device 600 further includes a training unit 604, which is used 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 according to 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 used 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 recognized according to the contour point recognition model, and contour point pseudo labels are added to the recognized contour points.
[0104] In one or more embodiments of the present disclosure, when the training unit 604 trains the image recognition model according to the sample image and the joint training loss function, it 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] 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, obtaining the KL divergence loss in one dimension; wherein the one dimension direction includes the x-axis direction and the y-axis direction;
[0119] The mean square loss and the KL divergence loss in 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 this embodiment will not be repeated here.
[0121] refer to Figure 8 , which shows a schematic diagram of the structure of an electronic device 800 suitable for implementing the embodiment of the present disclosure, and 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 terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0122] like Figure 8 As shown, 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 to 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: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[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 a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a 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 executed.
[0125] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[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 an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via 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 flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0130] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the 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, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0132] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[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 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] 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.
[0141] According to one or more embodiments of the present disclosure, the limb point decoding module obtains the limb point recognition result according to the image feature, including:
[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 the contour point recognition result according to the image feature and the limb point recognition result, including:
[0144] 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.
[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 according to 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 recognized according to the contour point recognition model, and contour point pseudo labels are added to the recognized 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, it also 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] 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, obtaining the KL divergence loss in one dimension; wherein the one dimension direction includes the x-axis direction and the y-axis direction;
[0166] The mean square loss and the KL divergence loss in 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, used for acquiring an image to be processed containing a human body;
[0169] 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;
[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 the limb point recognition result according to the image feature, the processing unit is used 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 the contour point recognition result according to the image feature and the limb point recognition result, including:
[0174] 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.
[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 according to 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 used 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 recognized according to the contour point recognition model, and contour point pseudo labels are added to the recognized 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 used 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] 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, obtaining the KL divergence loss in one dimension; wherein the one dimension direction includes the x-axis direction and the y-axis direction;
[0196] The mean square loss and the KL divergence loss in 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 execution instructions. When a processor executes the computer execution 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 execution instructions. When a processor executes the computer execution 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 only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[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 are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0204] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. An image recognition method, characterized in that: include: 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, characterized in that: 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, characterized in that: 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, characterized in that 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, contour points in the first sample image are recognized according to the contour point recognition model, and contour point pseudo labels are added to the recognized contour points.
5. The method according to claim 3, characterized in that: 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, characterized in that 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, characterized in that 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, characterized in that 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, characterized in that 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, characterized in that: include: 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, characterized in that: include: 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, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 9 is implemented.
13. A computer program product, characterized in that The method comprises 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.
Citation Information
Patent Citations
Action recognition method and device based on skeleton point distance, equipment and storage medium
CN114724241A
Fish species identification method and system based on contour key points and attention mechanism
CN115527102A
Target detection method and device, equipment and storage medium
CN115761698A
Iterative Data Reweighting for Balanced Model Learning
US20100215255A1
