CN109711462B - Posture estimation and network training method, device and system and storage medium - Google Patents
Posture estimation and network training method, device and system and storage medium Download PDFInfo
- Publication number
- CN109711462B CN109711462B CN201811592835.5A CN201811592835A CN109711462B CN 109711462 B CN109711462 B CN 109711462B CN 201811592835 A CN201811592835 A CN 201811592835A CN 109711462 B CN109711462 B CN 109711462B
- Authority
- CN
- China
- Prior art keywords
- module
- network structure
- feature map
- sampling
- training
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Image Analysis (AREA)
Abstract
The embodiment of the invention provides a training method, a device and a system of a posture estimation network, and a posture estimation method, a device and a systemA system and a storage medium. The training method comprises the following steps: obtaining N1Individual sample images and annotation data; by using N1Training the pose estimation network using the sample images and the annotation data, wherein N is used1Training the attitude estimation network by the sample images and the annotation data comprises the following steps: in each iteration of the training process, a first operation is performed. With the first operation, key optimization can be performed for difficult samples. Therefore, the detection accuracy of the joint point can be effectively improved.
Description
Technical Field
The present invention relates to the field of image processing, and more particularly, to a method, an apparatus, and a system for training a pose estimation network, and a storage medium, and a method, an apparatus, and a system for pose estimation, and a storage medium.
Background
Human posture estimation is an important branch of computer vision for locating various joint points of the human body, such as elbows, wrists, knees, etc. In recent years, with the development of neural networks and hardware facilities, human joint detection technology has been developed. However, for some difficult samples with large motion amplitude, strange or rare posture and occlusion, the existing algorithm generally has poor effect, and the detection precision needs to be further improved.
Disclosure of Invention
The present invention has been made in view of the above problems. The invention provides a training method, a device and a system of a posture estimation network, a storage medium, a posture estimation method, a device and a system and a storage medium.
According to one aspect of the invention, a method for training an attitude estimation network is provided. The method comprises the following steps:
obtaining N1A sample image and annotation data, wherein the annotation data comprises N1Joint point position data, N, corresponding to each sample image1≥1;
By using N1Performing attitude estimation on the network by using the sample image and the annotation dataTraining, wherein the pose estimation network comprises M U-type network structures, each of the M U-type network structures comprises a down-sampling module and an up-sampling module, and input data of the down-sampling module of the ith U-type network structure is based on N output by the up-sampling module of the (i-1) th U-type network structureiObtaining a feature map of the sample image, wherein i is 2,3, … …, M, and M is more than or equal to 2, Ni≤N1;
Wherein at least one of the M U-type network structures further comprises a thermodynamic diagram module utilizing N1Training the attitude estimation network by the sample images and the annotation data comprises the following steps: in each iteration of the training process, performing a first operation;
wherein the first operation comprises:
thermodynamic diagram module output N according to jth U-type network structurejJoint thermodynamic diagram of individual sample images and NjCalculating N from joint point position data of each sample imagejA joint point detection score of each of the sample images, wherein j is more than or equal to 1 and less than or equal to M-1;
neglecting the feature maps except the preset feature map in the feature map output by the up-sampling module of the jth U-type network structure, and obtaining the input data of the down-sampling module of the jth + 1-type network structure based on the preset feature map, wherein the preset feature map is N with the lowest joint point detection scorej+1Characteristic diagram corresponding to each sample image, N is more than or equal to 1j+1<Nj。
Illustratively, for each of the M U-type network structures, the down-sampling module of the U-type network structure includes Q convolution sub-modules, the up-sampling module includes Q-1 up-sampling sub-modules, the U-type network structure further includes Q connection branches in one-to-one correspondence with the Q convolution sub-modules, the Q-th convolution sub-module of the down-sampling module is configured to output a Q-th group of down-sampling feature maps, the Q-th connection branch is configured to receive a Q-th group of down-sampling feature maps and output a Q-th group of branch feature maps, the Q-th up-sampling sub-module of the up-sampling module is configured to receive a Q + 1-th group of up-sampling feature maps and output a Q-th group of up-sampling feature maps,
under the condition that Q is more than or equal to 1 and less than Q, the Q-th upsampling submodule in the upsampling module of the U-shaped network structure is used for upsampling the Q + 1-th group of upsampling feature maps, and combining the feature map obtained by upsampling with the Q-th group of branch feature maps directly or after convolution to obtain the Q-th group of upsampling feature maps; under the condition that q is 1, outputting the q-th group of up-sampling feature maps to the next U-shaped network structure; under the condition that Q is more than 1 and less than Q, outputting the Q-th group of up-sampling feature maps to a Q-1-th up-sampling sub-module in the up-sampling module;
when Q is equal to Q, the characteristic diagram output by the Q-th connection branch of the U-type network structure is a Q-th group up-sampling characteristic diagram;
wherein Q is more than or equal to 1 and less than or equal to Q, and Q is more than or equal to 2.
Illustratively, using N1Training the pose estimation network with the sample images and the annotation data further comprises: in each iteration of the training process, the following operations are also performed:
combining a first feature map, a second feature map and a third feature map, wherein the first feature map is based on N in the q group of down-sampling feature maps corresponding to the l U-shaped network structurel+nObtaining the characteristic diagram of each sample image, wherein the second characteristic diagram is based on N in the q group of up-sampling characteristic diagrams corresponding to the l U-shaped network structurel+nObtaining the feature maps of the sample images, wherein the third feature map is based on N in the q-th group of down-sampling feature maps corresponding to the l + N-th U-shaped network structurel+nObtaining a characteristic map of each sample image;
under the condition that Q is more than or equal to 1 and less than Q,
inputting the combined feature diagram into a (q + 1) th convolution sub-module in a downsampling module of an l + n-th U-shaped network structure;
in the case where Q is Q,
inputting the combined characteristic diagram into the q-th connection branch of the l + n-th U-shaped network structure;
wherein l is more than or equal to 1 and less than or equal to M-1, and n is more than or equal to 1 and less than or equal to M-l.
Illustratively, l ═ 1,2, … …, M-1, and n ═ 1.
Illustratively, the first, second and third profiles have the same number of channels and resolution;
by using N1Training the pose estimation network with the sample images and the annotation data further comprises: in each iteration of the training process, the following operations are also performed:
n in the q-th group of downsampling feature maps corresponding to the l-th U-shaped network structurel+nCarrying out convolution processing on the feature map of each sample image to obtain a first feature map; and/or the presence of a gas in the gas,
n in the q group up-sampling characteristic diagram corresponding to the l U-shaped network structurel+nPerforming convolution processing on the feature map of each sample image to obtain a second feature map; and/or the presence of a gas in the gas,
determining N in the q-th group of downsampling feature maps corresponding to the l + N-th U-shaped network structurel+nThe feature map of each sample image is a third feature map;
combining the first feature map, the second feature map, and the third feature map includes: corresponding elements in the first feature map, the second feature map and the third feature map are added.
Illustratively, for each of the M U-type network structures, the resolution of the q-th set of downsampling feature maps corresponding to the U-type network structure is smaller than the resolution of the q-1 th set of downsampling feature maps corresponding to the U-type network structure, and the channel number of the q-th set of downsampling feature maps corresponding to the U-type network structure is greater than the channel number of the q-1 th set of downsampling feature maps corresponding to the U-type network structure.
Illustratively, the thermodynamic diagram module of the g-th U-type network structure includes SgA convolution sub-module, SgEach convolution sub-module is respectively connected with SgThe group up-sampling characteristic graphs correspond to each other, wherein g is more than or equal to 1 and less than or equal to M, and S is more than or equal to 1 and less than or equal to Sg≤Q;
By using N1Training the pose estimation network with the sample images and the annotation data further comprises: in each iteration of the training process, the following operations are also performed:
s corresponding to the g-th U-shaped network structuregThe group up-sampling characteristic graphs are respectively input into SgCorresponding ones of the convolution sub-modulesModule to obtain SgS output by each convolution submodulegA group joint thermodynamic diagram.
Exemplarily, Sg=Q。
Illustratively, the thermodynamic diagram module output N according to the jth U-type network structurejJoint thermodynamic diagram of individual sample images and NjCalculating N from joint point position data of each sample imagejThe joint point detection score for each of the sample images comprises:
for NjAnd each sample image calculates the joint point detection score of the sample image according to the joint point thermodynamic diagram of the sample image and the joint point position data of the sample image in the joint point thermodynamic diagram of the group with the maximum resolution output by the thermodynamic diagram module of the jth U-type network structure.
According to another aspect of the present invention, an attitude estimation method is provided. The method comprises the following steps: acquiring an image to be processed; and inputting the image to be processed into an attitude estimation network to obtain position prediction information related to the position of the joint point in the image to be processed, wherein the attitude estimation network is obtained by training by adopting the training method of the attitude estimation network.
According to another aspect of the present invention, there is provided a training apparatus for an attitude estimation network, including: an acquisition module for acquiring N1A sample image and annotation data, wherein the annotation data comprises N1Joint point position data, N, corresponding to each sample image1≥1;
Training module for utilizing N1Training a posture estimation network by the sample images and the annotation data, wherein the posture estimation network comprises M U-shaped network structures, each of the M U-shaped network structures comprises a down-sampling module and an up-sampling module, and the input data of the down-sampling module of the ith U-shaped network structure is based on the N output by the up-sampling module of the (i-1) th U-shaped network structureiObtaining a feature map of the sample image, wherein i is 2,3, … …, M, and M is more than or equal to 2, Ni≤N1;
Wherein at least one of the M U-shaped network structures further comprises a thermodynamic diagram module, and the training module comprises: the execution submodule is used for executing a first operation in each iteration of the training process;
wherein the first operation comprises:
thermodynamic diagram module output N according to jth U-type network structurejJoint thermodynamic diagram of individual sample images and NjCalculating N from joint point position data of each sample imagejA joint point detection score of each of the sample images, wherein j is more than or equal to 1 and less than or equal to M-1;
neglecting the feature maps except the preset feature map in the feature map output by the up-sampling module of the jth U-type network structure, and obtaining the input data of the down-sampling module of the jth + 1-type network structure based on the preset feature map, wherein the preset feature map is N with the lowest joint point detection scorej+1Characteristic diagram corresponding to each sample image, N is more than or equal to 1j+1<Nj。
According to another aspect of the present invention, there is provided an attitude estimation device including: the acquisition module is used for acquiring an image to be processed; and the input module is used for inputting the image to be processed into the posture estimation network so as to obtain position prediction information related to the positions of the joint points in the image to be processed, wherein the posture estimation network is obtained by adopting the training method of the posture estimation network.
According to another aspect of the present invention, there is provided a training system for a posture estimation network, comprising a processor and a memory, wherein the memory stores computer program instructions, and the computer program instructions are executed by the processor to execute the training method for the posture estimation network.
According to another aspect of the present invention, there is provided an attitude estimation system comprising a processor and a memory, wherein the memory has stored therein computer program instructions for executing the above-mentioned attitude estimation method when executed by the processor.
According to another aspect of the present invention, there is provided a storage medium having stored thereon program instructions for executing the above-described method of training an attitude estimation network when executed.
According to another aspect of the present invention, there is provided a storage medium having stored thereon program instructions for executing the above-described attitude estimation method when executed.
According to the training method, the training device, the training system and the storage medium of the posture estimation network and the posture estimation method, the training device, the training system and the storage medium of the posture estimation network, in each iteration of a training process, a first operation is executed. The first operation can screen out sample images with insufficient detection effect in the U-shaped network structure at the front end and transmit the sample images to the U-shaped network structure at the rear end for key learning, so that the detection effect of difficult sample images can be gradually optimized. The training of the attitude estimation network is realized by utilizing the first operation, and the emphasis optimization can be performed on the difficult samples. Therefore, according to the method provided by the embodiment of the invention, the detection precision of the joint point can be effectively improved.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent by describing in more detail embodiments of the present invention with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings, like reference numbers generally represent like parts or steps.
FIG. 1 illustrates a schematic block diagram of an example electronic device for implementing a training method and apparatus or a pose estimation method and apparatus for a pose estimation network according to embodiments of the present invention;
FIG. 2a shows a schematic flow diagram of a training method of an attitude estimation network according to one embodiment of the invention;
FIG. 2b shows a schematic flow diagram of a first operation according to one embodiment of the invention;
FIG. 2c shows a schematic flow diagram of a second operation according to one embodiment of the invention;
FIG. 3 shows a schematic diagram of an attitude estimation network, according to one embodiment of the invention;
FIG. 4 shows a schematic diagram of a single U-type network structure according to one embodiment of the present invention;
FIG. 5 shows a schematic flow diagram of a method of attitude estimation according to one embodiment of the invention;
FIG. 6 shows a schematic block diagram of a training apparatus of an attitude estimation network according to one embodiment of the present invention;
FIG. 7 shows a schematic block diagram of an attitude estimation device according to one embodiment of the invention;
FIG. 8 shows a schematic block diagram of a training system for an attitude estimation network, according to one embodiment of the present invention; and
FIG. 9 shows a schematic block diagram of an attitude estimation system according to one embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of embodiments of the invention and not all embodiments of the invention, with the understanding that the invention is not limited to the example embodiments described herein. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the invention described herein without inventive step, shall fall within the scope of protection of the invention.
In order to solve the problem that the detection effect of a difficult sample is not ideal, the embodiment of the invention provides a training method of a posture estimation network and a posture estimation method. The sample described herein may be understood as a pedestrian or an image containing a pedestrian. The difficult sample can be understood as a pedestrian or a pedestrian image which has problems such as large action amplitude, strange or rare posture, and being blocked, so that the joint point detection effect is not ideal enough and cannot meet the preset requirement. It can be understood that, for a pedestrian with the problems of large action amplitude, strange or rare posture, being blocked and the like, the detection effect of the whole pedestrian (the joint points of the pedestrian are integrated) and a certain or some specific joint points of the pedestrian may not be good, and therefore, the mining and optimization of the hard sample can be performed for the two layers of the pedestrian layer and the joint points. Hereinafter, the difficult sample image is used to represent the pedestrian or the image of the pedestrian with poor overall detection effect, and the difficult node is used to represent the joint point with poor detection effect, and both cases belong to the difficult sample.
According to the posture estimation network training method provided by the embodiment of the invention, in each iteration of the training process, the first operation and/or the second operation are/is executed. The first operation may emphatically optimize the detection effect of the hard sample image. The second operation may focus on optimizing the detection effect of the refractory node. The training of the attitude estimation network is realized by one or both of the first operation and the second operation, so that the detection precision of the attitude estimation network for the difficult samples can be effectively improved. Therefore, the posture estimation result with higher precision can be obtained by adopting the posture estimation network obtained by training to carry out posture estimation. The training method and device of the posture estimation network and the posture estimation method and device can be applied to any field needing posture estimation, such as the fields of man-machine interaction, education, virtual augmented reality, entertainment, animation and the like.
First, an example electronic device 100 for implementing a training method and apparatus or a pose estimation method and apparatus of a pose estimation network according to an embodiment of the present invention is described with reference to fig. 1.
As shown in fig. 1, electronic device 100 includes one or more processors 102, one or more memory devices 104. Optionally, the electronic device 100 may also include an input device 106, an output device 108, and an image capture device 110, which may be interconnected via a bus system 112 and/or other form of connection mechanism (not shown). It should be noted that the components and structure of the electronic device 100 shown in fig. 1 are exemplary only, and not limiting, and the electronic device may have other components and structures as desired.
The processor 102 may be implemented in at least one hardware form of a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a microprocessor, the processor 102 may be one or a combination of several of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), an Application Specific Integrated Circuit (ASIC), or other forms of processing units having data processing capability and/or instruction execution capability, and may control other components in the electronic device 100 to perform desired functions.
The storage 104 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. On which one or more computer program instructions may be stored that may be executed by processor 102 to implement client-side functionality (implemented by the processor) and/or other desired functionality in embodiments of the invention described below. Various applications and various data, such as various data used and/or generated by the applications, may also be stored in the computer-readable storage medium.
The input device 106 may be a device used by a user to input instructions and may include one or more of a keyboard, a mouse, a microphone, a touch screen, and the like.
The output device 108 may output various information (e.g., images and/or sounds) to an external (e.g., user), and may include one or more of a display, a speaker, etc. Alternatively, the input device 106 and the output device 108 may be integrated together, implemented using the same interactive device (e.g., a touch screen).
The image capture device 110 may capture images and store the captured images in the storage device 104 for use by other components. The image capture device 110 may be a separate camera or a camera in a mobile terminal, etc. It should be understood that the image capture device 110 is merely an example, and the electronic device 100 may not include the image capture device 110. In this case, other devices having image capturing capabilities may be used to capture an image and transmit the captured image to the electronic device 100.
Illustratively, the training method and apparatus for implementing a posture estimation network or an example electronic device for implementing a posture estimation method and apparatus according to embodiments of the present invention may be implemented on a device such as a personal computer or a remote server.
In the following, a training method of an attitude estimation network according to an embodiment of the present invention will be described with reference to fig. 2a-2 c. FIG. 2a shows a schematic flow diagram of a method 200 of training a pose estimation network according to one embodiment of the present invention. As shown in fig. 2a, the training method 200 of the pose estimation network includes the following steps S210 and S220.
In step S210, N is obtained1A sample image and annotation data, wherein the annotation data comprises N1Joint point position data, N, corresponding to each sample image1≥1。
The sample image may be an image containing a single pedestrian. The annotation data may include joint point position data corresponding to each sample image indicating a position of each joint point of the pedestrian on the sample image. For example, the joint points of the pedestrian on each sample image may be position-labeled manually or otherwise in advance to obtain labeled data.
The types and numbers of joints described herein may be set as desired, for example, joints may include, but are not limited to: head, shoulders (including left and right shoulders), elbows (including left and right elbows), palms (including left and right palms), waist, knees (including left and right knees), feet (including left and right feet), and so forth.
Preferably, the size of all sample images may be the same. If the pedestrian images obtained initially are of different sizes, the pedestrian images can be adjusted to be of fixed sizes through zooming and/or cropping and the like so as to obtain the required sample images.
Illustratively, the position of the pedestrian in the initially obtained image of the pedestrian may be detected using a pedestrian detection network, such as a Megdet network. Each pedestrian may then be cut from the initially obtained image of the pedestrian and scaled to a fixed size, thereby obtaining several images containing a single pedestrian as sample images.
In step S220, use N1Training a posture estimation network by the sample images and the annotation data, wherein the posture estimation network comprises M U-shaped network structures, each of the M U-shaped network structures comprises a down-sampling module and an up-sampling module, and the input data of the down-sampling module of the ith U-shaped network structure is based on the N output by the up-sampling module of the (i-1) th U-shaped network structureiObtaining a feature map of the sample image, wherein i is 2,3, … …, M, and M is more than or equal to 2, Ni≤N1(ii) a Wherein at least one of the M U-type network structures further comprises a thermodynamic diagram module utilizing N1Training the pose estimation network with the sample images and the annotation data (step S220) includes: in each iteration of the training process, a first operation S222 is performed.
Alternatively, using N1Training the pose estimation network with the sample images and the annotation data (step S220) may further include: in each iteration of the training process, a second operation S224 is also performed.
Illustratively, the at least one U-type network structure may be one or more U-type network structures. In the description herein, "at least one U-type network" and "one or more U-type network structures" have the same meaning, i.e., refer to the same batch of U-type network structures. Each of the at least one U-type network structure may include a thermodynamic diagram module.
Fig. 2b shows a schematic flow diagram of a first operation S222 according to an embodiment of the invention. As shown in fig. 2b, the first operation S222 includes steps S2222 and S2224.
In step S2222, N is output according to the thermodynamic diagram module of the jth U-type network structurejJoint thermodynamic diagram of individual sample images and NjCalculating N from joint point position data of each sample imagejA joint point detection score for each of the sample images, wherein,j is more than or equal to 1 and less than or equal to M-1. The jth U-type network structure is a U-type network structure with thermodynamic diagram modules, i.e., it belongs to one or more U-type network structures.
In step S2224, feature maps except the preset feature map in the feature map output by the up-sampling module of the jth U-type network structure are ignored, and the input data of the down-sampling module of the jth + 1-type network structure is obtained based on the preset feature map, wherein the preset feature map is N with the lowest joint point detection scorej+1Characteristic diagram corresponding to each sample image, N is more than or equal to 1j+1<Nj。
Further, the first operation S222 may further include the steps of: and inputting the input data of the j +1 th U-shaped network structure into a downsampling module of the j +1 th U-shaped network structure.
Fig. 2c shows a schematic flow diagram of a second operation S224 according to an embodiment of the invention. As shown in fig. 2c, the second operation S224 includes a first loss calculation operation and a parameter optimization operation. The first loss calculation operation includes steps S2240, S2242, and S2244, and the parameter optimization operation includes steps S2246 and S2248.
In step S2240, for each group of node thermodynamic diagrams in the first thermodynamic diagram set, N corresponding to the input data of the kth U-th network structure outputting the group of node thermodynamic diagramskAnd each sample image calculates P loss values which are associated with the set of joint point thermodynamic diagrams and respectively correspond to P joint points of the sample image according to P joint point thermodynamic diagrams respectively corresponding to the P joint points of the set of joint point thermodynamic diagrams and joint point position data of the sample image, wherein k is larger than or equal to 1 and smaller than or equal to M, P is larger than or equal to 2, the first thermodynamic diagram set comprises at least one joint point thermodynamic diagram of all the sets output by the thermodynamic diagram modules of at least one U-shaped network structure, and each set of all the sets output by the same U-shaped network structure has the same resolution and different sets have different resolutions. The kth U-type network structure is a U-type network structure with thermodynamic diagram modules, i.e. it belongs to one or more U-type network structures.
In step S2242, for the first heatEach group of joint point thermodynamic diagrams in the force diagram set corresponds to N corresponding to input data of a k & ltth & gt U-shaped network structure for outputting the group of joint point thermodynamic diagramskEach of the sample images, ignoring loss values other than a predetermined loss value among the P loss values, calculating a loss value of the sample image associated with the set of joint thermodynamic diagrams according to the predetermined loss value, wherein the predetermined loss value is the largest P of the P loss valueskA loss value of 1. ltoreq. Pk<P。
At step 2244, for each group of joint point thermodynamic diagrams in the first thermodynamic diagram set, N is associated with the group of joint point thermodynamic diagramskLoss values associated with the set of joint thermodynamic diagrams are calculated for each sample image.
In step S2246, a total loss value of the posture estimation network is calculated from the loss values respectively associated with all the group joint thermodynamic diagrams outputted from the at least one U-type network structure.
In step S2248, the parameters of the pose estimation network are optimized according to the total loss value.
An attitude estimation network according to an embodiment of the present invention is described below with reference to fig. 3 and 4.
The pose estimation network described herein is an iterative U-type network that may include multiple U-type network structures. FIG. 3 shows a schematic diagram of an attitude estimation network, according to one embodiment of the invention. As shown in fig. 3, the pose estimation network may include M-stage U-type network structures, each stage having a network structure similar to that of a single U-type network (U-Net). The network structure of U-Net can fuse the characteristics of low-resolution high-semantic information and the characteristics of high-resolution low-semantic information together, thereby being beneficial to obtaining the characteristics of high-resolution high-semantic information.
For convenience of description, the one-stage U-type network structure is referred to herein as one U-type network structure. Figure 4 shows a schematic diagram of a single U-type network structure according to one embodiment of the invention.
Referring to fig. 4, it can be seen that the U-type network structure may include a leftmost downsampling module and an intermediate upsampling module. A U-network structure can be understood as an encoder-decoder structure, the down-sampling module being an encoder (also called a contraction path) and the up-sampling module being a decoder (also called an expansion path). The encoder may gradually reduce the spatial dimension of the pooling layer and the decoder may gradually restore the details and spatial dimension of the object. Since the pooling process of the encoder part can cause information loss, the feature map generated by upsampling in the decoder part is generally rough, so that a skip connection (short) can be introduced between the encoder and the decoder to improve the roughness of the upsampling and help the decoder to better repair the details of the target.
In fig. 4, a solid-line rectangular parallelepiped represents a feature map (feature map), and a dashed-line rectangular parallelepiped represents an articulated joint thermodynamic diagram. "3 × 3" and "1 × 1" represent convolution operations in which the convolution kernel has a size of 3 × 3 and 1 × 1, respectively.
In fig. 4, the leftmost DS1, DS2, DS3, DS4 respectively represent 4 sets of feature maps of different resolutions obtained by downsampling (which will be referred to herein as downsampled feature maps for convenience of description), each set of feature maps being output by a corresponding convolution sub-module (not shown), i.e., a single U-shaped network structure may include 4 convolution sub-modules. Illustratively, each convolution sub-module of the downsampling module may include any suitable number and size of convolution layers, pooling layers, and the like. The down-sampling module as a whole may reduce the resolution of the input image or feature map, but not necessarily through each convolution sub-module. For example, the 1 st convolution sub-module may not adjust the resolution, i.e., the resolution of its input and output may be as large.
Similarly, the middle US1, US2, US3 and US4 represent 4 sets of feature maps of different resolutions involved in upsampling (which are referred to herein as upsampled feature maps for descriptive convenience), respectively, and each set of feature maps, except for the uppermost set of feature maps US1, is input to a corresponding upsampled sub-module for upsampling, convolution and the like, i.e., a single U-type network structure may include 3 upsampled sub-modules. Illustratively, each upsampling sub-module of the upsampling module may include any suitable number and size of upsampling layers, convolutional layers, and the like. For example, the upsampling layer may increase the resolution of the feature map by interpolation or the like, thereby achieving upsampling. In the example shown in fig. 4, each upsampling sub-module includes an upsampling layer and a convolutional layer, and each set of upsampling feature maps (e.g., US3) is upsampled, then is subjected to convolution with a convolution kernel size of 1 × 1, and then is combined with the branch feature map transmitted by the left connecting branch (e.g., S3) to obtain the previous set of upsampling feature maps (e.g., US 2). The up-sampling module as a whole may increase the resolution of the input image or feature map.
The rightmost HM1, HM2, HM3 and HM4 represent 4 sets of joint thermodynamic diagrams obtained by the thermodynamic module, respectively. The 4 groups of up-sampling feature maps US1, US2, US3 and US4 are respectively input into 4 convolution sub-modules of the thermodynamic diagram module, and 4 groups of joint thermodynamic diagrams HM1, HM2, HM3 and HM4 can be respectively obtained. As shown in fig. 4, each convolution sub-module of the thermodynamic diagram module may include two convolution layers having convolution kernel sizes of 3 × 3 and 1 × 1, respectively.
For example, the corresponding signature and thermodynamic diagrams (in parallel position in fig. 4) may have the same resolution. For example, the resolutions of DS1, US1 and HM1 are the same, e.g. all 1/4 of the initially input sample image, the resolutions of DS2, US2 and HM2 are the same, e.g. all 1/8 of the initially input sample image, and so on.
In the example shown in fig. 4, there are four shortcuts between the downsampling module and the upsampling module, shown as S1, S2, S3, and S4, which are referred to herein as connection legs. Those skilled in the art can understand that each short is a fast connection mode from a down-sampling module to an up-sampling module of a U-type network structure, which is not described herein in detail. Illustratively, each connection leg may be a direct connection leg or a connection leg including a convolutional layer. That is, the q-th group of downsampled feature maps may be directly input to the q-th upsampling sub-module for feature map combination, or may be input to the q-th upsampling sub-module for feature map combination after being convolved. In the example shown in fig. 4, each connection leg includes a convolutional layer having a convolutional kernel size of 1 × 1.
It is to be understood that fig. 4 is only a schematic illustration in principle, and that the U-network architecture may vary in some details in implementation. For example, the number of convolution sub-modules in the downsampling module, the upsampling sub-modules in the upsampling module, and the convolution sub-modules in the thermodynamic diagram module may be any number, and these numbers may be further increased or decreased, which is not limited by the present invention.
As shown in fig. 4, the feature map output by the up-sampling module of the previous U-type network structure may be transmitted to the input terminal of the down-sampling module of the subsequent U-type network structure, i.e., the input data of the down-sampling module of the i (i ═ 2,3, … …, M) -th U-type network structure may be based on the N output by the up-sampling module of the i-1-th U-type network structureiAnd obtaining a characteristic map of each sample image.
In one example, N output by the up-sampling module of the i-1 th U-type network structure can be usediThe feature map of each sample image is directly used as the input data of the down-sampling module of the ith U-type network structure, namely, N is output by the up-sampling module of the (i-1) th U-type network structureiThe feature map of each sample image is directly input into a down-sampling module of an ith U-shaped network structure for processing. In another example, N output from the up-sampling module of the i-1 th U-type network structure may be usediThe feature map of each sample image is further processed, for example, by performing convolution, pooling, etc., to obtain a further processed feature map, and the further processed feature map is used as input data for the down-sampling module of the i-th U-network structure.
The exemplary generation of input data for the down-sampling module of the i-th U-type network structure is described above, but it is not a limitation of the present invention, and the present invention may adopt other suitable ways to base the N output from the up-sampling module of the i-1-th U-type network structureiThe feature map of each sample image obtains the input data of the down-sampling module of the ith U-type network structure.
Note that the input data of the downsampling module of the i-th U-type network structure described herein refers to data input from the input terminal of the shallowest layer convolution sub-module (the 1 st convolution sub-module in the order described herein) in the downsampling module of the i-th U-type network structure.
In summary, the input data of the down-sampling module of the i-th U-type network structure is based on the N output of the up-sampling module of the i-1-th U-type network structureiThe feature map of each sample image is obtained, and therefore, the input data of the ith U-type network structure and NiThe sample images correspond or are associated. In the training process of the pose estimation network, in the case of performing the first operation described herein, the following relationship exists: n is not less than 1j+1<NjWherein the jth U-type network structure is a U-type network structure which performs the first operation at its output. In the training process of the posture estimation network, in the case where the first operation is not performed, and only the second operation described herein is performed, the following relationship exists: n is a radical ofi=N1I is 2,3, … …, M. That is, it is possible that the M U-type network structures of the attitude estimation network all handle the same number (N)1Individual) sample image features, it is also possible that a later U-type network structure handles fewer sample image features than an earlier U-type network structure.
Additional thermodynamic diagram modules (as shown in fig. 4) may also be included in one or more U-shaped network structures of the pose estimation network. The U-shaped network structure comprising the thermodynamic diagram module can be a part of U-shaped network structures in the posture estimation network or can be all U-shaped network structures in the posture estimation network. The thermodynamic diagram module may be configured to output an articulation point thermodynamic diagram indicating a location of an articulation point in the sample image. The manner in which the thermodynamic diagram module is structured will be described below.
In order to solve the problem that the joint point detection effect of the difficult sample is poor, the invention provides a scheme for carrying out online excavation and key optimization on the difficult sample. Excavation of difficult samples may involve two levels, a pedestrian level and an articulation level.
For the former, the design idea of the invention is as follows: those pedestrians with low joint detection scores (such as OKS) are mined online and optimized with emphasis. Particularly, the pedestrian joint point positioning accuracy can be measured through the joint point detection score, and the detection effect is not good enough. For pedestrians with poor detection effects, the characteristic diagram can be continuously transmitted into the U-shaped network structure of the next stage, and for pedestrians with good detection effects, the characteristic diagram can not be transmitted into the next stage any more. Therefore, pedestrians with poor detection effects can be optimized step by step, and important optimization of difficult samples is facilitated.
For the latter, the design idea of the invention is as follows: for a certain pedestrian, the joint point with a higher loss value is studied emphatically. Specifically, the loss value can be used for measuring which joint points of a single pedestrian are not accurately positioned, and the detection effect is not good enough. And selecting the joint points with poor detection effect, and giving an important consideration to the joint points in the total loss value and at least partially ignoring the joint points with good detection effect, and performing loss feedback on the basis of the principle. Therefore, the joint points with poor detection effect can be considered in a key mode during network parameter optimization, and key optimization of difficult samples is facilitated.
The difficult sample mining and optimization of the pedestrian level can be realized through a first operation, and the difficult sample mining and optimization of the joint point level can be realized through a second operation.
Implementations and advantages of the first operation are described below in connection with an example.
For example, assume that the number of sample images (i.e., N) of the initial input pose estimation network1) For 10, the 1 st U-type network structure of the posture estimation network does not include the thermodynamic diagram module, but the 2 nd U-type network structure includes the thermodynamic diagram module. Illustratively, the thermodynamic diagram module may comprise at least a convolution sub-module corresponding to a set of up-sampled feature maps of maximum resolution (set 1 up-sampled feature maps) corresponding to the belonging U-type network structure, which may output a joint point thermodynamic diagram HM1 as shown in fig. 4. As described above, in the example shown in fig. 4, each convolution sub-module of the thermodynamic diagram module includes one convolution layer of 3 × 3 and one convolution layer of 1 × 1, and a thermodynamic diagram can be obtained by these two convolutions. It is to be understood that the network layers included in the modules shown in FIG. 4 are merely examplesRather than limiting the invention, the modules may include other types of network layers (e.g., some pooling layers, etc.) as desired.
When the 1 st U-type network structure outputs the feature map, all the feature maps of the 10 sample images output by the up-sampling module may be transmitted to the input terminal of the down-sampling module of the 2 nd U-type network structure. When the 2 nd U-type network structure outputs the characteristic diagram, the characteristic diagram can be output according to the thermodynamic diagram module of the 2 nd U-type network structure by 10 (namely N)2) The OKS for the 10 sample images were calculated for the joint thermodynamic diagrams of the sample images and the labeled joint point position data for the 10 sample images, respectively. The 10 OKS's obtained from the calculation can then be ranked, and 8 (i.e., N) can be selected from them3) The lowest OKS, and 8 sample images corresponding to the 8 OKS were picked. Subsequently, only the feature maps corresponding to the selected 8 sample images among the feature maps output from the up-sampling module of the 2 nd U-type network structure are transmitted to the input terminal of the down-sampling module of the 3 rd U-type network structure.
It is understood that, in the case where the j-th U-type network structure is a U-type network structure in which the first operation is performed at the output thereof, the number N of sample images corresponding to the feature map of the j + 1-th U-type network structure is input theretoj+1May be a preset number.
In one embodiment, all U-shaped network structures of the pose estimation network may include a thermodynamic diagram module, and at the output of each U-shaped network structure, OKS are calculated, and a preset number of sample images with the lowest OKS are selected, and only the feature maps of the selected sample images are input into the next U-shaped network structure for subsequent processing. For example, the posture estimation network comprises 5U-shaped network structures, the number of the processed sample images of the U-shaped network structures from front to back is respectively 10, 8, 6, 5 and 4, so that the processed sample images of the posture estimation network from front to back are fewer and fewer, namely, the more difficult samples are further processed by the U-shaped network structures at the back, the detection result of the difficult samples can be gradually optimized, and the detection precision of the difficult samples can be improved.
In another embodiment, only part of the U-type network structure in the pose estimation network comprises a thermodynamic diagram module, and at the output end of the part of the U-type network structure, OKS are calculated, a preset number of sample images with the lowest OKS are selected, and only the feature diagram of the selected sample images is input into the next U-type network structure for subsequent processing. For example, the posture estimation network includes 5U-shaped network structures, and the numbers of the sample images processed by the front-to-back U-shaped network structures are 10, 8, 6, and 6, respectively, so that the sample images processed by the back-end U-shaped network structure are still reduced compared with the front-end U-shaped network structure as a whole, and thus the detection result of the hard sample can be optimized step by step, and the detection accuracy of the hard sample can be improved.
Implementations and advantages of the second operation are described below in connection with an example.
Following the example described above, assume that the 1 st U-type network structure of the pose estimation network does not include a thermodynamic diagram module, but the 2 nd U-type network structure includes a thermodynamic diagram module. Illustratively, the thermodynamic diagram module may comprise at least a convolution sub-module corresponding to a set of up-sampled feature maps of maximum resolution (set 1 up-sampled feature maps) corresponding to the belonging U-type network structure, which may output a joint point thermodynamic diagram HM1 as shown in fig. 4.
When the 1 st U-type network configuration outputs the feature map, the feature maps of the 10 sample images output therefrom may be all input to the 2 nd U-type network without calculating the loss values of the respective nodes of the respective sample images. When the 2 nd U-type network structure outputs the feature map, for each of the 10 sample images, the loss value of each joint point of the sample image can be calculated based on a group of joint point thermodynamic diagrams (HM 1 shown in fig. 4) having the highest resolution output by the 2 nd U-type network structure and the labeled joint point position data of the sample image. For example, assuming that 15 joint points of a pedestrian need to be located, for each sample image, 15 joint point thermodynamic diagrams can be obtained, corresponding to the 15 joint points respectively. Loss function operation can be performed on the 15 joint thermodynamic diagrams and the labeled joint point position data corresponding to the 15 joint points respectively, so that loss values corresponding to the 15 joint points respectively are obtained.
Subsequently, for each sample image, the 15 loss values corresponding to the 15 joint points of the sample image can be sorted, and 7 (i.e., P) is selected from the 15 loss values2) The maximum loss value. Then, the 7 loss values can be weighted and averaged to obtain the loss value of the sample image. The loss values for the 10 sample images may then be weighted and summed to obtain the loss values associated with the set 1 node thermodynamic diagram for the 2 nd U-type network structure. Assume that the 3 rd U-network structure also includes a thermodynamic diagram module. In the 3 rd U-type network structure, the characteristics of the 8 selected sample images are processed, and the loss value associated with the 1 st set of joint thermodynamic diagrams output by the 3 rd U-type network structure can be calculated only according to the loss values of the 8 sample images.
Assuming that the posture estimation network includes only the above three U-type network structures, and that the 2 nd and 3 rd U-type network structures each output only one set of joint thermodynamic diagrams, the loss values associated with the 1 st set of joint thermodynamic diagrams of the 2 nd U-type network structure and the loss values associated with the 1 st set of joint thermodynamic diagrams of the 3 rd U-type network structure may be weighted and summed to obtain a total loss value of the entire posture estimation network. The parameters of the pose estimation network can then be optimized based on the total loss value. The above process may be repeated in each iteration process until the pose estimation network converges, i.e., the training of the pose estimation network is completed.
Assuming that the posture estimation network includes only the above three U-type network structures, but the 2 nd and 3 rd U-type network structures each output a plurality of sets of joint thermodynamic diagrams, loss values associated with the remaining sets of joint thermodynamic diagrams of the 2 nd and 3 rd U-type network structures may also be calculated. The first loss calculation operation may be used in calculating the loss value associated with any of the remaining set of joint thermodynamic diagrams, the second loss calculation operation described below may be used, and other suitable loss calculation operations may be used. The loss values respectively associated with all group node thermodynamic diagrams of the 2 nd network structure and the loss values respectively associated with all group node thermodynamic diagrams of the 3 rd network structure may then be weighted and summed to obtain a total loss value for the entire pose estimation network.
It can be understood that, in the case where the k-th U-type network structure is a U-type network structure in which the second operation is performed at the output end thereof, the corresponding P thereofkMay be a preset number. Alternatively, P is the network structure for all U-type networks performing the second operationkMay be equal.
Illustratively, the jth U-type network structure may be any one of one or more U-type network structures including thermodynamic diagram modules. Alternatively, each of the one or more U-type network structures including the thermodynamic diagram module may be regarded as a jth U-type network structure, and the first operation may be performed. Alternatively, each of a part of the U-type network structures among the one or more U-type network structures including the thermodynamic diagram module may be regarded as a jth U-type network structure, and the first operation may be performed.
Illustratively, the k-th U-type network structure may be any one of one or more U-type network structures including thermodynamic diagram modules. Alternatively, the second operation may be performed by regarding each of one or more U-type network structures including the thermodynamic diagram module as a k-th U-type network structure. Alternatively, each of a part of the U-type network structures among the one or more U-type network structures including the thermodynamic diagram module may be regarded as a k-th U-type network structure, and the second operation may be performed.
The first and second operations may be performed at the output of the same U-type network structure or may be performed at the output of different U-type network structures.
The present invention is described herein with OKS as an example of a joint point detection score, however this is not a limitation of the present invention. The joint detection score may be calculated by any suitable calculation method for existing or future joint detection scores, which is not described herein in detail.
The difficult sample excavation and optimization of the pedestrian level and the joint point level can be realized simultaneously or alternatively. In one embodiment, only the first operation may be performed. In another embodiment, only the second operation may be performed. In yet another embodiment, the first operation and the second operation may be performed simultaneously.
According to the posture estimation network training method provided by the embodiment of the invention, in each iteration of the training process, the first operation and/or the second operation are/is executed. The first operation can screen out sample images with insufficient detection effect in the U-shaped network structure at the front end and transmit the sample images to the U-shaped network structure at the rear end for key learning, so that the detection effect of difficult sample images can be gradually optimized. The second operation can at least partially ignore the joint points with better detection effect, screen out the joint points with insufficient detection effect in a certain sample image and perform loss return aiming at the joint points, so as to optimize the detection effect of the hard joint points. Training of the posture estimation network is achieved by one or both of the first operation and the second operation, and important optimization can be performed on difficult samples. Therefore, the posture estimation network training method provided by the embodiment of the invention can effectively improve the detection precision of the posture estimation network for the difficult samples. In fact, according to the research of the inventor, the posture estimation network obtained by training with the posture estimation network training method according to the embodiment of the invention achieves the optimal result on a plurality of authoritative data sets in the world.
Illustratively, the training method of the pose estimation network according to the embodiment of the present invention can be implemented in a device, an apparatus, or a system having a memory and a processor.
The training method of the posture estimation network according to the embodiment of the present invention may be deployed at a personal terminal such as a smart phone, a tablet computer, a personal computer, and the like.
Alternatively, the training method of the posture estimation network according to the embodiment of the present invention may also be distributively deployed at the server side (or cloud side) and the personal terminal. For example, a sample image may be obtained at a client, the client transmits the obtained image to a server (or a cloud), and the server (or the cloud) performs training of the pose estimation network.
According to the embodiment of the invention, for each of M U-type network structures, the down-sampling module of the U-type network structure comprises Q convolution sub-modules, the up-sampling module comprises Q-1 up-sampling sub-modules, the U-type network structure further comprises Q connecting branches which are in one-to-one correspondence with the Q convolution sub-modules, the Q-th convolution sub-module of the down-sampling module is used for outputting the Q-th group of down-sampling feature maps, the Q-th connecting branch is used for receiving the Q-th group of down-sampling feature maps and outputting the Q-th group of branch feature maps, the Q-th up-sampling sub-module of the up-sampling module is used for receiving the Q + 1-th group of up-sampling feature maps and outputting the Q-th group of up,
under the condition that q is 1, the q-th upsampling submodule in the upsampling module of the U-shaped network structure is used for upsampling the q + 1-th group of upsampling feature maps, combining the feature maps obtained by upsampling with the q-th group of branch feature maps directly or after convolution to obtain a q-th group of upsampling feature maps, and outputting the q-th group of upsampling feature maps to the next U-shaped network structure;
under the condition that Q is more than 1 and less than Q, the Q-th upsampling submodule in the upsampling module of the U-shaped network structure is used for upsampling a Q + 1-th group of upsampling feature maps, combining the feature maps obtained by upsampling with a Q-th group of branch feature maps directly or after convolution to obtain a Q-th group of upsampling feature maps, and outputting the Q-th group of upsampling feature maps to a Q-1-th upsampling submodule in the upsampling module;
when Q is equal to Q, the characteristic diagram output by the Q-th connection branch of the U-type network structure is a Q-th group up-sampling characteristic diagram;
wherein Q is more than or equal to 1 and less than or equal to Q, and Q is more than or equal to 2.
Referring to the example of fig. 4, the downsampling module of the U-type network structure may include 4 convolution sub-modules for outputting downsampled feature maps DS1, DS2, DS3, and DS4, respectively. The 1 st convolution sub-module outputs a set of downsampled feature maps DS1 and inputs the set of feature maps into the 2 nd convolution sub-module; the 2 nd convolution sub-module outputs a set of downsampled feature maps DS2 and inputs the set of feature maps into the 3 rd convolution sub-module; the 3 rd convolution sub-module outputs a set of down-sampled feature maps DS3 and inputs the set of feature maps into the 4 th convolution sub-module; the 4 th convolution sub-module outputs a set of downsampled feature maps DS 4.
Meanwhile, the U-type network structure further includes 4 connection branches S1, S2, S3, S4. The 4 convolution sub-modules of the downsampling module of the U-type network structure can also respectively input the downsampling feature maps DS1, DS2, DS3 and DS4 into 4 connecting branches S1, S2, S3 and S4 in a one-to-one correspondence manner, and perform convolution (or no convolution, direct connection) in the 4 connecting branches respectively. The 4 connecting branches S1, S2, S3 and S4 output 4 groups of branch signatures respectively.
The upsampling module may include 3 upsampling sub-modules. For the 3 rd upsampling sub-module, it may receive the 4 th group of upsampled feature maps US4, which is the 4 th group of branch feature maps output by S4. And after the 3 rd up-sampling submodule performs up-sampling, convolution and other operations on the 4 th group of feature maps, the 3 rd up-sampling submodule is combined with the 3 rd group of branch feature maps transmitted from S3, and the combined feature map is the 3 rd group of up-sampling feature map US 3. For the 2 nd upsampling submodule, it may receive the 3 rd group of upsampling feature maps US3, perform upsampling, convolution and other operations on the group of feature maps, and combine with the 2 nd group of branch feature maps transmitted from S2, where the combined feature map is the 2 nd group of upsampling feature maps US 2. For the 1 st upsampling submodule, it may receive the 2 nd group of upsampling feature maps US2, perform upsampling, convolution and other operations on the group of feature maps, and combine with the 1 st group of branch feature maps transmitted from S1, where the combined feature map is the 1 st group of upsampling feature maps US 1. The 1 st upsampling sub-module may output the 1 st set of upsampling feature maps US1 to a downsampling module of the next U-network structure. For example, the i-1 th U-type network structure may input the 1 st group of upsampling feature maps US1 to the 1 st convolution sub-module of the downsampling module of the i-th U-type network structure, and after the 1 st convolution sub-module of the downsampling module of the i-th U-type network structure performs processing such as convolution on the 1 st group of upsampling feature maps US1 output by the i-1 th U-type network structure, the 1 st group of downsampling feature maps DS1 corresponding to the i-th U-type network structure may be output, where i is 2,3, … …, M.
Illustratively, Q ≧ 2. The Q is 4, which is more suitable for practical application.
Illustratively, the combining in the upsampling sub-modules may be stitching the feature maps in the channel dimension, which may be implemented with a Concat layer. The implementation method of splicing in channel dimension can be understood by those skilled in the art, and is not described herein in detail. For example, combining the feature map obtained by upsampling with the q-th group of branch feature maps directly or after convolution may include: splicing the feature map obtained by up-sampling with the q group of branch feature maps on the channel dimension to obtain a q group of up-sampling feature maps; or, splicing a convolved feature map obtained after the feature map obtained by upsampling with the q group of branch feature maps on the channel dimension to obtain the q group of upsampled feature maps.
In this context, for convenience of description, the convolution sub-modules of the downsampling module are ordered in a manner of a network depth from shallow to deep, and the upsampling sub-modules of the upsampling module are ordered in a manner of a network depth from deep to shallow, which is merely an example and is not a limitation of the present invention.
According to an embodiment of the invention, N is utilized1Training the pose estimation network with the sample images and the annotation data (step S220) may further include: in each iteration of the training process, the following operations are also performed:
combining a first feature map, a second feature map and a third feature map, wherein the first feature map is based on N in the q group of down-sampling feature maps corresponding to the l U-shaped network structurel+nObtaining the characteristic diagram of each sample image, wherein the second characteristic diagram is based on N in the q group of up-sampling characteristic diagrams corresponding to the l U-shaped network structurel+nObtaining the feature maps of the sample images, wherein the third feature map is based on N in the q-th group of down-sampling feature maps corresponding to the l + N-th U-shaped network structurel+nObtaining a characteristic map of each sample image;
under the condition that Q is more than or equal to 1 and less than Q,
inputting the combined feature diagram into a (q + 1) th convolution sub-module in a downsampling module of an l + n-th U-shaped network structure;
in the case where Q is Q,
inputting the combined characteristic diagram into the q-th connection branch of the l + n-th U-shaped network structure;
wherein l is more than or equal to 1 and less than or equal to M-1, and n is more than or equal to 1 and less than or equal to M-l.
In order to reduce the information loss caused by repeatedly performing up-down sampling in the U-type network structure, the feature map information of the U-type network structure at the front end may be added to the U-type network structure at the back end by using an information stream connection method.
The dashed slanted arrows shown in fig. 3 are a schematic representation of the information flow. The information flow is illustrated in fig. 4 by means of a partly solid arrow and a partly dashed arrow.
For example, the 1 st set of downsampled feature maps DS1 output by the 1 st convolution sub-module of the downsampling module of the 2 nd U-type network structure may generate the first feature map directly or after an operation such as convolution, and transmit the first feature map to the input of the 2 nd convolution sub-module of the downsampling module of the 3 rd U-type network structure (see the information flow path indicated by the solid-line oblique arrow in fig. 4). Further, the 1 st group of up-sampling feature maps US1 output by the 1 st up-sampling sub-module of the 2 nd up-sampling module of the U-type network structure may generate a second feature map directly or after an operation such as convolution, and transmit the second feature map to the input terminal of the 2 nd convolution sub-module of the 3 rd down-sampling module of the U-type network structure (see the information flow line indicated by the dashed oblique arrow of fig. 4). Meanwhile, the 1 st set of downsampled feature maps DS1 output by the 1 st convolution sub-module of the downsampling module of the 3 rd U-type network structure may be transmitted as a third feature map to the input of the 2 nd convolution sub-module of the downsampling module of the 3 rd U-type network structure.
The three-way feature maps may be combined and input to the 2 nd convolution sub-module of the down-sampling module of the 3 rd U-network configuration. The combining may be correspondingly adding elements in the three-way feature map. The resolution and the number of channels of the three-way feature map are consistent, if the resolution and the number of channels of the three-way feature map are not consistent, one or more of the three-way feature map can pass through a plurality of convolution layers and the like, and the resolution and the number of channels of the three-way feature map are adjusted to be consistent.
For another example, the 4 th group of down-sampled feature maps DS4 output by the 4 th convolution sub-module of the down-sampling module of the 2 nd U-type network structure may generate the first feature map directly or after an operation such as convolution, and transmit the first feature map to the input end of the 4 th connection branch of the 3 rd U-type network structure (see the information flow path indicated by the solid-line oblique arrow in fig. 4). Furthermore, the 4 th group of upsampled feature maps US4 of the 3 rd upsampling submodule of the upsampling module which is input into the 2 nd U-type network structure may generate a second feature map directly or after an operation such as convolution or the like, and transmit the second feature map to the input of the 4 th connecting branch of the 3 rd U-type network structure (see the information flow path indicated by the dashed oblique arrow of fig. 4). At the same time, the 4 th set of downsampled feature maps DS4 output by the 4 th convolution sub-module of the downsampling module of the 3 rd U-network structure can be transmitted as a third feature map to the input of the 4 th connection branch of the 3 rd U-network structure.
The three-way profiles can be combined and then input to the 4 th connecting leg of the 3 rd U-network configuration. The combining may be correspondingly adding elements in the three-way feature map. The resolution and the number of channels of the three-way feature map are consistent, if the resolution and the number of channels of the three-way feature map are not consistent, one or more of the three-way feature map can pass through a plurality of convolution layers and the like, and the resolution and the number of channels of the three-way feature map are adjusted to be consistent.
In one embodiment, the above-described information flow connection may be employed between two adjacent U-type network structures, i.e., n-1. Also, optionally, the above-described information flow connection may be employed between all two adjacent U-type network structures of the pose estimation network, i.e., l ═ 1,2, … …, M-1, n ═ 1.
In another embodiment, the above information stream connections may be employed across a U-type network structure, i.e., n > 1. For example, a 1 st U-type network structure may employ information flow connections with a 3 rd U-type network structure. Of course, the example of information stream connection of adjacent U-type network structures and the example of information stream connection across U-type network structures may be implemented in the same embodiment, for example, the 1 st U-type network may employ information stream connection with the 2 nd U-type network structure, and the 2 nd U-type network may employ information stream connection with the 4 th U-type network.
According to the embodiment of the invention, the first characteristic diagram, the second characteristic diagram and the third characteristic diagram have the same channel number and resolution;
by using N1Training the pose estimation network with the sample images and the annotation data (step S220) may further include: in each iteration of the training process, the following operations are also performed:
n in the q-th group of downsampling feature maps corresponding to the l-th U-shaped network structurel+nCarrying out convolution processing on the feature map of each sample image to obtain a first feature map; and/or the presence of a gas in the gas,
n in the q group up-sampling characteristic diagram corresponding to the l U-shaped network structurel+nPerforming convolution processing on the feature map of each sample image to obtain a second feature map; and/or the presence of a gas in the gas,
determining N in the q-th group of downsampling feature maps corresponding to the l + N-th U-shaped network structurel+nThe feature map of each sample image is a third feature map;
combining the first feature map, the second feature map, and the third feature map includes: corresponding elements in the first feature map, the second feature map and the third feature map are added.
As described above, the resolution and the number of channels of the three-way feature map may be adjusted to be the same, and then the adjusted feature maps may be combined together. As shown in fig. 4, each set of up-sampled signatures of the previous U-shaped network structure is convolved by a size of 3 x 3 before participating in the combining.
According to the embodiment of the invention, for each of M U-type network structures, the resolution of the q-th group of downsampling feature maps corresponding to the U-type network structure is smaller than that of the q-1-th group of downsampling feature maps corresponding to the U-type network structure, and the channel number of the q-th group of downsampling feature maps corresponding to the U-type network structure is larger than that of the q-1-th group of downsampling feature maps corresponding to the U-type network structure.
In each downsampling module of the U-shaped network structure, the resolution of the output feature map is gradually reduced from the first convolution sub-module to the last convolution sub-module, and the number of channels can be gradually increased. For example, if the resolution is reduced by a factor of two compared to two adjacent convolution sub-modules, the number of channels is increased by a factor of two. Since a reduction in resolution leads to a loss of information, this loss can be compensated for by increasing the number of channels.
In one example, the 1 st convolution sub-module of the downsampling module of each U-type network structure does not adjust the resolution of the feature map, and each of the remaining convolution sub-modules reduces the resolution of the feature map by one time and increases the number of channels by one time. For example, for the ith U-type network structure, the resolution of the feature map input thereto is 1/4 of the resolution of the original sample image, and after convolution by the 1 st convolution sub-module, the resolution of the obtained feature map DS1 is still 1/4 of the resolution of the sample image. The resolutions of the rest feature maps DS2, DS3 and DS4 are 1/8, 1/16 and 1/32 of the resolution of the sample image respectively, and the channel numbers of the feature maps DS2, DS3 and DS4 are gradually doubled. The resolution of the up-sampling feature maps US1, US2, US3 and US4 is 1/4, 1/8, 1/16 and 1/32 respectively, and the number of channels is the same, for example, 256.
Accordingly, the resolution of the joint thermodynamic diagrams HM1, HM2, HM3, HM4 may be 1/4, 1/8, 1/16, 1/32, respectively. In calculating the joint detection score or loss value, the joint thermodynamic diagram may be resized to a consistent size (i.e., resolution) with the sample image. For example, when calculating the joint detection score or loss value for any set of joint thermodynamic diagrams, the set of joint thermodynamic diagrams and the sample image may be adjusted to 1/4 size of the sample image, and the joint detection score or loss value may be calculated.
According to an embodiment of the present invention, the pose estimation network may further comprise an additional convolution module, which may be configured to receive N of the initial input pose estimation network1Sample image, for N1Convolving the sample images to obtain N1An initial convolved feature map of the sample image. The additional convolution module may also be configured to convolve N1SampleThe initially convolved feature maps of this image are input to a downsampling module of the 1 st U-type network structure. Illustratively, the resolution of each feature map output by the additional convolution module is less than the resolution of each sample image, e.g., the resolution of each feature map output by the additional convolution module may be 1/4 of the resolution of each sample image.
According to the embodiment of the invention, the thermodynamic diagram module of the g-th U-shaped network structure comprises SgA convolution sub-module, SgEach convolution sub-module is respectively connected with SgThe group up-sampling characteristic graphs correspond to each other, wherein g is more than or equal to 1 and less than or equal to M, and S is more than or equal to 1 and less than or equal to Sg≤Q;
By using N1Training the pose estimation network with the sample images and the annotation data (step S220) may further include: in each iteration of the training process, the following operations are also performed:
s corresponding to the g-th U-shaped network structuregThe group up-sampling characteristic graphs are respectively input into SgCorresponding ones of the convolution sub-modules to obtain SgS output by each convolution submodulegA group joint thermodynamic diagram.
The g-th U-type network structure is a U-type network structure having thermodynamic diagram modules, i.e., it belongs to one or more U-type network structures.
The structure and operation of the thermodynamic diagram module have been described above with reference to fig. 4, and are not described herein again. Alternatively, the number of convolution sub-modules included in the thermodynamic diagram module of each U-type network structure may be set as desired, which may be consistent with the number of groups of the up-sampling feature maps, i.e., SgQ to output a set of joint thermodynamic diagrams corresponding to each set of upsampled feature maps, and may not coincide with the number of sets of upsampled feature maps. For example, in the example shown in fig. 4, the thermodynamic diagram module may only include the uppermost convolution sub-module for outputting the joint thermodynamic diagram with the highest resolution, or may include 4 convolution sub-modules for outputting 4 groups of joint thermodynamic diagrams with different resolutions. Outputting multiple sets of different resolution joint thermodynamic diagrams that can be used to reduce joint distortion, as compared to outputting only one set of joint thermodynamic diagramsIn the operations such as the loss value calculation, more loss value calculations can better utilize context (context) information, thereby being beneficial to training a posture estimation network with higher precision.
Exemplarily, SgThe convolution sub-modules may include at least the 1 st convolution sub-module corresponding to the 1 st set of up-sampled feature maps (feature maps with the highest resolution) corresponding to the g-th U-network structure. In this way, the thermodynamic diagram module of the g-th U-network structure may output at least the maximum resolution set of joint thermodynamic diagrams for the first operation and/or the second operation.
According to an embodiment of the invention, N is utilized1Training the pose estimation network with the sample images and the annotation data (step S220) further comprises: in each iteration of the training process, the following second loss calculation operation is also performed:
for each set of joint thermodynamic diagrams in the second set of thermodynamic diagrams,
for N corresponding to input data of h-th U-type network structure for outputting the set of joint thermodynamic diagramshEach of the plurality of sample images is represented by a sample image,
calculating P loss values associated with the set of joint point thermodynamic diagrams and corresponding to P joint points of the sample image respectively according to P joint point thermodynamic diagrams corresponding to the P joint points of the sample image respectively in the set of joint point thermodynamic diagrams and joint point position data of the sample image, wherein h is more than or equal to 1 and less than or equal to M, and the second thermodynamic diagram set comprises at least one joint point thermodynamic diagram of all the set of joint point thermodynamic diagrams output by the thermodynamic diagram module of at least one U-shaped network structure;
performing a weighted average of the P loss values to obtain loss values for the sample image associated with the set of joint thermodynamic diagrams;
for N associated with the thermodynamic diagram of the set of jointshThe loss values for the sample images are weighted and summed to obtain a loss value associated with the set of joint thermodynamic diagrams.
The h-th U-network structure is a U-network structure having thermodynamic diagram modules, i.e., it belongs to one or more U-network structures.
The second loss calculation operation is an operation of calculating the loss values of all the joint points of each sample without performing difficult sample mining. Such a loss calculation method is understood by those skilled in the art and will not be described herein.
With continued reference to the example shown in fig. 4, the highest resolution set of joint thermodynamic diagrams HM1 may employ a first loss calculation operation to calculate their associated loss values, while the other three sets of joint thermodynamic diagrams HM2, HM3, HM4 may employ a second loss calculation operation to calculate their associated loss values. In fig. 3 and 4, the loss value calculated using the first loss calculation operation (i.e., the L2 loss based on the hard sample mining) is denoted by L2 × loss, and the loss value calculated using the second loss calculation operation is denoted by L2 loss. The manner of calculation of the loss shown in fig. 4 is merely an example and not a limitation, and the joint thermodynamic diagrams using the first loss calculation operation and the second loss calculation operation may be arbitrarily distributed as needed.
When the P loss values are weighted and averaged, the weight may be set as necessary. In one example, the P loss values are all equally weighted, e.g., 1, which in this case is equivalent to directly averaging the P loss values. Similarly, N is associated with the thermodynamic diagram for the set of jointshLoss value (i.e., N) of one sample imagehIndividual loss values), the weights may be set as necessary. Illustratively, N associated with the set of joint thermodynamic diagramshThe loss values for the sample images may be weighted equally, as opposed to directly on N, which is associated with the set of joint thermodynamic diagramshThe loss values of the individual sample images are summed.
According to the embodiment of the invention, in the case of only executing the first operation, the second thermodynamic diagram set comprises all group node thermodynamic diagrams output by the thermodynamic diagram modules of at least one U-shaped network structure, and N is utilized1Training the pose estimation network with the sample images and the annotation data (step S220) may further include: in each iteration of the training process, a parameter optimization operation is also performed.
In the case where only the first operation is performed and the second operation is not performed, the second loss calculation operation and the parameter optimization operation may be performed for all the group joint thermodynamic diagrams. In this way, excavation and optimization of difficult samples are performed primarily from the pedestrian level.
According to the embodiment of the present invention, in the case of performing the second operation, the first thermodynamic diagram set includes all the group node thermodynamic diagrams output by the thermodynamic diagram modules of at least one U-type network structure.
In the case where the second operation is performed, the first loss calculation operation and the parameter optimization operation may be performed for all the group joint thermodynamic diagrams. For example, the first loss calculation operation may be performed for 4 sets of joint thermodynamic diagrams HM1, HM2, HM3, HM4 of all U-type network structures. Finally, a parameter optimization operation is performed based on all the loss values.
According to the embodiment of the present invention, in the case of performing the second operation, the first thermodynamic diagram set includes partial group joint thermodynamic diagrams of all group joint thermodynamic diagrams output by the thermodynamic diagram modules of the at least one U-type network structure, and the second thermodynamic diagram set includes joint thermodynamic diagrams other than the first thermodynamic diagram set of all group joint thermodynamic diagrams output by the thermodynamic diagram modules of the at least one U-type network structure.
In the case of performing the second operation, it is also possible to perform the first loss calculation operation for a part of the joint thermodynamic diagrams and perform the second loss calculation operation for another part of the joint thermodynamic diagrams. For example, the first loss calculation operation may be performed for the group 1 node thermodynamic diagrams HM1 of all U-type network structures, and the second loss calculation operation may be performed for the remaining node thermodynamic diagrams HM2, HM3, HM4 of all U-type network structures. Finally, a parameter optimization operation is performed based on all the loss values.
According to the embodiment of the present invention, in the case of performing the second operation, the first thermodynamic diagram set includes a set of joint point thermodynamic diagrams in which each of the at least one U-type network structures outputs the highest resolution.
The manner in which the first penalty calculation operation is performed for HM1 has been described above and will not be described in detail.
According to an embodiment of the present invention, ignoring the loss values other than the predetermined loss value among the P loss values, calculating the loss value of the sample image associated with the set of joint thermodynamic diagrams according to the predetermined loss value may include:
performing a weighted average of the predetermined loss values to obtain loss values for the sample image associated with the set of joint thermodynamic diagrams; and/or
According to N associated with the thermodynamic diagram of the set of jointskA loss value for each sample image, the calculating the loss value associated with the set of joint thermodynamic diagrams may comprise:
for N associated with the thermodynamic diagram of the set of jointskWeighted summing the loss values for the sample images to obtain loss values associated with the set of joint thermodynamic diagrams; and/or
Calculating the total loss value of the pose estimation network from the loss values respectively associated with all the set of joint thermodynamic diagrams output by the at least one U-shaped network structure may comprise:
the loss values respectively associated with all the set node thermodynamic diagrams output by the at least one U-shaped network structure are weighted and summed to obtain a total loss value.
Similarly to the second loss calculation operation, in performing weighted averaging on the predetermined loss values, the weight may be set as needed. In one example, the predetermined loss values are all equally weighted, e.g., are all 1, which in this case is equivalent to directly averaging the predetermined loss values. Similarly, N is associated with the thermodynamic diagram for the set of jointskLoss value (i.e., N) of one sample imagekIndividual loss values), the weights may be set as necessary. Illustratively, N associated with the set of joint thermodynamic diagramskThe loss values for the sample images may be weighted equally, as opposed to directly on N, which is associated with the set of joint thermodynamic diagramskThe loss values of the individual sample images are summed. Further, when the loss values respectively associated with all the group node thermodynamic diagrams outputted from one or more U-shaped network structures are weighted and summed, the weight may be set as necessary. Illustratively, with one or more U-type networksThe weight of the loss values respectively associated with all the group node thermodynamic diagrams of the structure output may be equal, being equal to the direct sum of the loss values respectively associated with all the group node thermodynamic diagrams of the one or more U-shaped network structure outputs.
According to the embodiment of the invention, N output by thermodynamic diagram module of jth U-type network structurejJoint thermodynamic diagram of individual sample images and NjCalculating N from joint point position data of each sample imagejThe joint point detection score of each of the sample images (step S2222) may include: for NjAnd each sample image calculates the joint point detection score of the sample image according to the joint point thermodynamic diagram of the sample image and the joint point position data of the sample image in the joint point thermodynamic diagram of the group with the maximum resolution output by the thermodynamic diagram module of the jth U-type network structure.
As described above, the thermodynamic diagram module of the jth U-type network structure may include one or more convolution sub-modules that respectively output one or more sets of joint thermodynamic diagrams, each of which may include NjP joint point thermodynamic diagrams respectively corresponding to P joint points of the sample images, namely each group of joint point thermodynamic diagrams comprises NjXP joint thermodynamic diagrams. The joint thermodynamic diagrams of the same group have the same resolution, and the joint thermodynamic diagrams of different groups have different resolutions. Alternatively, the set of joint thermodynamic diagrams with the highest resolution, such as the joint thermodynamic diagram HM1 in fig. 4, may be considered primarily when computing OKS.
According to an embodiment of the present invention, the number of the one or more U-type network structures may be at least two. Alternatively, the number of one or more U-type network structures may be equal to N1That is, each U-shaped network structure of the pose estimation network may include a thermodynamic diagram module for outputting a joint point thermodynamic diagram. Alternatively, the first operation may be performed for all U-type network structures of the pose estimation network. Alternatively, the second operation may be performed for all U-type network structures of the pose estimation network. Alternatively, all or part of the U-shaped network structure of the pose estimation network may be usedThe first operation is performed while the second operation is performed for all or part of the U-type network structure of the posture estimation network.
According to another aspect of the present invention, an attitude estimation method is provided. FIG. 5 shows a schematic flow diagram of a method 500 of pose estimation, according to one embodiment of the invention. As shown in fig. 5, the pose estimation method 500 includes steps S510 and S520.
In step S510, an image to be processed is acquired.
The image to be processed may be any image that needs to be semantically segmented. The image to be processed can be a static image or a video frame in a video. The image to be processed may be an original image acquired by the image acquisition device, or may be an image obtained after preprocessing (such as digitizing, normalizing, smoothing, and the like) the original image.
In step S520, the image to be processed is input into the pose estimation network to obtain the position prediction information related to the position of the joint point in the image to be processed, wherein the pose estimation network is obtained by training using the above training method 200 of the pose estimation network.
For example, the position prediction information may include joint thermodynamic diagrams respectively corresponding to all joint points of the pedestrian in the image to be processed. Illustratively, for each joint thermodynamic diagram, gaussian blurring may be performed, and then the point with the largest value in each joint thermodynamic diagram is taken as the predicted coordinate of the joint. The predicted coordinates of each joint point may then be mapped back to the original image to be processed, obtaining the coordinates of the joint point on the image to be processed.
Compared with the conventional posture estimation network, the posture estimation network obtained by training with the posture estimation network training method 200 has higher detection precision, and particularly, a better and better detection result can be obtained on the detection of a difficult sample. Therefore, the attitude estimation method provided by the embodiment of the invention can effectively improve the detection precision of the attitude estimation technology.
Illustratively, before acquiring the image to be processed (step S510), the pose estimation method 500 may further include: acquiring an initial image; carrying out pedestrian detection on the initial image; and extracting an image block containing the target pedestrian from the initial image to obtain an image to be processed.
Alternatively, the position of the pedestrian in the initially obtained image of the pedestrian may be detected using a pedestrian detection network, such as a Megdet network. Subsequently, the target pedestrian may be cut out from the initially obtained pedestrian image and scaled to a fixed size, thereby obtaining an image containing the target pedestrian as an image to be processed.
According to another aspect of the present invention, a training apparatus for an attitude estimation network is provided. FIG. 6 shows a schematic block diagram of a training apparatus 600 of an attitude estimation network according to one embodiment of the present invention.
As shown in fig. 6, the training apparatus 600 of the pose estimation network according to the embodiment of the present invention includes an obtaining module 610 and a training module 620. The various modules may perform the various steps/functions of the training method of the pose estimation network described above in connection with fig. 2-4, respectively. Only the main functions of the components of the training apparatus 600 of the posture estimation network will be described below, and details that have been described above will be omitted.
The obtaining module 610 is used for obtaining N1A sample image and annotation data, wherein the annotation data comprises N1Joint point position data, N, corresponding to each sample image1Not less than 1. The obtaining module 610 may be implemented by the processor 102 in the electronic device shown in fig. 1 executing program instructions stored in the storage 104.
Training module 620 is to utilize N1Training a posture estimation network by the sample images and the annotation data, wherein the posture estimation network comprises M U-shaped network structures, each of the M U-shaped network structures comprises a down-sampling module and an up-sampling module, and the input data of the down-sampling module of the ith U-shaped network structure is based on the N output by the up-sampling module of the (i-1) th U-shaped network structureiObtaining a feature map of the sample image, wherein i is 2,3, … …, M, and M is more than or equal to 2, Ni≤N1;
Wherein at least one of the M U-shaped network structures further comprises a thermodynamic diagram module, and the training module comprises: an execution submodule 6202, configured to, in each iteration of the training process, execute a first operation;
wherein the first operation comprises:
thermodynamic diagram module output N according to jth U-type network structurejJoint thermodynamic diagram of individual sample images and NjCalculating N from joint point position data of each sample imagejA joint point detection score of each of the sample images, wherein j is more than or equal to 1 and less than or equal to M-1;
neglecting the feature maps except the preset feature map in the feature map output by the up-sampling module of the jth U-type network structure, and obtaining the input data of the down-sampling module of the jth + 1-type network structure based on the preset feature map, wherein the preset feature map is N with the lowest joint point detection scorej+1Characteristic diagram corresponding to each sample image, N is more than or equal to 1j+1<Nj。
The training module 620 may be implemented by the processor 102 in the electronic device shown in fig. 1 executing program instructions stored in the storage 104.
According to another aspect of the present invention, an attitude estimation device is provided. FIG. 7 shows a schematic block diagram of an attitude estimation device 700 according to one embodiment of the present invention.
As shown in fig. 7, the posture estimation apparatus 700 according to the embodiment of the present invention includes an acquisition module 710 and an input module 720. The various modules may each perform the various steps/functions of the pose estimation method described above in connection with fig. 5. Only the main functions of the components of the posture estimation device 700 will be described below, and details that have been described above will be omitted.
The obtaining module 710 is used for obtaining an image to be processed. The obtaining module 710 may be implemented by the processor 102 in the electronic device shown in fig. 1 executing program instructions stored in the storage 104.
The input module 720 is configured to input the image to be processed into the pose estimation network to obtain the position prediction information related to the position of the joint point in the image to be processed, where the pose estimation network is obtained by training using the training method 200 of the pose estimation network. The input module 720 may be implemented by the processor 102 in the electronic device shown in fig. 1 executing program instructions stored in the storage 104.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
FIG. 8 shows a schematic block diagram of a training system 800 for an attitude estimation network, according to one embodiment of the present invention. The training system 800 for the pose estimation network comprises an image acquisition device 810, a storage device (i.e., memory) 820, and a processor 830.
The image capturing device 810 is used for capturing a sample image. Image capture device 810 is optional and training system 800 for the pose estimation network may not include image capture device 810. In this case, the sample image may be acquired by other image acquisition devices and transmitted to the training system 800 of the pose estimation network. Alternatively, other external devices (e.g., servers, etc.) may be utilized to send the sample images directly to the training system 800 of the pose estimation network.
The storage 820 stores computer program instructions for implementing corresponding steps in a training method of an attitude estimation network according to an embodiment of the present invention.
The processor 830 is configured to execute the computer program instructions stored in the storage device 820 to perform the corresponding steps of the training method of the pose estimation network according to the embodiment of the present invention.
In one embodiment, the computer program instructions, when executed by the processor 830, are for performing the steps of: obtaining N1A sample image and annotation data, wherein the annotation data comprises N1Joint point position data, N, corresponding to each sample image1≥1;
By using N1Training a posture estimation network by the sample images and the annotation data, wherein the posture estimation network comprises M U-shaped network structures, each of the M U-shaped network structures comprises a down-sampling module and an up-sampling module, and the input data of the down-sampling module of the ith U-shaped network structure is based on the N output by the up-sampling module of the (i-1) th U-shaped network structureiObtaining a feature map of the sample image, wherein i is 2,3, … …, M, and M is more than or equal to 2, Ni≤N1;
Wherein at least one of the M U-type network structures further comprises a thermodynamic diagram module utilizing N1Training the attitude estimation network by the sample images and the annotation data comprises the following steps: in each iteration of the training process, performing a first operation;
wherein the first operation comprises:
thermodynamic diagram module output N according to jth U-type network structurejJoint thermodynamic diagram of individual sample images and NjCalculating N from joint point position data of each sample imagejA joint point detection score of each of the sample images, wherein j is more than or equal to 1 and less than or equal to M-1;
neglecting the feature maps except the preset feature map in the feature map output by the up-sampling module of the jth U-type network structure, and obtaining the input data of the down-sampling module of the jth + 1-type network structure based on the preset feature map, wherein the preset feature map is N with the lowest joint point detection scorej+1Characteristic diagram corresponding to each sample image, N is more than or equal to 1j+1<Nj。
FIG. 9 shows a schematic block diagram of an attitude estimation system 900 according to one embodiment of the invention. Pose estimation system 900 comprises an image acquisition device 910, a storage device (i.e., memory) 920, and a processor 930.
The image acquisition device 910 is used for acquiring an image to be processed. Image capture device 910 is optional and pose estimation system 900 may not include image capture device 910. In this case, the image to be processed may be acquired by using another image acquisition apparatus, and the acquired image to be processed may be transmitted to the posture estimation system 900.
The storage 920 stores computer program instructions for implementing the corresponding steps in the pose estimation method according to an embodiment of the invention.
The processor 930 is configured to execute the computer program instructions stored in the storage 920 to perform the corresponding steps of the pose estimation method according to the embodiment of the present invention.
In one embodiment, the computer program instructions, when executed by the processor 930, are for performing the steps of: acquiring an image to be processed; and inputting the image to be processed into an attitude estimation network to obtain position prediction information related to the position of the joint point in the image to be processed, wherein the attitude estimation network is obtained by training by using the attitude estimation method 200.
Furthermore, according to an embodiment of the present invention, there is also provided a storage medium on which program instructions are stored, which when executed by a computer or a processor are used for executing the corresponding steps of the training method of the posture estimation network of the embodiment of the present invention, and are used for implementing the corresponding modules in the training device of the posture estimation network of the embodiment of the present invention. The storage medium may include, for example, a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a portable compact disc read only memory (CD-ROM), a USB memory, or any combination of the above storage media.
In one embodiment, the program instructions, when executed by a computer or a processor, may cause the computer or the processor to implement the respective functional modules of the training apparatus of the posture estimation network according to the embodiment of the present invention, and/or may perform the training method of the posture estimation network according to the embodiment of the present invention.
In one embodiment, the program instructions are operable when executed to perform the steps of: obtaining N1Individual sample images and annotation data, wherein the annotationData includes and N1Joint point position data, N, corresponding to each sample image1≥1;
By using N1Training a posture estimation network by the sample images and the annotation data, wherein the posture estimation network comprises M U-shaped network structures, each of the M U-shaped network structures comprises a down-sampling module and an up-sampling module, and the input data of the down-sampling module of the ith U-shaped network structure is based on the N output by the up-sampling module of the (i-1) th U-shaped network structureiObtaining a feature map of the sample image, wherein i is 2,3, … …, M, and M is more than or equal to 2, Ni≤N1;
Wherein at least one of the M U-type network structures further comprises a thermodynamic diagram module utilizing N1Training the attitude estimation network by the sample images and the annotation data comprises the following steps: in each iteration of the training process, performing a first operation;
wherein the first operation comprises:
thermodynamic diagram module output N according to jth U-type network structurejJoint thermodynamic diagram of individual sample images and NjCalculating N from joint point position data of each sample imagejA joint point detection score of each of the sample images, wherein j is more than or equal to 1 and less than or equal to M-1;
neglecting the feature maps except the preset feature map in the feature map output by the up-sampling module of the jth U-type network structure, and obtaining the input data of the down-sampling module of the jth + 1-type network structure based on the preset feature map, wherein the preset feature map is N with the lowest joint point detection scorej+1Characteristic diagram corresponding to each sample image, N is more than or equal to 1j+1<Nj。
The modules in the training system of the pose estimation network according to embodiments of the present invention may be implemented by a processor of an electronic device implementing the training of the pose estimation network according to embodiments of the present invention running computer program instructions stored in a memory or may be implemented when computer instructions stored in a computer readable storage medium of a computer program product according to embodiments of the present invention are run by a computer.
Furthermore, according to an embodiment of the present invention, there is also provided a storage medium on which program instructions are stored, which when executed by a computer or a processor are used for executing the respective steps of the posture estimation method according to an embodiment of the present invention, and for implementing the respective modules in the posture estimation device according to an embodiment of the present invention. The storage medium may include, for example, a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a portable compact disc read only memory (CD-ROM), a USB memory, or any combination of the above storage media.
In one embodiment, the program instructions, when executed by a computer or a processor, may cause the computer or the processor to implement the respective functional modules of the posture estimation device according to the embodiment of the present invention, and/or may perform the posture estimation method according to the embodiment of the present invention.
In one embodiment, the program instructions are operable when executed to perform the steps of: acquiring an image to be processed; and inputting the image to be processed into an attitude estimation network to obtain position prediction information related to the position of the joint point in the image to be processed, wherein the attitude estimation network is obtained by training by adopting the training method 200 of the attitude estimation network.
Although the illustrative embodiments have been described herein with reference to the accompanying drawings, it is to be understood that the foregoing illustrative embodiments are merely exemplary and are not intended to limit the scope of the invention thereto. Various changes and modifications may be effected therein by one of ordinary skill in the pertinent art without departing from the scope or spirit of the present invention. All such changes and modifications are intended to be included within the scope of the present invention as set forth in the appended claims.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another device, or some features may be omitted, or not executed.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the method of the present invention should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
It will be understood by those skilled in the art that all of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where such features are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some of the modules in the training means or pose estimation means of the pose estimation network according to embodiments of the present invention. The present invention may also be embodied as apparatus programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The above description is only for the specific embodiment of the present invention or the description thereof, and the protection scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and the changes or substitutions should be covered within the protection scope of the present invention. The protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (15)
1. A method of training an attitude estimation network, comprising:
obtaining N1A sample image and annotation data, wherein the annotation data comprises the N1Joint point position data, N, corresponding to each sample image1≥1;
Using said N1Training a posture estimation network by the sample images and the annotation data, wherein the posture estimation network comprises M U-shaped network structures, each of the M U-shaped network structures comprises a down-sampling module and an up-sampling module, and the input data of the down-sampling module of the ith U-shaped network structure is based on the N output by the up-sampling module of the ith-1U-shaped network structureiObtaining a feature map of the sample image, wherein i is 2,3, … …, M, and M is more than or equal to 2, Ni≤N1;
Wherein at least one of the M U-type network structures further comprises a thermodynamic diagram module, the utilizing of the N1Training the pose estimation network with the sample images and the annotation data comprises: in each iteration of the training process, performing a first operation;
wherein the first operation comprises:
according to jth U-type network configurationThermodynamic diagram module output NjJoint thermodynamic diagram of individual sample images and the NjCalculating the N from joint point position data of each sample imagejA joint point detection score of each of the sample images, wherein j is more than or equal to 1 and less than or equal to M-1;
neglecting the feature maps except the preset feature map in the feature map output by the up-sampling module of the jth U-type network structure, and obtaining the input data of the down-sampling module of the jth + 1-type network structure based on the preset feature map, wherein the preset feature map is N with the lowest joint point detection scorej+1Characteristic diagram corresponding to each sample image, N is more than or equal to 1j+1<Nj;
Wherein, the thermodynamic diagram module according to the jth U-type network structure outputs NjJoint thermodynamic diagram of individual sample images and the NjCalculating the N from joint point position data of each sample imagejThe joint point detection score for each of the sample images comprises:
for said NjAnd each sample image calculates the joint point detection score of the sample image according to the joint point thermodynamic diagram of the sample image and the joint point position data of the sample image in the group of joint point thermodynamic diagrams with the maximum resolution output by the thermodynamic diagram module of the jth U-type network structure.
2. The method of claim 1, wherein for each of the M U-type network structures, the down-sampling module of the U-type network structure comprises Q convolution sub-modules, the up-sampling module comprises Q-1 up-sampling sub-modules, the U-type network structure further comprises Q connection branches in one-to-one correspondence with the Q convolution sub-modules, the Q-th convolution sub-module of the down-sampling module is configured to output a Q-th set of down-sampling feature maps, the Q-th connection branch is configured to receive a Q-th set of down-sampling feature maps and output a Q-th set of branch feature maps, the Q-th up-sampling sub-module of the up-sampling module is configured to receive a Q + 1-th set of up-sampling feature maps and output a Q-th set of up-sampling feature maps, wherein,
under the condition that Q is more than or equal to 1 and less than Q, the Q-th upsampling submodule in the upsampling module of the U-shaped network structure is used for upsampling the Q + 1-th group of upsampling feature maps, and combining the feature map obtained by upsampling with the Q-th group of branch feature maps directly or after convolution to obtain the Q-th group of upsampling feature maps; under the condition that q is 1, outputting the q-th group of up-sampling feature maps to the next U-shaped network structure; under the condition that Q is more than 1 and less than Q, outputting the Q-th group of up-sampling feature maps to a Q-1-th up-sampling sub-module in the up-sampling module;
when Q is equal to Q, the characteristic diagram output by the Q-th connection branch of the U-type network structure is a Q-th group up-sampling characteristic diagram;
wherein Q is more than or equal to 1 and less than or equal to Q, and Q is more than or equal to 2.
3. The method of claim 2, wherein said utilizing said N1Training the pose estimation network with the sample images and the annotation data further comprises: in each iteration of the training process, the following operations are also performed:
combining a first feature map, a second feature map and a third feature map, wherein the first feature map is based on N in a q-th group of downsampling feature maps corresponding to an l-th U-shaped network structurel+nObtaining feature maps of sample images, wherein the second feature map is obtained based on the N in the q group of up-sampling feature maps corresponding to the l-th U-shaped network structurel+nObtaining feature maps of sample images, wherein the third feature map is obtained based on the N in the q-th group of down-sampling feature maps corresponding to the l + N-th U-shaped network structurel+nObtaining a characteristic map of each sample image;
under the condition that Q is more than or equal to 1 and less than Q,
inputting the combined feature map into a (q + 1) th convolution sub-module in a down-sampling module of the (l + n) th U-shaped network structure;
in the case where Q is Q,
inputting the combined characteristic diagram into the q-th connection branch of the l + n-th U-shaped network structure;
wherein l is more than or equal to 1 and less than or equal to M-1, and n is more than or equal to 1 and less than or equal to M-l.
4. A method as claimed in claim 3, wherein 1,2, … …, M-1, n-1.
5. The method of claim 3, wherein the first, second, and third feature maps have the same number of channels and resolution;
said utilizing of said N1Training the pose estimation network with the sample images and the annotation data further comprises: in each iteration of the training process, the following operations are also performed:
n in the q-th group of downsampling feature maps corresponding to the l-th U-shaped network structurel+nCarrying out convolution processing on the feature map of each sample image to obtain the first feature map; and/or the presence of a gas in the gas,
the N in the q group of up-sampling characteristic graphs corresponding to the l U-shaped network structurel+nPerforming convolution processing on the feature map of each sample image to obtain the second feature map; and/or the presence of a gas in the gas,
determining the N in the q-th group of downsampling feature maps corresponding to the l + N-th network structurel+nThe feature map of each sample image is the third feature map;
the combining the first feature map, the second feature map and the third feature map comprises: adding corresponding elements in the first feature map, the second feature map and the third feature map.
6. The method of any one of claims 2 to 5, wherein for each of the M U-type network structures, the resolution of the q-th set of downsampled feature maps corresponding to the U-type network structure is smaller than the resolution of the q-1-th set of downsampled feature maps corresponding to the U-type network structure, and the channel number of the q-th set of downsampled feature maps corresponding to the U-type network structure is greater than the channel number of the q-1-th set of downsampled feature maps corresponding to the U-type network structure.
7. The method of any of claims 2 to 5, wherein the g-th U-network structureThe thermodynamic diagram module comprises SgA convolution sub-module, said SgEach convolution sub-module is respectively connected with SgThe group up-sampling characteristic graphs correspond to each other, wherein g is more than or equal to 1 and less than or equal to M, and S is more than or equal to 1 and less than or equal to Sg≤Q;
Said utilizing of said N1Training the pose estimation network with the sample images and the annotation data further comprises: in each iteration of the training process, the following operations are also performed:
the S corresponding to the g-th U-shaped network structuregThe group up-sampling characteristic graphs are respectively input into the SgCorresponding ones of the convolution sub-modules to obtain the SgS output by each convolution submodulegA group joint thermodynamic diagram.
8. The method of claim 7, wherein Sg=Q。
9. An attitude estimation method, comprising:
acquiring an image to be processed; and
inputting the image to be processed into a posture estimation network to obtain position prediction information related to the position of the joint point in the image to be processed, wherein the posture estimation network is obtained by training with the training method of the posture estimation network according to any one of claims 1 to 8.
10. A training apparatus of an attitude estimation network, comprising:
an acquisition module for acquiring N1A sample image and annotation data, wherein the annotation data comprises the N1Joint point position data, N, corresponding to each sample image1≥1;
A training module for utilizing the N1Training a pose estimation network with the sample images and the annotation data, wherein the pose estimation network comprises M U-shaped network structures, each of the M U-shaped network structures comprises a down-sampling module and an up-sampling module, and an output of the down-sampling module of the ith U-shaped network structureN of input data output by up-sampling module based on i-1 th U-type network structureiObtaining a feature map of the sample image, wherein i is 2,3, … …, M, and M is more than or equal to 2, Ni≤N1;
Wherein at least one of the M U-shaped network structures further comprises a thermodynamic diagram module, the training module comprising:
a calculation submodule for outputting N according to the thermodynamic diagram module of the jth U-type network structure in each iteration of the training processjJoint thermodynamic diagram of individual sample images and the NjCalculating the N from joint point position data of each sample imagejA joint point detection score of each of the sample images, wherein j is more than or equal to 1 and less than or equal to M-1;
a data obtaining sub-module, configured to, in each iteration of the training process, ignore feature maps, other than a predetermined feature map, in the feature maps output by the up-sampling module of the jth U-type network structure, and obtain input data of the down-sampling module of the jth + 1-type network structure based on the predetermined feature map, where the predetermined feature map is N having a lowest score with respect to joint detectionj+1Characteristic diagram corresponding to each sample image, N is more than or equal to 1j+1<Nj;
Wherein the calculation submodule comprises:
a computing unit for, for each iteration of a training process, for said NjAnd each sample image calculates the joint point detection score of the sample image according to the joint point thermodynamic diagram of the sample image and the joint point position data of the sample image in the group of joint point thermodynamic diagrams with the maximum resolution output by the thermodynamic diagram module of the jth U-type network structure.
11. An attitude estimation device comprising:
the acquisition module is used for acquiring an image to be processed; and
an input module, configured to input the image to be processed into a pose estimation network to obtain position prediction information related to positions of joint points in the image to be processed, wherein the pose estimation network is obtained by training using the training method of the pose estimation network according to any one of claims 1 to 8.
12. A training system of a pose estimation network, comprising a processor and a memory, wherein the memory has stored therein computer program instructions for execution by the processor to perform a training method of a pose estimation network according to any of claims 1 to 8.
13. An attitude estimation system comprising a processor and a memory, wherein the memory has stored therein computer program instructions for execution by the processor to perform the attitude estimation network method of claim 9.
14. A storage medium on which program instructions are stored, the program instructions when executed being for performing a training method of an attitude estimation network according to any one of claims 1 to 8.
15. A storage medium on which program instructions are stored, which program instructions are operable when executed to perform the pose estimation method of claim 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811592835.5A CN109711462B (en) | 2018-12-25 | 2018-12-25 | Posture estimation and network training method, device and system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811592835.5A CN109711462B (en) | 2018-12-25 | 2018-12-25 | Posture estimation and network training method, device and system and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109711462A CN109711462A (en) | 2019-05-03 |
CN109711462B true CN109711462B (en) | 2021-07-09 |
Family
ID=66257603
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811592835.5A Active CN109711462B (en) | 2018-12-25 | 2018-12-25 | Posture estimation and network training method, device and system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109711462B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112883761B (en) * | 2019-11-29 | 2023-12-12 | 北京达佳互联信息技术有限公司 | Construction method, device, equipment and storage medium of attitude estimation model |
CN112529073A (en) * | 2020-12-07 | 2021-03-19 | 北京百度网讯科技有限公司 | Model training method, attitude estimation method and apparatus, and electronic device |
CN113095129B (en) * | 2021-03-01 | 2024-04-26 | 北京迈格威科技有限公司 | Gesture estimation model training method, gesture estimation device and electronic equipment |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107808111B (en) * | 2016-09-08 | 2021-07-09 | 北京旷视科技有限公司 | Method and apparatus for pedestrian detection and attitude estimation |
CN108875523B (en) * | 2017-12-28 | 2021-02-26 | 北京旷视科技有限公司 | Human body joint point detection method, device, system and storage medium |
-
2018
- 2018-12-25 CN CN201811592835.5A patent/CN109711462B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN109711462A (en) | 2019-05-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109711329B (en) | Posture estimation and network training method, device and system and storage medium | |
CN108876792B (en) | Semantic segmentation method, device and system and storage medium | |
CN109448090B (en) | Image processing method, device, electronic equipment and storage medium | |
CN108205655B (en) | Key point prediction method and device, electronic equipment and storage medium | |
CN108875523B (en) | Human body joint point detection method, device, system and storage medium | |
CN106203376B (en) | Face key point positioning method and device | |
CN111160375B (en) | Three-dimensional key point prediction and deep learning model training method, device and equipment | |
CN109711462B (en) | Posture estimation and network training method, device and system and storage medium | |
CN112308200B (en) | Searching method and device for neural network | |
CN112330729B (en) | Image depth prediction method, device, terminal equipment and readable storage medium | |
CN111179419B (en) | Three-dimensional key point prediction and deep learning model training method, device and equipment | |
CN108876804B (en) | Matting model training and image matting method, device and system and storage medium | |
CN109821239B (en) | Method, device, equipment and storage medium for realizing somatosensory game | |
CN109154973A (en) | Execute the method and system of convolved image transformation estimation | |
WO2020215644A1 (en) | Video image processing method and apparatus | |
CN111652054B (en) | Joint point detection method, gesture recognition method and device | |
CN108875492B (en) | Face detection and key point positioning method, device, system and storage medium | |
CN111507333B (en) | Image correction method and device, electronic equipment and storage medium | |
US11113571B2 (en) | Target object position prediction and motion tracking | |
Sang et al. | PCANet: Pyramid convolutional attention network for semantic segmentation | |
CN112149694B (en) | Image processing method, system, storage medium and terminal based on convolutional neural network pooling module | |
CN107644423B (en) | Scene segmentation-based video data real-time processing method and device and computing equipment | |
CN111753801A (en) | Human body posture tracking and animation generation method and device | |
CN113807361A (en) | Neural network, target detection method, neural network training method and related products | |
CN109086690B (en) | Image feature extraction method, target identification method and corresponding device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |