Attribute recognition method, part attribute extraction network training method and device
By acquiring and fusing attribute features of human body part images, the problem of low pedestrian attribute recognition accuracy in the existing technology is solved, achieving higher recognition accuracy, and is suitable for monitoring and other applications.
Patent Information
- Application Number
- CN202110133441.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-29
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-01-29
AI Technical Summary
Existing pedestrian attribute recognition technology has poor accuracy when identifying attribute features from the overall image area. Especially in surveillance scenes, it is affected by factors such as expression, light, angle, etc., causing body parts to be blocked or blurred, affecting the recognition effect.
By acquiring multiple human body part images of the target object, extract the attribute features in each image, and fuse the features of different human body parts to determine the attribute features of the target object, and use the part attribute extraction network and the whole body attribute extraction network for training and adjustment network parameters to improve recognition accuracy.
It improves the accuracy of recognition results of attribute features, uses local features and detailed information to enhance the recognition effect, and is suitable for monitoring and other application scenarios.
Smart Images

Figure CN112800978B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an attribute recognition method, a training method and a device for a part attribute extraction network. Background Art
[0002] Pedestrian attribute recognition is a technical means of high-level semantic mining of pedestrians. It can summarize rules from large amounts of pedestrian data and is of great significance to various fields. Specifically, pedestrian attribute recognition first detects the target pedestrian from the image, and then identifies the target pedestrian's age, gender, hair, clothing and other attribute features based on the target pedestrian's image area. In this method, it is necessary to identify various attribute features from the overall image area of the target pedestrian, which easily leads to poor accuracy in the recognition results of attribute features. Summary of the invention
[0003] In view of this, an object of the present invention is to provide an attribute recognition method, a training method and a device for a part attribute extraction network, so as to improve the accuracy of the recognition results of attribute features.
[0004] In a first aspect, an embodiment of the present invention provides an attribute recognition method, the method comprising: acquiring multiple human body part images corresponding to a target object; wherein each of the human body part images contains at least one human body part of the target object; extracting attribute features of the human body parts contained in each of the human body part images; and determining the attribute features of the target object based on the attribute features extracted from each of the human body part images.
[0005] In a second aspect, an embodiment of the present invention provides a training method for a part attribute extraction network, the method comprising: obtaining a sample image containing a sample object, and a plurality of human body part images corresponding to the sample object; each of the human body part images contains at least one human body part of the sample object; for each human body part, inputting the human body part image containing the human body part into a part attribute extraction network corresponding to the human body part that has been preliminarily trained, and outputting attribute features of the human body part; inputting the sample image into a whole-body attribute extraction network that has been preliminarily trained, and outputting whole-body attribute features of the sample object; fusing the attribute features of each human body part with the whole-body attribute features to obtain fused features, and determining the attribute features of the sample object based on the fused features; adjusting the network parameters of the part attribute extraction network corresponding to each of the human body parts and the whole-body attribute extraction network based on the attribute features of the sample object and a preset loss function, until the attribute features of the sample object converge, and obtaining the trained part attribute extraction network and the whole-body attribute extraction network corresponding to each of the human body parts.
[0006] In a third aspect, an embodiment of the present invention provides an attribute recognition device, which includes: a first acquisition module, used to acquire multiple human body part images corresponding to a target object; wherein each of the human body part images contains at least one human body part of the target object; an extraction module, used to extract attribute features of the human body parts contained in each of the human body part images; and a first determination module, used to determine the attribute features of the target object based on the attribute features extracted from each of the human body part images.
[0007] In a fourth aspect, an embodiment of the present invention provides a training device for a part attribute extraction network, the device comprising: a second acquisition module, used to acquire a sample image containing a sample object, and a plurality of human body part images corresponding to the sample object; each of the human body part images contains at least one human body part of the sample object; an output module, used to input the human body part image containing the human body part into the part attribute extraction network corresponding to the human body part that has been preliminarily trained, and output the attribute characteristics of the human body part; input the sample image into the whole body attribute extraction network that has been preliminarily trained, and output the whole body attribute characteristics of the sample object; a second determination module, used to fuse the attribute characteristics of each human body part with the whole body attribute characteristics to obtain a fused characteristic, and determine the attribute characteristics of the sample object based on the fused characteristic; an adjustment module, used to adjust the network parameters of the part attribute extraction network corresponding to each of the human body parts and the whole body attribute extraction network based on the attribute characteristics of the sample object and a preset loss function, until the attribute characteristics of the sample object converge, and obtain the trained part attribute extraction network and the whole body attribute extraction network corresponding to each of the human body parts.
[0008] In a fifth aspect, an embodiment of the present invention provides a server comprising a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the attribute recognition method described in any one of the first aspects above, or the training method of the part attribute extraction network described in any one of the second aspects above.
[0009] In a sixth aspect, an embodiment of the present invention provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the attribute recognition method described in any one of the first aspects above, or the training method of the part attribute extraction network described in any one of the second aspects above.
[0010] The attribute recognition method, the training method and the device of the part attribute extraction network provided by the present invention, after acquiring multiple human body part images corresponding to the target object, extract the attribute features of the human body part contained in each human body part image; and then determine the attribute features of the target object based on the extracted attribute features. This method can extract the attribute features of the corresponding human body part through different human body part images. Compared with the method of identifying various types of attribute features from the overall image area of the target pedestrian in the prior art, since the human body part image contains more local features and detail information, the accuracy of the recognition result of the attribute features can be improved.
[0011] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0012] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0014] Figure 1 A flowchart of an attribute identification method provided by an embodiment of the present invention;
[0015] Figure 2 A flowchart of another attribute identification method provided by an embodiment of the present invention;
[0016] Figure 3 A flowchart of another attribute identification method provided by an embodiment of the present invention;
[0017] Figure 4 A flowchart of another attribute identification method provided by an embodiment of the present invention;
[0018] Figure 5 A flowchart of a method for training a part attribute extraction network provided by an embodiment of the present invention;
[0019] Figure 6 A flowchart of another method for training a part attribute extraction network provided by an embodiment of the present invention;
[0020] Figure 7 A pedestrian attribute model training flow chart provided by an embodiment of the present invention;
[0021] Figure 8 A pedestrian attribute model prediction flow chart provided by an embodiment of the present invention;
[0022] Fig. 9 A schematic diagram of the structure of an attribute recognition device provided by an embodiment of the present invention;
[0023] Fig.10 A schematic diagram of the structure of a training device for a part attribute extraction network provided by an embodiment of the present invention;
[0024] Fig.11 A schematic diagram of the structure of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0026] With the development of society, the population flow in public places such as shopping malls and stations has increased rapidly. How to quickly summarize the rules of user behavior from large amounts of data is of great significance to smart city construction, precision advertising, criminal investigation, etc. Pedestrian attribute recognition is a technical means of high-level semantic mining of pedestrians. It detects pedestrian targets from videos and automatically identifies attribute features such as age, gender, hair, and clothing, which facilitates efficient mining of more pedestrian semantic information from surveillance or video. It has a wide range of applications in smart city construction, precision advertising, criminal investigation, etc. In the related art, pedestrian attribute recognition is mostly done by learning the prediction of all attributes from the entire pedestrian image, that is, pedestrian attribute recognition first detects the target pedestrian from the image, and then identifies the target pedestrian's age, gender, hair, clothing and other attribute features based on the target pedestrian's image area. This method requires identifying various attribute features from the overall image area of the target pedestrian, which easily leads to poor accuracy in the recognition results of the attribute features. In addition, in the monitoring scene (camera), it is easily affected by facial expressions, light, angles and other factors, resulting in some parts of the body being blocked or blurred, thereby affecting the recognition effect of the entire pedestrian attribute feature. Based on this, the embodiment of the present invention provides an attribute recognition method, a training method and device for a part attribute extraction network, and the technology can be applied to applications that require the recognition of pedestrian attributes.
[0027] To facilitate understanding of this embodiment, firstly, a method for identifying an attribute disclosed in an embodiment of the present invention is described in detail. Figure 1 As shown, the method comprises the following steps:
[0028] Step S102, obtaining a plurality of human body part images corresponding to the target object; wherein each human body part image contains at least one human body part of the target object.
[0029] The above-mentioned target object can be a target person, such as a pedestrian in a monitoring scene such as a shopping mall, a station or a street; the above-mentioned human body part can be various body parts of the target object, such as the head, upper body or lower body; the above-mentioned human body part image contains one or more human body parts of the target object, for example, the human body part image can be a head image containing only the head, an upper body image containing only the upper body, or an image containing both the head and the upper body; in actual implementation, when it is necessary to identify the attributes of the target object, it is usually necessary to first obtain multiple human body part images of the target object, such as the head image, upper body image or lower body image of the target object, and the specific number of human body part images can be set according to actual needs.
[0030] Step S104, extracting attribute features of the human body parts contained in each human body part image.
[0031] The above-mentioned attribute features usually include color features, shape features, etc. of the corresponding human body parts; in actual implementation, after obtaining multiple human body part images corresponding to the target object, the attribute features of the corresponding human body parts can be extracted from each human body part image; for example, the attribute features corresponding to the head can be extracted from the head image, such as the attribute features corresponding to the gender, hair color, age, etc. contained in the head; the attribute features corresponding to the type of tops, top colors, and upper body accessories such as scarves contained in the upper body can be extracted from the upper body image.
[0032] Step S106, determining the attribute features of the target object based on the attribute features extracted from each human body part image.
[0033] After extracting the attribute features of the human body parts contained in each human body part image, the attribute features of the target object can be determined based on the attribute features extracted from each human body part image corresponding to the target object; for example, the multiple human body part images corresponding to the target object include a head image, an upper body image, and a lower body image, and the attribute features of the entire body of the target object can be determined based on the attribute features of the corresponding human body parts extracted from the head image, the upper body image, and the lower body image.
[0034] An attribute recognition method provided by an embodiment of the present invention extracts the attribute features of the human body parts contained in each human body part image after acquiring multiple human body part images corresponding to the target object; and then determines the attribute features of the target object based on the extracted attribute features. This method can extract the attribute features of the corresponding human body parts through different human body part images. Compared with the method of identifying various types of attribute features from the overall image area of the target pedestrian in the prior art, since the human body part images contain more local features and detail information, the accuracy of the recognition results of the attribute features can be improved.
[0035] The embodiment of the present invention provides another attribute recognition method, which is implemented on the basis of the above embodiment method; the method focuses on the specific process of obtaining multiple human body part images corresponding to the target object, such as Figure 2 As shown, the method comprises the following steps:
[0036] Step S202: acquiring an initial image containing a target object.
[0037] The above-mentioned initial image can be understood as an original image containing the target object, such as an original image containing the target object captured by a surveillance camera, or a picture or photo containing the target object; the initial image is usually an image of all human body parts including the head, upper body and lower body of the target object; in actual implementation, the initial image containing the target object can be obtained first to identify the attributes of the target object based on the initial image.
[0038] Step S204, identifying multiple human body parts of the target object from the initial image to obtain a recognition result.
[0039] After obtaining an initial image containing a target object, the initial image can usually be recognized first to identify multiple human body parts such as the head, upper body or lower body of the target object from the initial image. Specifically, pixel-level labels can be obtained based on the initial image to identify hair, tops, arms, etc.
[0040] Step S206: Based on the recognition result, the initial image is segmented to obtain a human body part image corresponding to each human body part.
[0041] After obtaining the above recognition results, the initial image is usually segmented based on the recognition results. Specifically, the various human body parts of the target object in the initial image can be segmented along the contour. The segmentation processing of the initial image can generally be achieved through a pedestrian segmentation model. In actual implementation, the pedestrian segmentation model can be pre-trained based on the public LIP (Look Into Person, a human semantic parsing dataset) dataset or ART dataset (a dataset that can be used for image recognition, segmentation, annotation and other development work), etc., to extract each human body part of the target object to obtain a human body part image corresponding to each human body part; wherein, the LIP dataset is a picture containing people captured from the COCO (Common Objects in Context) dataset, and the COCO dataset is a dataset that can be used for image recognition, segmentation, annotation and other development work.
[0042] Step S208, extracting the attribute features of the human body part contained in each human body part image.
[0043] Step S210, determining the attribute features of the target object based on the attribute features extracted from each human body part image.
[0044] An attribute recognition method provided by an embodiment of the present invention recognizes multiple human body parts of a target object from an acquired initial image containing the target object to obtain a recognition result; based on the recognition result, the initial image is segmented to obtain a human body part image corresponding to each human body part; the attribute features of the human body part contained in each human body part image are extracted; based on the extracted attribute features, the attribute features of the target object are determined. This method can extract the attribute features of the corresponding human body parts through different human body part images. Compared with the method of recognizing various types of attribute features from the overall image area of the target pedestrian in the prior art, since the human body part image contains more local features and detail information, the accuracy of the recognition result of the attribute features can be improved.
[0045] The embodiment of the present invention provides another attribute recognition method, which is implemented on the basis of the method of the above embodiment; the method focuses on describing the specific process of extracting the attribute characteristics of the human body parts contained in each human body part image, in which each human body part image contains a human body part; for example, each human body part image only contains the head, the upper body or the lower body, etc.; each human body part corresponds to a pre-trained part attribute extraction network; wherein the part attribute extraction network can be a part attribute neural network of the corresponding human body part; the part attribute extraction network corresponding to each human body part is used to extract the attribute characteristics contained in the human body part; for example, the head corresponds to the head attribute neural network, and the head attribute neural network is used to extract the attribute characteristics contained in the head; the upper body corresponds to the upper body attribute neural network, and the upper body attribute neural network is used to extract the attribute characteristics contained in the upper body; the lower body corresponds to the lower body attribute neural network, and the lower body attribute neural network is used to extract the attribute characteristics contained in the lower body; Figure 3 As shown, the method comprises the following steps:
[0046] Step S302, obtaining a plurality of human body part images corresponding to the target object; wherein each human body part image contains at least one human body part of the target object.
[0047] Step S304, for each human body part, input the human body part image corresponding to the human body part into the part attribute extraction network corresponding to the human body part, and output the attribute characteristics of the human body part.
[0048] The above-mentioned part attribute extraction network usually includes a feature extraction subnetwork and an attribute classification subnetwork; wherein, the feature extraction subnetwork can be used to simplify the expression of high-dimensional image data, which can be specifically implemented through a variety of convolutional neural networks, such as residual networks, VGG networks, etc.; the attribute classification subnetwork can be used to integrate the features extracted by the feature extraction subnetwork to classify the image of the human body part, and then obtain the attribute characteristics of the corresponding human body part.
[0049] Specifically, step S304 can be implemented by the following steps 1 and 2:
[0050] Step 1: input the human body part image corresponding to the human body part into the feature extraction subnetwork corresponding to the human body part to obtain the part feature of the human body part.
[0051] In actual implementation, if the human body part is the head, the head image corresponding to the head can be input into the head attribute feature extraction subnetwork to obtain the head part features; for example, the head image can be converted into a three-dimensional neuron in RGB (R: Red; G: Green; B: Blue) format and represented by a 3*112*112 vector, where 3*112*112 can be used to represent a three-channel, 112*112 pixel image; in a computer, these three channels can be used to represent an image; the data of these three channels are spliced together and input into a head attribute convolutional neural network, such as ResNet18 (Residual Network 18) residual network, to obtain a feature map vector of size 512*7*7, where 512*7*7 can represent a 512-channel, 7*7 pixel image.
[0052] If the human body part is the upper body, the upper body image corresponding to the upper body can be input into the upper body feature extraction subnetwork to obtain the part features of the upper body; for example, the upper body image can be converted into a three-dimensional neuron in RGB format, represented by a 3*112*112 vector, and the vector is input into an upper body attribute convolutional neural network, such as a ResNet 18 residual network, to obtain a feature map vector of size 512*7*7.
[0053] If the human body part is the lower body, the lower body image corresponding to the lower body can be input into the lower body feature extraction subnetwork to obtain the part features of the lower body; for example, the lower body image can be converted into a three-dimensional neuron in RGB format, represented by a 3*112*112 vector, and the vector is input into a lower body attribute convolutional neural network, such as a ResNet 18 residual network, to obtain a feature map vector of size 512*7*7.
[0054] Step 2: input the part feature into the attribute classification subnetwork corresponding to the human body part to obtain the attribute feature of the human body part; the attribute feature includes: a first attribute value corresponding to a preset attribute category.
[0055] The above-mentioned preset attribute categories can be understood as a pre-classification of the attributes contained in the target object; for example, the attributes contained in the target object can be organized into several sets, namely, whole body attributes, upper body attributes, lower body attributes and head attributes, etc.; wherein, the whole body attributes include all the attributes of the target object; the above-mentioned first attribute value can be understood as the predicted value corresponding to the attribute category obtained by the feature extraction subnetwork and the attribute classification subnetwork included in the part attribute extraction network; if the human body part is the head, the preset attribute categories may include gender, age, eyes, ears, hair color and length, and whether some head accessories are wearing hats and glasses, etc., and these attribute categories can be judged by the head; usually each attribute category corresponds to a predicted value, so the predicted values of the head attributes usually include multiple; the head part features obtained in the above step 1 can first be pooled through a pooling layer to obtain a 512-dimensional feature, and then through a fully connected layer to obtain a head attribute classification layer, and obtain the attribute features of the head, wherein the attribute features of the head include multiple predicted values corresponding to multiple attribute categories corresponding to the head.
[0056] If the human body part is the upper body, the preset attribute categories may include top type, top color, and upper body accessories such as scarves, etc., and these attribute categories can be judged by the upper body; usually each attribute category corresponds to a prediction value, so the prediction values of the upper body attributes usually include multiple; the upper body part features obtained in the above step one can first be pooled through a pooling layer to obtain a 512-dimensional feature, and then through a fully connected layer to obtain an upper body attribute classification layer, and obtain the attribute features of the upper body, wherein the attribute features of the upper body include multiple prediction values corresponding to multiple attribute categories corresponding to the upper body.
[0057] If the human body part is the lower body, the preset attribute categories may include lower clothing type, lower clothing color, and shoe type and color, etc., and these attribute categories can be judged by the lower body; usually each attribute category corresponds to a prediction value, so the prediction values of the lower body attributes usually include multiple; the part features of the lower body obtained in the above step one can first be pooled through a pooling layer to obtain a 512-dimensional feature, and then through a fully connected layer to obtain a lower body attribute classification layer, and obtain the attribute features of the lower body, wherein the attribute features of the lower body include multiple prediction values corresponding to the multiple attribute categories corresponding to the lower body.
[0058] Step S306, determining the attribute features of the target object based on the attribute features extracted from each human body part image.
[0059] An attribute recognition method provided by an embodiment of the present invention, after obtaining multiple human body part images corresponding to a target object, for each human body part, the human body part image corresponding to the human body part is input into a part attribute extraction network corresponding to the human body part, and the attribute features of the human body part are output. The attribute features of the target object are determined based on the attribute features extracted from each human body part image. This method can extract the attribute features of the corresponding human body part through different human body part images. Compared with the method of identifying various types of attribute features from the overall image area of the target pedestrian in the prior art, since the human body part image contains more local features and detail information, the accuracy of the recognition result of the attribute features can be improved.
[0060] The embodiment of the present invention provides another attribute recognition method, which is implemented on the basis of the above embodiment method; the method focuses on describing the specific process of determining the attribute features of the target object based on the attribute features extracted from each human body part image, in which the attribute features include: a first attribute value corresponding to a preset attribute category; Figure 4 As shown, the method comprises the following steps:
[0061] Step S402, obtaining a plurality of human body part images corresponding to the target object; wherein each human body part image contains at least one human body part of the target object.
[0062] Step S404: extracting attribute features of the human body parts contained in each human body part image.
[0063] Step S406, inputting the initial image containing the target object into a pre-trained whole-body attribute extraction network, and outputting whole-body attribute features of the target object; the whole-body attribute features include attribute features of each body part of the target object.
[0064] The above-mentioned whole-body attribute extraction network can be used to extract the attribute features of each body part in the whole body of the target object; for example, if the initial image containing the target object includes the head, upper body and lower body of the target object, after the initial image is input into the pre-trained whole-body attribute extraction network, the attribute features of the head, upper body and lower body of the target object can be output.
[0065] In actual implementation, the entire pedestrian image can be converted into a three-dimensional neuron in RBG format, represented by a 3*112*112 vector, and input into a pre-trained full-body attribute extraction network, such as the ResNet 18 network, to obtain a 512*7*7 vector of the feature map. A pooling layer is used to obtain a 512-dimensional feature, and then a fully connected layer is used to obtain a pedestrian attribute classification layer, thereby obtaining the attribute characteristics of each body part of the target object.
[0066] Step S408: for each attribute category, if the first attribute value corresponding to the attribute category is greater than or equal to the first preset threshold, it is determined that the target object has the attribute feature corresponding to the attribute category.
[0067] The above-mentioned first preset threshold can be set according to actual needs. The first preset threshold is usually a larger value between 0 and 1. For example, the first preset threshold can be set to 0.8, etc. Each attribute category has its corresponding first attribute value, that is, the prediction value corresponding to the attribute category obtained by the feature extraction subnetwork and attribute classification subnetwork included in the corresponding part attribute extraction network. The prediction value is usually a probability value between 0 and 1. In actual implementation, for each attribute category, the first attribute value corresponding to the attribute category can be compared with the first preset threshold. Taking the first preset threshold of 0.8 as an example, if the first attribute value is greater than or equal to 0.8, it can be directly determined that the target object has the attribute category and the attribute characteristics corresponding to the attribute category.
[0068] Step S410: If the first attribute value corresponding to the attribute category is less than or equal to the second preset threshold, it is determined that the target object does not have the attribute feature corresponding to the attribute category; wherein the first preset threshold is greater than the second preset threshold.
[0069] The above-mentioned second preset threshold can also be set according to actual needs. The second preset threshold is usually a smaller value between 0 and 1; for example, the second preset threshold can be set to 0.2, etc.; in actual implementation, for each attribute category, the first attribute value corresponding to the attribute category can be compared with the second preset threshold. Taking the second preset threshold of 0.2 as an example, if the first attribute value is less than or equal to 0.2, it can be directly determined that the target object does not have the attribute category and the attribute characteristics corresponding to the attribute category.
[0070] Step S412: If the first attribute value corresponding to the attribute category is less than the first preset threshold and greater than the second preset threshold, obtain the second attribute value corresponding to the attribute category from the whole body attribute feature; based on the first attribute value and the second attribute value, determine whether the target object has the attribute feature corresponding to the attribute category.
[0071] The above-mentioned second attribute value can be understood as the predicted value corresponding to the attribute category obtained by the whole-body attribute extraction network; the predicted value is usually also a probability value between 0 and 1; for the convenience of explanation, taking the first preset threshold value of 0.8 and the second preset threshold value of 0.2 as an example, for each attribute category, if the first attribute value corresponding to the attribute category is less than 0.8 and greater than 0.2, the attribute features obtained only by the part attribute extraction network cannot directly determine whether the target object has the attribute category and the attribute features corresponding to the attribute category; at this time, the second attribute value corresponding to the attribute category can be obtained from the whole-body attribute features, the first attribute value and the second attribute value are first summed, and then the average value is calculated. The average value is the final predicted value probability calculated, and the average value can be used to determine whether the target object has the attribute category and the attribute features corresponding to the attribute category.
[0072] It should be noted that there are some attribute categories that do not exist in the attribute categories corresponding to human body parts. The attribute features corresponding to these attribute categories are only included in the whole-body attribute features. For example, the direction of a pedestrian can be directly determined based on the second attribute value corresponding to this attribute category in the whole-body attribute features to determine whether the target object has this attribute category and the attribute features corresponding to this attribute category.
[0073] An attribute recognition method provided by an embodiment of the present invention, after obtaining multiple human body part images corresponding to a target object, extracts the attribute features of the human body part contained in each human body part image, inputs the initial image containing the target object into a pre-trained whole body attribute extraction network, and outputs the whole body attribute features of the target object; for each attribute category, if the first attribute value corresponding to the attribute category is greater than or equal to the first preset threshold, it is determined that the target object has the attribute feature corresponding to the attribute category; if the first attribute value corresponding to the attribute category is less than or equal to the second preset threshold, it is determined that the target object does not have the attribute feature corresponding to the attribute category; if the first attribute value corresponding to the attribute category is less than the first preset threshold and greater than the second preset threshold, the second attribute value corresponding to the attribute category is obtained from the whole body attribute features; based on the first attribute value and the second attribute value, it is determined whether the target object has the attribute feature corresponding to the attribute category. This method can extract the attribute features of the corresponding human body part through different human body part images. Compared with the method of identifying various attribute features from the overall image area of the target pedestrian in the prior art, since the human body part image contains more local features and detail information, the accuracy of the recognition result of the attribute feature can be improved.
[0074] The embodiment of the present invention provides a method for training a part attribute extraction network. Figure 5 As shown, the method comprises the following steps:
[0075] Step S502, obtaining a sample image containing a sample object and a plurality of human body part images corresponding to the sample object; each human body part image contains at least one human body part of the sample object.
[0076] The above-mentioned sample objects can be understood as sample persons; the above-mentioned sample images are usually images of all human body parts including the head, upper torso and lower torso of the sample objects; the above-mentioned human body parts can be various body parts of the sample objects, such as the head, upper torso or lower torso, etc.; the multiple human body part images corresponding to the above-mentioned sample objects contain one or more human body parts of the sample objects, for example, the human body part image can be a head image containing only the head of the sample object, or an upper torso image containing only the upper torso of the sample object, or an image containing both the head and the upper torso of the sample object, etc.; when it is necessary to train the part attribute extraction network, in order to ensure the accuracy of the part attribute extraction network training, a large number of sample images containing a large number of sample objects and multiple human body part images corresponding to the sample objects can be obtained.
[0077] Step S504, for each human body part, input the human body part image containing the human body part into the part attribute extraction network corresponding to the human body part that has been preliminarily trained, and output the attribute characteristics of the human body part; input the sample image into the whole body attribute extraction network that has been preliminarily trained, and output the whole body attribute characteristics of the sample object.
[0078] All parameters in the above-mentioned part attribute extraction network that has been preliminarily trained, such as convolution kernel parameters, etc., can be randomly initialized parameters; all parameters in the above-mentioned whole body attribute extraction network that has been preliminarily trained, such as convolution kernel parameters, etc., can also be randomly initialized parameters; if the human body part is the head, the head image containing the head can be input into the head attribute extraction network that has been preliminarily trained corresponding to the head, and the attribute characteristics of the head can be output; if the human body part is the upper body, the upper body image containing the upper body can be input into the upper body attribute extraction network that has been preliminarily trained corresponding to the upper body, and the attribute characteristics of the upper body can be output; if the human body part is the lower body, the lower body image containing the lower body can be input into the lower body attribute extraction network that has been preliminarily trained corresponding to the lower body, and the attribute characteristics of the lower body can be output. Since the sample image usually contains images of all human body parts including the head, upper body and lower body of the sample object, after the sample image is input into the whole body attribute extraction network that has been preliminarily trained, the whole body attribute characteristics of the sample object can be output.
[0079] Step S506, fusing the attribute features of each human body part with the whole body attribute features to obtain fused features, and determining the attribute features of the sample object based on the fused features.
[0080] The above-mentioned feature fusion can be understood as generating new features, namely, fusion features, for the attribute features of each body part and the whole body outputted above through a specified feature fusion algorithm, such as an algorithm based on Bayesian decision theory, an algorithm based on deep learning theory, etc. The fusion features are more effective for classification; for example, the attribute features of the head, the attribute features of the upper body, the attribute features of the lower body and the whole body can be fused to obtain corresponding fusion features, and the attribute features of the sample object can be determined based on the fusion features.
[0081] Step S508, based on the attribute characteristics of the sample object and the preset loss function, adjust the network parameters of the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part until the attribute characteristics of the sample object converge, and obtain the trained part attribute extraction network and the whole body attribute extraction network corresponding to each human body part.
[0082] The above loss function can calculate the difference between the predicted value and the true value of each attribute category of the sample object; the above network parameters usually include all parameters of the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part, such as convolution kernel parameters, etc.; in actual implementation, the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part are usually trained separately, and the corresponding loss values are calculated through the loss function. After the various extraction networks are trained in parallel, they are trained as a whole, so as to continue to train and adjust the network parameters of the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part based on the attribute characteristics of the sample object and the preset loss function, until the attribute characteristics of the sample object converge, and the trained part attribute extraction network and the whole body attribute extraction network corresponding to each human body part are obtained.
[0083] In actual implementation, the loss function L for supervised learning using sigmoid cross entropy loss is as follows:
[0084]
[0085] Among them, N represents the number of samples, i represents the i-th sample, L represents the specific attribute, l represents the l-th attribute, y il represents the true value of the lth attribute of the ith sample, p i Represents the predicted value output by the classification layer of the model for the i-th sample, p il Represents the predicted value output by the classification layer of the model for the attribute l of the i-th sample.
[0086] The embodiment of the present invention provides a method for training a part attribute extraction network, which includes obtaining a sample image containing a sample object and a plurality of human body part images corresponding to the sample object; for each human body part, inputting the human body part image containing the human body part into the part attribute extraction network corresponding to the human body part that has been preliminarily trained, and outputting the attribute features of the human body part; inputting the sample image into the whole body attribute extraction network that has been preliminarily trained, and outputting the whole body attribute features of the sample object. The attribute features of each human body part and the whole body attribute features are feature fused to obtain fused features, and the attribute features of the sample object are determined based on the fused features. Based on the attribute features of the sample object and a preset loss function, the network parameters of the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part are adjusted until the attribute features of the sample object converge, and the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part that have been trained are obtained. The method can extract the attribute features of the corresponding human body part through different human body part images. Compared with the method of identifying various attribute features from the overall image area of the target pedestrian in the prior art, since the human body part image contains more local features and detail information, the accuracy of the recognition result of the attribute features can be improved.
[0087] The embodiment of the present invention provides another method for training a part attribute extraction network, which is implemented on the basis of the method in the above embodiment; the method focuses on describing the specific process of fusing the attribute features of each human body part with the whole body attribute features to obtain the fused features, such as Figure 6 As shown, the method comprises the following steps:
[0088] Step S602, obtaining a sample image containing a sample object and a plurality of human body part images corresponding to the sample object; each human body part image contains at least one human body part of the sample object.
[0089] Step S604, for each human body part, input the human body part image containing the human body part into the part attribute extraction network corresponding to the human body part that has been preliminarily trained, and output the attribute characteristics of the human body part; input the sample image into the whole body attribute extraction network that has been preliminarily trained, and output the whole body attribute characteristics of the sample object.
[0090] Step S606, combining all human body parts into a part set, determining two human body parts from the part set, deleting the determined two human body parts from the part set; performing feature fusion processing on the attribute features of the determined two human body parts to obtain a first fusion feature.
[0091] The above-mentioned part set usually includes all human body parts. For example, if the human body parts include the head, upper torso and lower torso, then the part set includes the head, upper torso and lower torso. Two human body parts are determined from the part set. For example, the two human body parts determined are the head and the upper torso. The attribute characteristics of the head and the attribute characteristics of the upper torso are generated through a specified feature fusion algorithm to generate a new feature, namely the above-mentioned first fusion feature. Usually, after two human body parts are determined from the part set, the two human body parts can be deleted from the part set to avoid repeated processing.
[0092] In actual implementation, the above-mentioned step of fusing the attribute features of the two determined human body parts to obtain the first fused feature may include: splicing the attribute features of the two determined human body parts to obtain the first splicing feature; and fusing the first splicing feature through a preset convolutional layer to obtain the first fused feature.
[0093] Specifically, the above-mentioned preset convolution layer can be set according to actual needs, for example, it can be a convolution layer with a kernel of 1*1, etc.; after two human body parts are determined from the part set, the attribute features of these two human body parts can be spliced. For example, if the two determined human body parts are the head and the upper body, and the attribute features of the head are a vector with a size of 512*7*7, and the attribute features of the upper body are also a vector with a size of 512*7*7, then the attribute features of the head and the attribute features of the upper body can be spliced to obtain a feature map vector of 1024*7*7, which is the above-mentioned first splicing feature; feature fusion is performed through 512 convolution layers with a kernel of 1*1 to obtain a fused feature map with a size of 512*7*7, which is the above-mentioned first fused feature.
[0094] Step S608, if the part set is not empty, determine a target human body part from the part set, delete the target human body part from the part set; perform feature fusion processing on the first fusion feature and the attribute feature of the target human body part to obtain an updated first fusion feature.
[0095] The above-mentioned target human body part can be a specified human body part in the remaining human body parts in the part set after deleting the two human body parts determined above; for example, still taking the two human body parts determined above as the head and the upper body as an example, if after deleting the head and the upper body from the part set, the lower body is still left in the part set, then the lower body can be determined as the above-mentioned target human body part.
[0096] In actual implementation, the step of performing feature fusion processing on the first fusion feature and the attribute feature of the target human body part to obtain an updated first fusion feature may include: performing splicing processing on the first fusion feature and the attribute feature of the target human body part to obtain a second splicing feature; performing feature fusion processing on the second splicing feature through a preset convolutional layer to obtain an updated first fusion feature.
[0097] The above-mentioned preset convolution layer can also be set according to actual needs, for example, it can be a convolution layer with a kernel of 1*1, etc.; after the target human body part is determined from the part set, the above-mentioned first fusion feature and the attribute feature of the target human body part can be spliced; for example, if the target human body part is the lower body, and the attribute feature of the lower body is a vector with a size of 512*7*7, then the above-mentioned first fusion feature can be spliced with the attribute feature of the lower body to obtain a feature map vector of 1024*7*7, which is the above-mentioned second splicing feature; feature fusion is performed through 512 convolution layers with a kernel of 1*1 to obtain a fused feature map with a size of 512*7*7, which is the above-mentioned updated first fusion feature.
[0098] Step S610, if the part set is not empty, continue to execute the step of determining a target human body part from the part set until the part set is empty, and determine the final fusion feature based on the final first fusion feature and the whole body attribute feature.
[0099] In actual implementation, the step of determining the final fusion feature based on the final first fusion feature and the whole body attribute feature may include: performing feature fusion processing on the final first fusion feature and the whole body attribute feature to obtain the final fusion feature. The final first fusion feature may also be referred to as a pedestrian local fusion feature map. Specifically, after obtaining the final first fusion feature, the final first fusion feature may be spliced with the whole body attribute feature. For example, taking the above-mentioned final first fusion feature as a feature map vector of 512*7*7 and the whole body attribute feature as a feature map vector of 512*7*7 as an example, the final first fusion feature may be spliced with the whole body attribute feature to obtain a feature map of size 1024*7*7, and feature fusion may be performed through 512 convolutional layers with a kernel of 1*1 to obtain a fused feature map of size 512*7*7, which is the above-mentioned final fusion feature.
[0100] Step S612: determining the attribute features of the sample object based on the final fusion features.
[0101] Step S614, based on the attribute characteristics of the sample object and the preset loss function, adjust the network parameters of the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part until the attribute characteristics of the sample object converge, and obtain the trained part attribute extraction network and the whole body attribute extraction network corresponding to each human body part.
[0102] In actual implementation, the attribute features of the above sample objects can be input into the final classification layer to obtain the predicted values of the fused global pedestrian attributes, and the sigmoid cross entropy loss is used for supervised learning. The loss function is calculated in the same way as above. It should be noted that the attribute categories of the global pedestrian attributes mentioned here are the same as the attribute categories of the pedestrian attributes output by the above sample images, but the predicted values may be different.
[0103] The training method of a part attribute extraction network provided by an embodiment of the present invention comprises the following steps: obtaining a sample image containing a sample object and a plurality of human body part images corresponding to the sample object; for each human body part, inputting the human body part image containing the human body part into the part attribute extraction network corresponding to the human body part that has been preliminarily trained, and outputting the attribute feature of the human body part; inputting the sample image into the whole body attribute extraction network that has been preliminarily trained, and outputting the whole body attribute feature of the sample object. All human body parts are combined into a part set, two human body parts are determined from the part set, and the determined two human body parts are deleted; the attribute features of the determined two human body parts are subjected to feature fusion processing to obtain a first fusion feature. If the part set is not empty, a target human body part is determined from the part set, and the target human body part is deleted; the first fusion feature and the attribute feature of the target human body part are subjected to feature fusion processing to obtain an updated first fusion feature. If the part set is not empty, the step of determining a target human body part from the part set is continued until the part set is empty, and a final fusion feature is determined based on the final first fusion feature and the whole body attribute feature. The attribute feature of the sample object is determined based on the final fusion feature. Based on the attribute characteristics of the sample object and the preset loss function, the network parameters of the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part are adjusted until the attribute characteristics of the sample object converge, and the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part that have been trained are obtained. This method can extract the attribute characteristics of the corresponding human body part through different human body part images. Compared with the method of identifying various types of attribute characteristics from the overall image area of the target pedestrian in the prior art, since the human body part image contains more local features and detail information, the accuracy of the recognition result of the attribute characteristics can be improved.
[0104] To further understand the above embodiments, the embodiments of the present invention provide Figure 7The flowchart of pedestrian attribute model training shown in FIG. 1 mainly includes four parts: pedestrian segmentation model training stage, pedestrian part feature extraction stage, multi-level feature fusion stage and attribute prediction learning stage. Specifically, a pedestrian picture is input into a pedestrian segmentation model, and pictures of various parts, namely, a head picture, an upper body picture and a lower body picture, are obtained through the pedestrian segmentation model. The head picture is converted into a three-dimensional neuron in RBG format, represented by a 3*112*112 vector, and input into a corresponding head attribute convolutional neural network (corresponding to the above-mentioned head corresponding part attribute extraction network that has been preliminarily trained to obtain a head feature map; the upper body picture is converted into a three-dimensional neuron in RBG format, represented by a 3*112*112 vector, and input into a corresponding upper body attribute convolutional neural network (corresponding to the above-mentioned upper body corresponding part attribute extraction network that has been preliminarily trained to obtain an upper body feature map; the lower body picture is converted into a three-dimensional neuron in RBG format, represented by a 3*112*112 vector, and input into a corresponding lower body attribute convolutional neural network (corresponding to the above-mentioned lower body corresponding part attribute extraction network that has been preliminarily trained to obtain a lower body feature map; the above-mentioned entire pedestrian picture is converted into a three-dimensional neuron in RBG format, represented by a 3*112*112 vector, and input into a corresponding lower body attribute convolutional neural network (corresponding to the above-mentioned lower body corresponding part attribute extraction network that has been preliminarily trained to obtain a lower body feature map. 112*112 vector representation is input into the corresponding whole-body attribute neural network (corresponding to the whole-body attribute extraction network completed by the preliminary training above) to obtain a whole-body feature map; the head feature map, upper body feature map, lower body feature map and whole-body feature map can all be feature maps of size 512*7*7; the head feature map, upper body feature map, lower body feature map and whole-body feature map are feature fused to obtain a final pedestrian attribute feature map (corresponding to the final fusion feature), and the size of the final pedestrian attribute feature map is usually also a feature map of 512*7*7; the final pedestrian attribute feature map is input into the final classification layer to obtain the predicted value of the fused global pedestrian attribute, calculate the loss of the true value and the predicted value, and use sigmoid cross entropy loss for supervised learning to update the network parameters of the head attribute neural network, the upper body attribute neural network, the lower body attribute neural network and the whole-body attribute neural network, and finally obtain the trained head attribute neural network, the upper body attribute neural network, the lower body attribute neural network and the whole-body attribute neural network.
[0105] The embodiment of the present invention also provides Figure 8A pedestrian attribute model prediction flow chart is shown, wherein a pedestrian image is input into a pedestrian segmentation model, and images of various parts, namely, a head image, an upper body image, and a lower body image, are obtained through the pedestrian segmentation model. The head image is converted into a preset format, such as a three-dimensional neuron in RBG format, represented by a 3*112*112 vector, and input into the corresponding trained head attribute convolutional neural network to obtain a head feature map, which is then input into a head attribute classifier to obtain a predicted value of the head attribute. Similarly, the upper body image is converted into a preset format, input into the corresponding trained upper body attribute convolutional neural network to obtain an upper body feature map, which is then input into the upper body feature map to the upper body attribute classifier to obtain a predicted value of the upper body attribute. The lower body image is converted into a preset format, input into the corresponding trained lower body attribute convolutional neural network to obtain a lower body feature map, which is then input into the lower body feature map to the lower body attribute classifier to obtain. The predicted value of the lower body attribute; convert the whole body image into a preset format, input it into the corresponding trained whole body attribute convolutional neural network, obtain a whole body feature map, and then input the whole body feature map into the whole body attribute classifier to obtain the predicted value of the whole body attribute, which is usually a probability value of 0 to 1; determine the final pedestrian attribute through the pedestrian attribute decision engine; specifically, because the prediction result obtained through the part network is more reliable, the local attribute will first be judged by the result of the part prediction vector. For example, set the threshold value 0.8 and the threshold value 0.2. If the probability of the attribute is greater than 0.8, it can be directly judged that the target pedestrian has the attribute; if the probability of the attribute is less than 0.2, it can be directly judged that the target pedestrian does not have the attribute; if the probability of the attribute is less than 0.8 and greater than 0.2, the value in the whole body attribute vector corresponding to the attribute and the value in the part attribute prediction vector are summed and averaged, and the attribute recognition is performed through the final predicted probability obtained.
[0106] The above attribute recognition method based on pedestrian segmentation and multi-level feature fusion predicts the corresponding pedestrian attributes through different body parts, and then better learns through layer-by-layer feature fusion. For example, when monitoring, partial occlusion or blurring of the head or torso will affect the overall attribute recognition effect. The corresponding attribute features are extracted through the local images of various parts of the target pedestrian, and the clearer parts are used to help identify the occluded or blurred parts, thereby improving the accuracy compared to using the entire pedestrian picture to learn all attributes.
[0107] The embodiment of the present invention provides a schematic diagram of the structure of an attribute recognition device, such as Fig. 9As shown, the device includes: a first acquisition module 90, used to acquire multiple human body part images corresponding to the target object; wherein each human body part image contains at least one human body part of the target object; an extraction module 91, used to extract the attribute characteristics of the human body parts contained in each human body part image; and a first determination module 92, used to determine the attribute characteristics of the target object based on the attribute characteristics extracted from each human body part image.
[0108] The above-mentioned attribute recognition device, after acquiring multiple human body part images corresponding to the target object, extracts the attribute features of the human body parts contained in each human body part image; and then determines the attribute features of the target object based on the extracted attribute features. The device can extract the attribute features of the corresponding human body parts through different human body part images. Compared with the method of identifying various types of attribute features from the overall image area of the target pedestrian in the prior art, since the human body part images contain more local features and detailed information, the accuracy of the recognition results of the attribute features can be improved.
[0109] Furthermore, the first acquisition module 90 is also used to: acquire an initial image containing a target object; identify multiple human body parts of the target object from the initial image to obtain a recognition result; and perform image segmentation processing on the initial image based on the recognition result to obtain a human body part image corresponding to each human body part.
[0110] Furthermore, each human body part image contains a human body part; each human body part corresponds to a pre-trained part attribute extraction network; the part attribute extraction network corresponding to each human body part is used to extract the attribute characteristics contained in the human body part; the extraction module 91 is also used to: for each human body part, input the human body part image corresponding to the human body part into the part attribute extraction network corresponding to the human body part, and output the attribute characteristics of the human body part.
[0111] Furthermore, the part attribute extraction network includes a feature extraction subnetwork and an attribute classification subnetwork; the extraction module 91 is also used to: input the human body part image corresponding to the human body part into the feature extraction subnetwork corresponding to the human body part to obtain the part feature of the human body part; input the part feature into the attribute classification subnetwork corresponding to the human body part to obtain the attribute feature of the human body part; the attribute feature includes: a first attribute value corresponding to a preset attribute category.
[0112] Furthermore, the attribute characteristics include: a first attribute value corresponding to a preset attribute category; the first determination module 92 is also used to: for each attribute category, if the first attribute value corresponding to the attribute category is greater than or equal to a first preset threshold, determine that the target object has the attribute characteristics corresponding to the attribute category; if the first attribute value corresponding to the attribute category is less than or equal to a second preset threshold, determine that the target object does not have the attribute characteristics corresponding to the attribute category; wherein the first preset threshold is greater than the second preset threshold.
[0113] Furthermore, the device is also used to: input an initial image containing a target object into a pre-trained whole-body attribute extraction network, and output whole-body attribute features of the target object; the whole-body attribute features include attribute features of each body part of the target object; the first determination module 92 is also used to: if the first attribute value corresponding to the attribute category is less than a first preset threshold and greater than a second preset threshold, obtain a second attribute value corresponding to the attribute category from the whole-body attribute features; based on the first attribute value and the second attribute value, determine whether the target object has the attribute feature corresponding to the attribute category.
[0114] The implementation principle and technical effects of the attribute identification device provided in the embodiment of the present invention are the same as those of the aforementioned attribute identification method embodiment. For the sake of brief description, for matters not mentioned in the attribute identification device embodiment, reference may be made to the corresponding contents in the aforementioned attribute identification method embodiment.
[0115] The present invention provides a schematic diagram of a training device for a part attribute extraction network. Fig.10 As shown, the device includes: a second acquisition module 100, used to acquire a sample image containing a sample object, and multiple human body part images corresponding to the sample object; each human body part image contains at least one human body part of the sample object; an output module 101, used to input the human body part image containing the human body part into the part attribute extraction network corresponding to the human body part that has been preliminarily trained, and output the attribute characteristics of the human body part; input the sample image into the whole body attribute extraction network that has been preliminarily trained, and output the whole body attribute characteristics of the sample object; a second determination module 102, used to fuse the attribute characteristics of each human body part with the whole body attribute characteristics to obtain fused characteristics, and determine the attribute characteristics of the sample object based on the fused characteristics; an adjustment module 103, used to adjust the network parameters of the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part based on the attribute characteristics of the sample object and a preset loss function, until the attribute characteristics of the sample object converge, and the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part that have been trained are obtained.
[0116] The training device of the part attribute extraction network obtains a sample image containing a sample object and a plurality of human body part images corresponding to the sample object; for each human body part, the human body part image containing the human body part is input into the part attribute extraction network corresponding to the human body part that has been preliminarily trained, and the attribute features of the human body part are output; the sample image is input into the whole body attribute extraction network that has been preliminarily trained, and the whole body attribute features of the sample object are output. The attribute features of each human body part and the whole body attribute features are fused to obtain fused features, and the attribute features of the sample object are determined based on the fused features. Based on the attribute features of the sample object and a preset loss function, the network parameters of the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part are adjusted until the attribute features of the sample object converge, and the part attribute extraction network and the whole body attribute extraction network corresponding to each human body part that have been trained are obtained. The device can extract the attribute features of the corresponding human body part through different human body part images. Compared with the method of identifying various attribute features from the overall image area of the target pedestrian in the prior art, since the human body part image contains more local features and detail information, the accuracy of the recognition result of the attribute features can be improved.
[0117] Furthermore, the second determination module 102 is also used to: combine all human body parts into a part set, determine two human body parts from the part set, and delete the determined two human body parts from the part set; perform feature fusion processing on the attribute characteristics of the two determined human body parts to obtain a first fusion feature; if the part set is not empty, determine a target human body part from the part set, and delete the target human body part from the part set; perform feature fusion processing on the first fusion feature and the attribute characteristics of the target human body part to obtain an updated first fusion feature; if the part set is not empty, continue to execute the step of determining a target human body part from the part set until the part set is empty, and determine the final fusion feature based on the final first fusion feature and the whole body attribute feature.
[0118] Furthermore, the second determination module 102 is further used to: perform feature fusion processing on the final first fusion feature and the whole body attribute feature to obtain a final fusion feature.
[0119] Furthermore, the second determination module 102 is also used to: splice the attribute features of the two determined human body parts to obtain a first spliced feature; perform feature fusion processing on the first spliced feature through a preset convolution layer to obtain a first fusion feature; the second determination module 102 is also used to: splice the first fusion feature and the attribute features of the target human body part to obtain a second spliced feature; perform feature fusion processing on the second spliced feature through a preset convolution layer to obtain an updated first fusion feature.
[0120] The training device for the part attribute extraction network provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the embodiment of the training method for the part attribute extraction network. For the sake of brief description, for matters not mentioned in the embodiment of the training device for the part attribute extraction network, reference may be made to the corresponding contents in the aforementioned embodiment of the training method for the part attribute extraction network.
[0121] The embodiment of the present invention also provides a server, see Fig.11 As shown, the server includes a processor 130 and a memory 131. The memory 131 stores machine executable instructions that can be executed by the processor 130. The processor 130 executes the machine executable instructions to implement the above-mentioned attribute recognition method or the training method of the part attribute extraction network.
[0122] Further, Fig.11 The server shown also includes a bus 132 and a communication interface 133 , and the processor 130 , the communication interface 133 and the memory 131 are connected via the bus 132 .
[0123] Among them, the memory 131 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 133 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 132 can be an ISA bus, a PCI bus or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.11 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0124] The processor 130 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 130. The above processor 130 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 131, and the processor 130 reads the information in the memory 131 and completes the steps of the method of the above embodiment in combination with its hardware.
[0125] An embodiment of the present invention also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned attribute recognition method, or the training method of the part attribute extraction network. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0126] The computer program product of the attribute recognition method, the training method of the part attribute extraction network and the device provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0127] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0128] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for attribute recognition, characterized in that: The method comprises: Acquire multiple human body part images corresponding to the target object; wherein each of the human body part images contains at least one human body part of the target object; Extracting attribute features of the human body part contained in each of the human body part images; Determining the attribute features of the target object based on the attribute features extracted from each of the human body part images; The attribute feature includes: a first attribute value corresponding to a preset attribute category; the step of determining the attribute feature of the target object based on the attribute feature extracted from each of the human body part images includes: For each attribute category, if a first attribute value corresponding to the attribute category is greater than or equal to a first preset threshold, it is determined that the target object has the attribute feature corresponding to the attribute category; If the first attribute value corresponding to the attribute category is less than or equal to a second preset threshold, it is determined that the target object does not have the attribute feature corresponding to the attribute category; wherein the first preset threshold is greater than the second preset threshold; Before the step of determining the attribute features of the target object based on the attribute features extracted from each of the human body part images, the method further includes: Inputting an initial image containing a target object into a pre-trained whole-body attribute extraction network, and outputting whole-body attribute features of the target object; the whole-body attribute features include attribute features of each body part of the target object; The method also includes: if the first attribute value corresponding to the attribute category is less than the first preset threshold and greater than the second preset threshold, obtaining the second attribute value corresponding to the attribute category from the whole-body attribute feature; based on the first attribute value and the second attribute value, determining whether the target object has the attribute feature corresponding to the attribute category; wherein the first attribute value and the second attribute value are first summed and then the average value is calculated, and whether the target object has the attribute feature corresponding to the attribute category is determined based on the average value.
2. The method according to claim 1, characterized in that The steps of obtaining multiple human body part images corresponding to the target object include: Acquire an initial image containing a target object; Identify multiple human body parts of the target object from the initial image to obtain a recognition result; Based on the recognition result, the initial image is subjected to image segmentation processing to obtain a human body part image corresponding to each human body part.
3. The method according to claim 1, characterized in that Each of the human body part images contains a human body part; each human body part corresponds to a pre-trained part attribute extraction network; the part attribute extraction network corresponding to each human body part is used to extract attribute features contained in the human body part; The step of extracting the attribute features of the human body parts contained in each of the human body part images includes: for each human body part, inputting the human body part image corresponding to the human body part into the part attribute extraction network corresponding to the human body part, and outputting the attribute features of the human body part.
4. The method according to claim 3, characterized in that: The part attribute extraction network includes a feature extraction subnetwork and an attribute classification subnetwork; The step of inputting the human body part image corresponding to the human body part into the part attribute extraction network corresponding to the human body part, and outputting the attribute features of the human body part, comprises: Inputting the human body part image corresponding to the human body part into the feature extraction subnetwork corresponding to the human body part to obtain the part feature of the human body part; The part feature is input into the attribute classification subnetwork corresponding to the human body part to obtain the attribute feature of the human body part; the attribute feature includes: a first attribute value corresponding to a preset attribute category.
5. A method for training a part attribute extraction network, characterized in that: The method comprises: Acquire a sample image containing a sample object and a plurality of human body part images corresponding to the sample object; each of the human body part images contains at least one human body part of the sample object; For each human body part, a human body part image containing the human body part is input into a part attribute extraction network corresponding to the human body part that has been preliminarily trained, and attribute features of the human body part are output; the sample image is input into a whole body attribute extraction network that has been preliminarily trained, and whole body attribute features of the sample object are output; the whole body attribute features include attribute features of each human body part of the sample object; The method further includes: if a first attribute value corresponding to the attribute category is less than a first preset threshold value and greater than a second preset threshold value, obtaining a second attribute value corresponding to the attribute category from the whole body attribute feature; based on the first attribute value and the second attribute value, determining whether the sample object has the attribute feature corresponding to the attribute category; wherein the first attribute value and the second attribute value are first summed, and then an average value is calculated, and whether the sample object has the attribute feature corresponding to the attribute category is determined based on the average value; Fusing the attribute features of each human body part with the whole body attribute features to obtain fused features, and determining the attribute features of the sample object based on the fused features; Based on the attribute characteristics of the sample object and a preset loss function, the network parameters of the part attribute extraction network corresponding to each of the human body parts and the whole body attribute extraction network are adjusted until the attribute characteristics of the sample object converge, thereby obtaining the trained part attribute extraction network corresponding to each of the human body parts and the whole body attribute extraction network.
6. The method according to claim 5, characterized in that The step of fusing the attribute features of each human body part with the attribute features of the whole body to obtain fused features comprises: Combining all human body parts into a part set, determining two human body parts from the part set, and deleting the determined two human body parts from the part set; performing feature fusion processing on the attribute features of the determined two human body parts to obtain a first fusion feature; If the part set is not empty, determine a target human body part from the part set, and delete the target human body part from the part set; perform feature fusion processing on the first fusion feature and the attribute feature of the target human body part to obtain an updated first fusion feature; If the part set is not empty, continue to perform the step of determining a target human body part from the part set until the part set is empty, and determine the final fusion feature based on the final first fusion feature and the whole body attribute feature.
7. The method according to claim 6, characterized in that The step of determining the final fusion feature based on the final first fusion feature and the whole body attribute feature includes: performing feature fusion processing on the final first fusion feature and the whole body attribute feature to obtain the final fusion feature.
8. The method according to claim 6, characterized in that The step of fusing the determined attribute features of the two human body parts to obtain a first fusion feature comprises: The determined attribute features of the two human body parts are spliced to obtain a first spliced feature; the first spliced feature is fused through a preset convolution layer to obtain a first fused feature; The step of performing feature fusion processing on the first fusion feature and the attribute feature of the target human body part to obtain an updated first fusion feature includes: The first fusion feature and the attribute feature of the target human body part are spliced to obtain a second spliced feature; the second spliced feature is subjected to feature fusion processing through a preset convolutional layer to obtain an updated first fusion feature.
9. An attribute recognition device, characterized in that: The device comprises: A first acquisition module is used to acquire a plurality of human body part images corresponding to the target object; wherein each of the human body part images contains at least one human body part of the target object; An extraction module, used for extracting attribute features of the human body part contained in each of the human body part images; A first determination module, configured to determine the attribute features of the target object based on the attribute features extracted from each of the human body part images; The attribute feature includes: a first attribute value corresponding to a preset attribute category; the first determination module is further used for: For each attribute category, if a first attribute value corresponding to the attribute category is greater than or equal to a first preset threshold, it is determined that the target object has the attribute feature corresponding to the attribute category; If the first attribute value corresponding to the attribute category is less than or equal to a second preset threshold, it is determined that the target object does not have the attribute feature corresponding to the attribute category; wherein the first preset threshold is greater than the second preset threshold; The device is also used to: Inputting an initial image containing a target object into a pre-trained whole-body attribute extraction network, and outputting whole-body attribute features of the target object; the whole-body attribute features include attribute features of each body part of the target object; The first determination module is also used for: if the first attribute value corresponding to the attribute category is less than the first preset threshold value and greater than the second preset threshold value, obtaining the second attribute value corresponding to the attribute category from the whole-body attribute feature; based on the first attribute value and the second attribute value, determining whether the target object has the attribute feature corresponding to the attribute category; wherein the first attribute value and the second attribute value are first summed and then the average value is calculated, and whether the target object has the attribute feature corresponding to the attribute category is determined based on the average value.
10. A training device for a part attribute extraction network, characterized in that: The device comprises: A second acquisition module is used to acquire a sample image containing a sample object and a plurality of human body part images corresponding to the sample object; each of the human body part images contains at least one human body part of the sample object; An output module is used to input, for each human body part, a human body part image containing the human body part into a part attribute extraction network corresponding to the human body part that has been preliminarily trained, and output attribute features of the human body part; input the sample image into a whole body attribute extraction network that has been preliminarily trained, and output whole body attribute features of the sample object; the whole body attribute features include attribute features of each human body part of the sample object; The device is also used for: if the first attribute value corresponding to the attribute category is less than the first preset threshold value and greater than the second preset threshold value, obtaining the second attribute value corresponding to the attribute category from the whole body attribute feature; based on the first attribute value and the second attribute value, determining whether the sample object has the attribute feature corresponding to the attribute category; wherein the first attribute value and the second attribute value are first summed, and then the average value is calculated, and whether the sample object has the attribute feature corresponding to the attribute category is determined according to the average value; A second determination module is used to fuse the attribute features of each human body part with the whole body attribute features to obtain a fused feature, and determine the attribute features of the sample object based on the fused feature; An adjustment module is used to adjust the network parameters of the part attribute extraction network corresponding to each of the human body parts and the whole body attribute extraction network based on the attribute characteristics of the sample object and a preset loss function, until the attribute characteristics of the sample object converge, thereby obtaining the trained part attribute extraction network corresponding to each of the human body parts and the whole body attribute extraction network.
11. A server, characterized in that: It includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the attribute recognition method described in any one of claims 1 to 4, or the training method of the part attribute extraction network described in any one of claims 5 to 8.
12. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions prompt the processor to implement the attribute recognition method described in any one of claims 1-4, or the training method of the part attribute extraction network described in any one of claims 5-8.
