Human body posture estimation method, electronic device and storage medium
By adopting a lightweight human posture estimation network in the service robot, and using the DLA_Shufflenet backbone network and feature fusion module, the computational efficiency problem of the human posture estimation algorithm in the existing technology on resource-limited devices is solved, and the behavioral interaction ability is improved.
Patent Information
- Application Number
- CN202110245132.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-05
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-03-05
AI Technical Summary
Existing human posture estimation algorithms are difficult to run efficiently on service robot equipment with limited resources, resulting in insufficient behavioral interaction capabilities.
A lightweight human pose estimation network based on DLA_Shufflenet's backbone network, feature fusion module and detection head module is used to simplify the network structure and reduce the amount of calculation through image preprocessing, training and real-time detection.
It greatly reduces the calculation time of human posture estimation, improves the behavioral interaction ability between the service robot and the service object, and makes the human posture estimation method easier to deploy on edge devices.
Smart Images

Figure CN112861777B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a human body posture estimation method, electronic device and storage medium. Background Art
[0002] Human posture estimation is a method to detect the key points of the human body in the target image. By connecting the detected joint points into the human skeleton, the behavior state of the target person can be further understood. In the field of service robots, robots must not only have the ability to perceive the people around them, but also the ability to recognize the behavior of the service people, such as waving, standing, walking, etc. These body language recognition abilities are inseparable from the accurate modeling of the human body by the human posture estimation algorithm. Accurately identifying the key points of the human body is the key to improving the quality of robot services. Usually, the human posture estimation algorithm relies on the upstream pedestrian recognition module. After the pedestrian recognition module locates the pedestrian, the human posture estimation algorithm further estimates the key points of the human body. The existing algorithm is a two-stage redundant structure, which is difficult to implement on resource-limited robot devices. Summary of the invention
[0003] In order to overcome the problems existing in the related technology, the present application provides a human posture estimation method, an electronic device and a storage medium, aiming to provide a lightweight human posture estimation network, greatly reduce the computational time of the human posture estimation algorithm, and enhance the behavioral interaction capability between the service robot and the service object.
[0004] The technical solution of the present application to solve the above-mentioned technical problems is as follows: a human body posture estimation method, applied to a service robot, comprising the following steps: Step 1, collecting images of pedestrian postures, and preprocessing the images of pedestrian postures to form a training set; Step 2, constructing a pedestrian posture estimation network model, the pedestrian posture estimation network model comprising a backbone network based on DLA_Shufflenet, a feature fusion module and a detection head module; Step 3, using the images of the training set to train the pedestrian posture estimation network model, and optimizing the network parameters of the pedestrian posture estimation network model; Step 4, collecting real-time pedestrian posture images, and detecting the human body center point position, center point offset and human body key point offset in the real-time pedestrian posture image based on the trained pedestrian posture estimation network model.
[0005] Preferably, the backbone network includes a ShuffleUnit submodule, and the structure of the ShuffleUnit submodule is as follows according to the processing order of the computing units: a channel separator, used to divide the input feature map into two sub-branches according to the channel dimension; the first convolution layer adopts standard convolution, and the convolution kernel size is 1*1; the second convolution layer adopts depthwise separable convolution, and the convolution kernel size is 3*3; the third convolution layer is a standard convolution, and the convolution kernel size is 1*1; a concatenator, used to re-concatenate the two sub-branches of the feature map together; a channel reorganizer, used to rearrange the two sub-branches of the feature map concatenated by the concatenator according to the channel dimension.
[0006] Preferably, the structure of the backbone network is as follows according to the processing order of the computing units: a first convolution unit, which adopts standard convolution and a convolution kernel size of 3*3; a maximum pooling unit, which is used to perform feature dimensionality reduction on the output of the first convolution unit; a first ShuffleUnit submodule, which is used to perform feature extraction on the output of the maximum pooling unit; a second ShuffleUnit submodule, which is used to perform feature extraction on the output of the first ShuffleUnit submodule; a third ShuffleUnit submodule, which is used to perform feature extraction on the output of the second ShuffleUnit submodule; a fourth ShuffleUnit submodule, which is used to perform feature extraction on the output of the third ShuffleUnit submodule; a fifth ShuffleUnit submodule, which is used to perform feature extraction on the output of the fourth ShuffleUnit submodule; a sixth ShuffleUnit submodule, which is used to perform feature extraction on the output of the fifth ShuffleUnit submodule; and a seventh ShuffleUnit submodule, which is used to perform feature extraction on the output of the sixth ShuffleUnit submodule.
[0007] Preferably, the structure of the feature fusion module is as follows according to the processing order of the computing units: a bilinear upsampling unit, used to acquire features of the output of the 32-fold downsampling layer; a standard convolution unit with a convolution kernel size of 3*3, and the standard convolution unit is used to convolve the output of the bilinear upsampling unit; a concatenation unit, used to fuse the output of the 16-fold downsampling layer and the output of the 32-fold downsampling layer; and a transposed convolution unit, used to output the final fused features.
[0008] Preferably, the output of the seventh ShuffleUnit submodule is connected to the input of the 32-fold downsampling layer.
[0009] Preferably, the output of the third ShuffleUnit submodule is connected to the input of the 16-fold downsampling layer.
[0010] Preferably, the use of images from the training set to train the pedestrian posture estimation network model and optimize the network parameters of the pedestrian posture estimation network model specifically includes the following steps: step 301, initializing the pedestrian posture estimation network model to generate initial weights and initial biases; step 302, inputting the images from the training set as sample data into the initialized pedestrian posture estimation network model, extracting the pedestrian feature map of the input image through the backbone network, and generating the pedestrian center point position prediction value, center point offset prediction value and human body key point offset prediction value in the pedestrian feature map through the detection head module; step 303, calculating the loss value using a preset loss function, reducing the loss value and performing back propagation, and updating the weights and biases of the pedestrian posture estimation network model by repeatedly cycling forward propagation and back propagation until a preset iteration stop condition is reached, thereby generating a trained pedestrian posture estimation network model.
[0011] Preferably, the preset loss function is:
[0012] Loss=Loss Center +Loss Centeroffset +Loss keypo int s ;
[0013] Loss Center =Center XYt log(Center XY )+(1-Center XYt )log(1-Center XY );
[0014]
[0015] Loss keypo int s =(keypo int s-keypo int s t ) 2 ;
[0016] Among them, Loss Center is the loss function of the pedestrian center point position, Loss Centeroffset is the loss function of the center point offset, Loss keypo int s is the loss function of the human body key point offset; (Center XY ) is the predicted value of the pedestrian center point position, Center offset is the predicted value of the center point offset, keypo int s is the predicted value of the human key point offset, Center XYt is the true value of the pedestrian center point position in the image in the training set, is the true value of the center point offset of the image in the training set, keypo int s t is the true value of the human key point offset of the images in the training set.
[0017] A second aspect of an embodiment of the present application provides an electronic device, including:
[0018] processor; and one or more processors; one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include instructions for executing the method as described above.
[0019] According to a third aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0020] The present application provides a method for estimating human posture, an electronic device and a storage medium, which collect images of pedestrian postures and preprocess the images of pedestrian postures to form a training set; construct a pedestrian posture estimation network model, the pedestrian posture estimation network model includes a backbone network based on DLA_Shufflenet, a feature fusion module and a detection head module; use the images of the training set to train the pedestrian posture estimation network model to optimize the network parameters of the pedestrian posture estimation network model; collect real-time pedestrian posture images, and detect the position of the human body center point, the offset of the center point and the offset of the human body key points in the real-time pedestrian posture image based on the trained pedestrian posture estimation network model. Therefore, the present application adopts a single-step human posture estimation algorithm based on the DLA_shufflenet backbone network, simplifies the structure of the pedestrian posture estimation network, greatly reduces the amount of calculation, and makes the human posture estimation method easy to deploy on edge devices such as service robots.
[0021] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The above and other objects, features and advantages of the present application will become more apparent through a more detailed description of exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.
[0023] Figure 1 is a flow chart of a method for estimating a human body posture according to an embodiment of the present application;
[0024] Figure 2is a schematic diagram of the structure of a pedestrian posture estimation network model shown in an embodiment of the present application;
[0025] Figure 3 It is a structural diagram of the ShuffleUnit submodule shown in the embodiment of the present application;
[0026] Figure 4 is a schematic diagram of the structure of a backbone network shown in an embodiment of the present application;
[0027] Figure 5 is a structural diagram of a feature fusion module shown in an embodiment of the present application;
[0028] Figure 6 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The preferred embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.
[0030] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0031] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0032] The robot of the embodiment of the present invention can be constructed into any suitable shape to realize specific business function operation. For example, the robot of the embodiment of the present invention can be a delivery robot, a handling robot, a nursing robot, etc. The robot generally includes a shell, a sensor unit, a driving wheel component, a storage component and a controller. The outer shape of the shell is generally circular. In some embodiments, the outer shape of the shell can be generally elliptical, triangular, D-shaped, cylindrical or other shapes. The sensor unit is used to collect some motion parameters of the robot and various data of the environment space. In some embodiments, the sensor unit includes a laser radar, which is installed above the shell, and its installation height is higher than the top shell height of the shell. The laser radar is used to detect the obstacle distance between the robot obstacles. In some embodiments, the sensor unit may also include an inertial measurement unit (IMU), a gyroscope, a magnetic field meter, an accelerometer or a speedometer, an optical camera, etc. The driving wheel component is installed on the shell and drives the robot to move in various spaces. In some embodiments, the driving wheel component includes a left driving wheel, a right driving wheel and an omnidirectional wheel, and the left driving wheel and the right driving wheel are respectively installed on opposite sides of the shell. The left drive wheel and the right drive wheel are configured to at least partially extend and retract the bottom of the shell. The omnidirectional wheel is installed at the front position of the bottom of the shell. The omnidirectional wheel is a movable caster that can rotate 360 degrees horizontally so that the robot can turn flexibly. The installation of the left drive wheel, the right drive wheel and the omnidirectional wheel forms a triangle to improve the stability of the robot's walking. Of course, in some embodiments, the drive wheel component can also adopt other structures, such as the omnidirectional wheel can be omitted, and only the left drive wheel and the right drive wheel can drive the robot to walk normally. In some embodiments, the robot is also equipped with a storage component, which is installed in the receiving slot to complete the delivery task, etc. The controller is electrically connected to the left drive wheel, the right drive wheel, the omnidirectional wheel and the laser radar respectively. The controller serves as the control core of the robot and is used to control the robot to walk, retreat and process some business logic.
[0033] In some embodiments, the controller may be a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single chip microcomputer, an AR (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component or any combination of these components. In addition, the controller may also be any conventional processor, controller, microcontroller or state machine. The controller may also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in combination with a DSP and / or any other such configuration. In some embodiments, during the activity of the above-mentioned robot, the controller uses SLAM (simultaneous localization and mapping) technology to construct a map and locate according to environmental data, thereby moving to the target location to complete delivery tasks, cleaning tasks, etc. The controller instructs the robot to completely traverse an environmental space based on the established map and the position of the robot through a full coverage path planning algorithm. For example, when the robot traverses, the sensor unit acquires an image of the traversed area, wherein the image of the traversed area may be an image of the entire traversed area, or an image of a local traversed area in the entire traversed area. The controller generates a map based on the image of the traversed area, and the map indicates the area that the robot needs to traverse and the coordinate positions of the obstacles in the traversed area. After the robot traverses each position or area, the robot marks the position or area as having been traversed based on the map. In addition, since the obstacles are marked in the map in the form of coordinates, when the robot traverses, it can judge the distance between the obstacle and the coordinate point corresponding to the current position and the coordinate point involved in the obstacle, thereby realizing the traversal work around the obstacle. Similarly, after the position or area has been traversed and marked, when the robot's next position will move to the position or area, the robot makes a strategy of turning around or stopping the traversal based on the map and the mark of the position or area. It can be understood that the controller can also identify the traversed position or area in a variety of ways, or identify obstacles, so as to make a control strategy that meets the product requirements.
[0034] The technical solution of the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0035] See also Figure 1 as well as Figure 2 , Figure 1 This is a flow chart of a method for estimating a human body posture according to the first embodiment of the present application. Figure 2 This is a schematic diagram of the structure of a pedestrian posture estimation network model shown in the first embodiment of the present application.
[0036] like Figure 1 as well as Figure 2 As shown, the method comprises the following steps:
[0037] Step S1, collecting images of pedestrian postures, and preprocessing the images of pedestrian postures to form a training set;
[0038] Specifically, in this example, a camera device on a service robot is used to collect images of pedestrian postures. The camera device can be a camera or other device that can collect images of objects.
[0039] In a preferred embodiment, the camera of the indoor mobile robot randomly collects images of pedestrian postures in various indoor scenes, saves a frame every 10 seconds, and collects 10,000 data images for each indoor scene, with a total data size of 100,000 to 200,000.
[0040] Step 2, constructing a pedestrian posture estimation network model, wherein the pedestrian posture estimation network model includes a backbone network based on DLA_Shufflenet, a feature fusion module and a detection head module;
[0041] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of the ShuffleUnit submodule shown in the first embodiment of the present application.
[0042] like Figure 3 As shown in the figure, Shufflenet is a lightweight convolutional neural network design structure. Mobile devices such as robots need a small model that is both fast and accurate due to limited computing power. Shufflenet network takes into account both speed and accuracy performance. DLA (Deep layer Aggregation) is an iterative layer aggregation network that fuses information between different stages and blocks. In the field of human posture estimation, the DLA network can fully mine semantic information and regress more accurate human key points.
[0043] The backbone network includes a ShuffleUnit submodule, which includes: a channel splitter (Channel Split), a first convolutional layer, a second convolutional layer, a third convolutional layer, a concatenator, and a channel reorganizer. The structure of the ShuffleUnit submodule is as follows according to the processing order of the computing units:
[0044] The channel separator is used to divide the input feature map into two sub-branches according to the channel dimension; one of the sub-branches includes the first convolution layer, the second convolution layer and the third convolution layer. The first convolution layer adopts standard convolution with a convolution kernel size of 1*1; the second convolution layer adopts depthwise separable convolution with a convolution kernel size of 3*3; the third convolution layer is a standard convolution with a convolution kernel size of 1*1. The concatenator is used to reconnect the two sub-branches of the feature map in series. The channel reorganizer is used to rearrange the two sub-branches of the feature map connected in series by the concatenator according to the channel dimension.
[0045] Among them, Input is the output result of the upper layer submodule, and OtherInput is the output result from the cross-layer. Channel Split is to divide the input feature map into two sub-branches according to the channel dimension. Concat means that the input is merged according to the channel dimension. Channel Shuffle means that the feature map is rearranged according to the channel dimension. The specific algorithm is defined as follows:
[0046] X=X.reshape(B,H,W,C / g,g)
[0047] X=X.transpose([0,1,2,4,3])
[0048] X=X.reshape(B,H,W,C).
[0049] Among them, reshape is to transform the size of the feature calculation matrix of the feature graph from [B, H, W, C] to [B, H, W, C / g, g];
[0050] B = batch, which refers to the number of batches. When n images are calculated at the same time, B = n;
[0051] H: height of the feature map;
[0052] W: score width of the feature map;
[0053] C: number of channels of the feature map;
[0054] g: calculate the number of groups;
[0055] Where Transpose: means to perform transpose operation on matrix X;
[0056] [0,1,2,4,3] are the parameters of the transpose operation, specifically the data transposition exchange of the matrix dimension 4 and 3, that is, [B,H,W,C / g,g]->[B,H,W,g,C / g]
[0057] Finally, by reshaping to the original size [B, H, W, C], the purpose of shuffling data from different channel groups can be achieved.
[0058] Please refer to Figure 4 , Figure 4 This is a schematic diagram of the structure of the backbone network shown in the first embodiment of the present application.
[0059] like Figure 4 As shown, the backbone network is composed of multiple ShuffleUnit submodules stacked together, and the structure of the backbone network is as follows according to the processing order of the computing units:
[0060] A first convolution unit, wherein the first convolution unit adopts standard convolution, and the convolution kernel size is 3*3;
[0061] A maximum pooling unit, used for performing feature dimension reduction on the output of the first convolution unit;
[0062] A first ShuffleUnit submodule, used for extracting features from the output of the maximum pooling unit;
[0063] A second ShuffleUnit submodule, used for performing feature extraction on the output of the first ShuffleUnit submodule;
[0064] A third ShuffleUnit submodule, used for performing feature extraction on the output of the second ShuffleUnit submodule;
[0065] A fourth ShuffleUnit submodule, used for performing feature extraction on the output of the third ShuffleUnit submodule;
[0066] A fifth ShuffleUnit submodule, used for performing feature extraction on the output of the fourth ShuffleUnit submodule;
[0067] A sixth ShuffleUnit submodule, used for performing feature extraction on the output of the fifth ShuffleUnit submodule;
[0068] The seventh ShuffleUnit submodule is used to extract features from the output of the sixth ShuffleUnit submodule.
[0069] The backbone network uses Shufflenet as a feature extractor to extract high-dimensional features in pedestrian images, filter out invalid background information interference, and generate a high-dimensional feature map.
[0070] Please refer to Figure 5 , Figure 5This is a schematic diagram of the structure of the feature fusion module shown in the first embodiment of the present application.
[0071] like Figure 5 As shown, the structure of the feature fusion module is as follows according to the processing order of the computing units:
[0072] Bilinear upsampling unit, used to obtain features from the output of the 32-fold downsampling layer;
[0073] A standard convolution unit with a convolution kernel size of 3*3, wherein the standard convolution unit is used to convolve the output of the bilinear upsampling unit;
[0074] The concatenation unit Concat is used to fuse the output of the 16-fold downsampling layer and the output of the 32-fold downsampling layer;
[0075] Transposed convolution unit, used to output the final fusion features.
[0076] The main purpose of the feature fusion module is to integrate the shallow and deep network output information, and fuse pedestrian feature images of different sizes into a unified size for processing. In the human posture estimation network based on the Centernet network, the transposed convolution module is used, which can be understood as an upsampling module with learnable parameters, but this module also brings a certain amount of calculation. In this embodiment, a combination of a bilinear upsampling unit and a transposed convolution unit is used to simplify the network complexity and reduce the amount of calculation while retaining certain learnable parameters of the network.
[0077] The feature fusion module fuses the output results from the 16-fold downsampling and 32-fold downsampling layers. The 32-fold downsampling layer uses bilinear upsampling to directly obtain the result, which is combined with the result of the 16-fold downsampling layer, and the final fused feature is output by the learnable upsampling transposed convolution layer.
[0078] In one of the embodiments, the output of the seventh ShuffleUnit submodule is connected to the input of the 32-fold downsampling layer.
[0079] In one of the embodiments, the output of the third ShuffleUnit submodule is connected to the input of the 16-fold downsampling layer.
[0080] In one embodiment, the main function of the detection head module is to predict the center point position Center_xy of the human body in the image, the center point offset Center_offset, and the human key point offset Keypoints_offset. In this embodiment, the input image size of the network is 320*320. After passing through the feature fusion module, a feature layer of size 40*40 will be obtained. The predicted center point position Center_xy indicates which specific square of 40*40 the pedestrian target center falls in, Center_offset indicates the position of the center point in the square, and Keypoints_offset indicates the position of the human key point relative to the center point.
[0081] Step 3, using the images of the training set to train the pedestrian posture estimation network model, and optimizing the network parameters of the pedestrian posture estimation network model;
[0082] Specifically, the method of using the images in the training set to train the pedestrian posture estimation network model and optimizing the network parameters of the pedestrian posture estimation network model specifically includes the following steps:
[0083] Step S301, initializing the pedestrian posture estimation network model to generate initial weights and initial biases;
[0084] Step S302, inputting the image of the training set as sample data into the initialized pedestrian posture estimation network model, extracting the pedestrian feature map of the input image through the backbone network, and generating the pedestrian center point position prediction value, center point offset prediction value and human body key point offset prediction value in the pedestrian feature map through the detection head module;
[0085] Step S303, using a preset loss function to calculate the loss value, reducing the loss value and performing back propagation, updating the weights and biases of the pedestrian posture estimation network model by repeatedly cycling forward propagation and back propagation until a preset iteration stop condition is reached, thereby generating a trained pedestrian posture estimation network model.
[0086] In one embodiment, the preset loss function is:
[0087] Loss=Loss Center +Loss Centeroffset +Loss keypo int s ;
[0088] Loss Center =Center XYt log(Center XY )+(1-Center XYt )log(1-CenterXY );
[0089]
[0090] Loss keypo int s =(keypo int s-keypo int s t ) 2 ;
[0091] Among them, Loss Center is the loss function of the pedestrian center point position, Loss Centeroffset is the loss function of the center point offset, Loss keypo int s is the loss function of the human body key point offset; (Center XY ) is the predicted value of the pedestrian center point position, Center offset is the predicted value of the center point offset, keypo int s is the predicted value of the human key point offset, Center XYt is the true value of the pedestrian center point position in the image in the training set, is the true value of the center point offset of the image in the training set, keypo int s t is the true value of the human key point offset of the images in the training set.
[0092] In a preferred embodiment, the preset loss function is minimized by using a momentum stochastic gradient descent method with a momentum parameter of 0.9, a weight decay of 0.001 and a slowly decreasing learning rate polynomial, and the training is terminated after 100 training times, the network parameters of the pedestrian posture estimation network model are saved, and a trained pedestrian posture estimation network model is generated.
[0093] Step 4, collect real-time pedestrian posture images, and detect the center point position, center point offset and human key point offset of the real-time pedestrian posture image based on the trained pedestrian posture estimation network model, so as to obtain the predicted value Center_XY of the center point position, the predicted value Center_offset of the center point offset and the predicted value Keypoints_offset of the human key point offset, and finally obtain the position of the center point (Center) and key points (keypoints) of the human body in the picture. The definition is as follows:
[0094] Center=8*(Center XY +Center ofset );
[0095] Keypo int s=Center+8*keypo int s offset ;
[0096] In this embodiment, a training set is formed by collecting images of pedestrian postures and preprocessing the images of pedestrian postures; a pedestrian posture estimation network model is constructed, and the pedestrian posture estimation network model includes a backbone network based on DLA_Shufflenet, a feature fusion module and a detection head module; the pedestrian posture estimation network model is trained using the images of the training set to optimize the network parameters of the pedestrian posture estimation network model; real-time pedestrian posture images are collected, and the position of the human body center point, the offset of the center point and the offset of the human body key points in the real-time pedestrian posture image are detected based on the trained pedestrian posture estimation network model, so that the pedestrian posture estimation network model is lightweight, the calculation time of the human body posture estimation algorithm is greatly reduced, and the behavioral interaction ability between the service robot and the service object is improved; at the same time, this application adopts a single-step human body posture estimation algorithm based on the DLA_shufflenet backbone network, which simplifies the structure of the pedestrian posture estimation network, greatly reduces the amount of calculation, and makes the human body posture estimation method easy to deploy on edge devices such as service robots.
[0097] Figure 6 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application.
[0098] See also Figure 6 , the electronic device 400 includes a memory 410 and a processor 420.
[0099] The processor 420 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0100] The memory 410 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, ROM can store static data or instructions required by the processor 1020 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In some other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at run time. In addition, the memory 410 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 410 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (such as a DVD-ROM, a double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (such as an SD card, a mini SD card, a Micro-SD card, etc.), a magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and transient electronic signals transmitted wirelessly or wired.
[0101] The memory 410 stores executable codes, and when the executable codes are processed by the processor 420 , the processor 420 can execute part or all of the methods described above.
[0102] The scheme of the present application has been described in detail above with reference to the accompanying drawings. In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, refer to the relevant description of other embodiments. Those skilled in the art should also know that the actions and modules involved in the description are not necessarily required for the present application. In addition, it can be understood that the steps in the method of the embodiment of the present application can be adjusted in order, merged and deleted according to actual needs, and the modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0103] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.
[0104] Alternatively, the present application can also be implemented as a non-temporary machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) on which executable code (or computer program, or computer instruction code) is stored. When the executable code (or computer program, or computer instruction code) is executed by a processor of an electronic device (or electronic device, server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.
[0105] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the application herein may be implemented as electronic hardware, computer software, or combinations of both.
[0106] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system and method according to multiple embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a part of a module, a program segment or a code, and the part of the module, the program segment or the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or the flow chart, and the combination of the square boxes in the block diagram and / or the flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0107] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A human posture estimation method for service robots, It is characterized in that The following steps are involved: Step 1, collecting images of pedestrian postures, and preprocessing the images of pedestrian postures to form a training set; Step 2, constructing a pedestrian posture estimation network model, wherein the pedestrian posture estimation network model includes a backbone network based on DLA_Shufflenet, a feature fusion module and a detection head module; Step 3, using the images of the training set to train the pedestrian posture estimation network model, and optimizing the network parameters of the pedestrian posture estimation network model; Step 4, collecting real-time pedestrian posture images, and detecting the human body center point position, center point offset and human body key point offset in the real-time pedestrian posture images based on the trained pedestrian posture estimation network model; The backbone network includes a ShuffleUnit submodule, and the structure of the ShuffleUnit submodule is as follows according to the processing order of the computing units: Channel separator, which is used to divide the input feature map into two sub-branches according to the channel dimension; The first convolution layer uses standard convolution with a convolution kernel size of 1*1; The second convolutional layer uses depth-wise separable convolution with a convolution kernel size of 3*3; The third convolution layer is a standard convolution with a convolution kernel size of 1*1; A concatenator, used to concatenate the two sub-branches of the feature map together again; A channel reorganizer, used for rearranging the two sub-branches of the feature map concatenated by the concatenator according to the channel dimension; The structure of the backbone network is as follows according to the processing order of the computing units: A first convolution unit, wherein the first convolution unit adopts standard convolution, and the convolution kernel size is 3*3; A maximum pooling unit, used for performing feature dimension reduction on the output of the first convolution unit; A first ShuffleUnit submodule, used for extracting features from the output of the maximum pooling unit; A second ShuffleUnit submodule, used for performing feature extraction on the output of the first ShuffleUnit submodule; A third ShuffleUnit submodule, used for performing feature extraction on the output of the second ShuffleUnit submodule; A fourth ShuffleUnit submodule, used for performing feature extraction on the output of the third ShuffleUnit submodule; A fifth ShuffleUnit submodule, used for performing feature extraction on the output of the fourth ShuffleUnit submodule; A sixth ShuffleUnit submodule, used for performing feature extraction on the output of the fifth ShuffleUnit submodule; A seventh ShuffleUnit submodule, used for performing feature extraction on the output of the sixth ShuffleUnit submodule; The structure of the feature fusion module is as follows according to the processing order of the computing units: Bilinear upsampling unit, used to obtain features from the output of the 32-fold downsampling layer; A standard convolution unit with a convolution kernel size of 3*3, wherein the standard convolution unit is used to convolve the output of the bilinear upsampling unit; A concatenation unit is used to fuse the output of the 16-fold downsampling layer and the output of the 32-fold downsampling layer; Transposed convolution unit, used to output the final fusion features; The output of the seventh ShuffleUnit submodule is connected to the input of the 32-fold downsampling layer; the output of the third ShuffleUnit submodule is connected to the input of the 16-fold downsampling layer; The method of using the images in the training set to train the pedestrian posture estimation network model and optimizing the network parameters of the pedestrian posture estimation network model specifically includes the following steps: Step 301, initializing the pedestrian posture estimation network model to generate initial weights and initial biases; Step 302, inputting the image of the training set as sample data into the initialized pedestrian posture estimation network model, extracting the pedestrian feature map of the input image through the backbone network, and generating the pedestrian center point position prediction value, center point offset prediction value and human body key point offset prediction value in the pedestrian feature map through the detection head module; Step 303, using a preset loss function to calculate the loss value, reducing the loss value and performing back propagation, updating the weights and biases of the pedestrian posture estimation network model by repeatedly cycling forward propagation and back propagation until a preset iteration stop condition is reached, thereby generating a trained pedestrian posture estimation network model.
2. The method for estimating human body posture according to claim 1, It is characterized in that The preset loss function is: Loss=Loss Center +Loss Centeroffset +Loss keypoints ; Loss Center =Center XYt log(Center XY )+(1-Center XYt )log(1-Center XY ); Loss keypoints =(keypoints-keypoints t ) 2 ; Among them, Loss Center is the loss function of the pedestrian center point position, Loss Centeroffset is the loss function of the center point offset, Loss keypoints is the loss function of the human body key point offset; Center XY Center is the predicted value of the pedestrian center point position. offset is the predicted value of the center point offset, keypoints is the predicted value of the human body key point offset, Center XYt is the true value of the pedestrian center point position in the image in the training set, is the true value of the center point offset of the image in the training set, keypoints t is the true value of the human key point offset of the images in the training set.
3. An electronic device, include: Memory; one or more processors; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising instructions for executing the method according to claim 1 or 2.
4. A storage medium storing a computer program, It is characterized in that When the computer program is executed by a processor, the human body posture estimation method according to claim 1 or 2 is implemented.
