A gait data expansion method for generating gait silhouette images based on skeleton data
By generating gait silhouettes based on skeleton data, the problem of data collection and privacy protection in gait recognition technology is solved, high-quality new ID samples can be generated from a small amount of data, and the performance and usability of the gait recognition model are improved. , which solves the problem of limited performance improvement caused by differences in data sets in the existing technology.
Patent Information
- Application Number
- CN202410727439.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-06
AI Technical Summary
Existing gait recognition technology has challenges in data collection and privacy protection, resulting in limited usability and promotion of gait recognition models in the real world, and existing data augmentation methods cannot effectively resolve differences between different data sets. Resulting in limited performance improvement.
The gait data expansion method is used to generate gait silhouette images based on skeleton data. By constructing the skeleton generation silhouette network Ske2SilNet, the graph convolution network and CNN encoder and decoder are used to generate new silhouette sequences, and the mean square error and adversarial loss are introduced. , to ensure the similarity and discrimination between the generated samples and real samples, and use the SkeS algorithm to modify the skeleton structure to generate new ID information.
It is possible to directly generate pedestrian samples with new IDs from a small amount of data, effectively expanding the scale of training data and improving the performance of the gait recognition model. There is no data offset between the generated data and the training set, and the performance is significantly improved.
Smart Images

Figure CN118298515B
Abstract
Description
Technical Field
[0001] The invention belongs to the field of image processing, and in particular relates to a gait data expansion method for generating a gait silhouette image based on skeleton data. Background Art
[0002] The development of convolutional neural networks (CNNs) has greatly promoted the development of gait recognition methods. As a deep learning algorithm, CNN relies heavily on the quantity and diversity of training data to effectively generalize to new and unseen data. However, due to security and privacy issues, it is not realistic to collect a large amount of diverse training data in the real world, which limits the promotion of gait recognition in the real world. Regarding security, collecting gait data may involve physical contact or require individuals to walk on dedicated equipment, which poses potential safety risks, especially for vulnerable groups or in public places. In terms of privacy, since gait data contains personal biometric information and concerns about information leakage or unauthorized use, individuals are reluctant to participate in data collection. These data collection restrictions may hinder the full realization of the potential of gait recognition models.
[0003] These problems seriously affect the availability and promotion scope of gait recognition in reality. Therefore, by designing a gait data expansion method, it is possible to collect only a small amount of data and supplement it with data expansion to obtain a large amount of data, further improving the performance of the gait recognition model.
[0004] Gait recognition methods can be divided into skeleton-based, silhouette-based, and combined skeleton and silhouette methods. These methods achieve high performance when the number of training set samples is much larger than the number of test set samples, but their performance drops significantly when the number of training set samples is reduced. In this case, gait data augmentation becomes an effective method to improve performance. However, only a few existing works have studied gait data augmentation. Chen Xin et al. used StarGAN to generate samples of different views for each person when the shooting views of the training set are significantly different from those of the test set. Zhang Pengyi et al. used the game development engine Unity to create multiple virtual IDs. However, their method did not address the differences between different data sets (virtual human samples built by Unity and real samples), resulting in limited performance improvement. The present invention aims to generate new IDs directly based on the features of the original real training data, thereby minimizing the gap between the generated samples and the real samples. Summary of the invention
[0005] In view of the above problems existing in the prior art, the present invention proposes a gait data expansion method for generating a gait silhouette image based on skeleton data. The method has a reasonable design, solves the shortcomings of the prior art, and has good effects.
[0006] A gait data expansion method for generating a gait silhouette image based on skeleton data comprises the following steps:
[0007] S1. Use real silhouette sequences to build a training set, and use the training set to pre-train the gait recognition network GaitSet to maximize the network's ability to distinguish different IDs in the training set. ID represents the identity of the pedestrian, and one pedestrian corresponds to one ID.
[0008] S2. Construct a skeleton generation silhouette network Ske2SilNet and train Ske2SilNet until it reaches Nash equilibrium. The Ske2SilNet training framework includes Ske2SilNet, discriminator and ID feature retention modules.
[0009] S3. Use the SkeS algorithm to synthesize the skeleton sequence corresponding to the new ID information, and use the trained Ske2SilNet to generate the silhouette sequence.
[0010] Further, the Ske2SilNet is used to convert the generated skeleton sequence into a silhouette sequence, which includes a skeleton point encoder, a skeleton image encoder and a skeleton silhouette decoder;
[0011] The skeleton point encoder uses a graph convolutional network to encode the coordinates of the key points of the body, and the output of the skeleton point encoder is input into the linear layer. The key points are mapped to a vector of length 176, which is then converted into a 16×11 feature map through a reshape operation;
[0012] The skeleton image encoder uses CNN to encode the skeleton image sequence and outputs a 16×11 feature map;
[0013] Use element-by-element addition to aggregate the feature maps of SkePEnc and SkeIEnc, and then input the aggregated feature maps into the skeleton silhouette decoder. The skeleton silhouette decoder consists of two upsampling layers and multiple convolutional layers, and the output is a silhouette sequence. , the expression is:
[0014] ;
[0015] in, is the skeleton sequence, i.e. the coordinates of different key points on the body, through Matrix representation, is the number of samples in the skeleton sequence, is the number of key points, Represents the two-dimensional coordinates of each key point; is a skeleton image sequence; To generate a silhouette sequence; It is a skeleton silhouette decoder; is the skeleton point encoder; is a skeleton image encoder.
[0016] Furthermore, the mean square error loss is introduced, which quantifies the average square difference between the output silhouette sequence and the true silhouette sequence, and the expression is:
[0017] ;
[0018] in, is the mean square error loss; and Respectively represent the number of frames, height and width of the output silhouette sequence; represents the true silhouette sequence, Represents the index of a pixel in the sequence, that is, the first pixel in the sequence frame OK Column of pixels.
[0019] Furthermore, the discriminator includes 4 convolutional layers and 2 fully connected layers to ensure the difference between the real silhouette sequence and the generated silhouette sequence, i.e., the adversarial loss ,The goal during training is to minimize the adversarial loss; The expression is:
[0020] ;
[0021] in, For adversarial loss, represents the discriminator, It is a true silhouette sequence.
[0022] Furthermore, the ID feature retention module, i.e., the gait recognition network trained in step 1, concatenates the generated silhouette sequence and the real silhouette sequence in the batch dimension and inputs them into the ID feature retention module, and uses the identity retention loss Constraint generation sequence ID information, The expression is:
[0023] ;
[0024] in, represents the pre-trained gait recognition model, express The dimension of the extracted features, Indicates the index of the gait feature.
[0025] Furthermore, the overall loss function of Ske2SilNet is for:
[0026] .
[0027] Furthermore, step S3 is specifically as follows:
[0028] First, the skeleton data is represented by a directed acyclic graph (DAG) to ensure that there is no loop in the skeleton structure. The parts of the human body are represented by line segments, and each part is defined by two joint points. The root key point is selected, and all key points except the root key point are converted into relative coordinates based on DAG. The breadth-first search algorithm is used, starting from the root key point, to sequentially calculate the difference between the end point and the starting point of each line segment.
[0029] Secondly, each line segment in the DAG is assigned a unique identifier, representing a different part of the skeleton; one or more identifiers are randomly selected, and different scaling factors are assigned to the selected identifiers. The scaling factors are used to reduce or expand the distance between the two joint points corresponding to each part, and the range is (0.6, 0.8) and (1.2, 1.4);
[0030] Finally, starting from the root keypoint, the modified relative coordinates are converted back to absolute coordinates, resulting in a new skeleton.
[0031] Beneficial technical effects brought by the present invention:
[0032] The present invention proposes a method for directly expanding data from training samples, which can generate pedestrians with new IDs from the training sample distribution and effectively expand the scale of training data. Using the expanded samples for training can effectively improve the performance of the gait recognition model. Compared with other data generation methods, the advantages of the method of the present invention are: 1. No additional software is required for data expansion; 2. There is no data offset between the generated data samples and the training set, which can more effectively expand the original data distribution. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a flowchart of using real silhouette sequences to train a gait recognition network in the present invention.
[0034] Figure 2 This is a flowchart of the Ske2SilNet training in the present invention.
[0035] Figure 3 The flowchart of the present invention is to train the gait recognition network using training samples expanded by the data expansion method.
[0036] Figure 4 This is a diagram of the Ske2SilNet network structure in an embodiment of the present invention.
[0037] Figure 5This is a flowchart of using the Skes algorithm to modify the skeleton in the present invention, wherein (a) is the original unmodified skeleton structure diagram; (b) is the skeleton structure diagram showing the modified part and modification method; and (c) is the modified skeleton structure diagram. DETAILED DESCRIPTION
[0038] The specific implementation of the present invention is further described below in conjunction with specific embodiments:
[0039] A gait data expansion method for generating a gait silhouette image based on skeleton data comprises the following steps:
[0040] S1. Use real silhouette sequences to build a training set, and use the training set to pre-train the gait recognition network GaitSet to maximize the network's ability to distinguish different IDs in the training set, such as Figure 1 As shown, ID represents the identity of the pedestrian, one pedestrian corresponds to one ID, one ID corresponds to multiple silhouette sequences or skeleton sequences, and the silhouette sequence and the skeleton sequence are different representations of the gait pattern;
[0041] This process uses triplet loss ( ) to constrain, The expression is as follows:
[0042] ;
[0043] Among them, ReLU represents the ReLU activation function, and are the distances from the anchor point to the positive sample and from the anchor point to the negative sample in the triplet, is the margin;
[0044] S2. Construct a skeleton-generated silhouette network Ske2SilNet and train Ske2SilNet until it reaches Nash equilibrium. The silhouette images generated by Ske2SilNet are both realistic and contain enough discriminative information for effective gait recognition.
[0045] like Figure 2 As shown, the Ske2SilNet training framework includes Ske2SilNet, discriminator and ID feature retention modules, and Ske2SilNet is used to convert skeleton sequences into silhouette sequences;
[0046] Among them, Ske2SilNet is used to convert the generated skeleton sequence into a silhouette sequence, including the skeleton point encoder SkePEnc, the skeleton image encoder SkeIEnc and the skeleton silhouette decoder Ske2SilDec;
[0047] The skeleton point encoder SkePEnc uses a graph convolutional network to encode the coordinates of the key points of the body. In order to fuse the encoded features of SkePEnc and SkeIEnc, the feature map of SkePEnc is reshaped to match the size of the SkeIEnc output, that is, the output of SkePEnc is input to the linear layer. The key points are mapped to a vector of length 176, which is then converted into a 16×11 feature map through a reshape operation;
[0048] The skeleton image encoder SkeIEnc uses CNN to encode the skeleton image sequence and outputs a 16×11 feature map;
[0049] Use element-by-element addition to aggregate the feature maps of SkePEnc and SkeIEnc, and then input the aggregated feature maps into the skeleton silhouette decoder. Considering that the size of the gait silhouette image currently used for gait recognition is 64×44, the skeleton silhouette decoder Ske2SilDec consists of two upsampling layers and multiple convolutional layers, and the output is a silhouette sequence , if a larger silhouette image needs to be output, more upsampling layers can be used for processing; The expression is:
[0050] ;
[0051] in, is the skeleton sequence, i.e. the coordinates of different key points on the body, through Matrix representation, is the number of samples in the skeleton sequence, is the number of key points, Represents the two-dimensional coordinates of each key point; is a skeleton image sequence; To generate a silhouette sequence; It is a skeleton silhouette decoder; is the skeleton point encoder; is a skeleton image encoder;
[0052] In this embodiment, SkePEnc is composed of three graph convolution layers, SkeIEnc is composed of three 2D convolution layers, and Ske2SilDec includes three 2D transposed convolution layers and two upsampling layers, as shown in Table 1; Figure 4As shown, SkePEnc encodes the coordinates of the body key points (2×18), 2 refers to the x-axis and y-axis data, and 18 refers to 18 body key points. It outputs a 128×18 feature map, which is then input into the linear layer to output a 128×176 vector, which is converted into a 128×16×11 feature map through a reshaping operation; SkeIEnc uses CNN to encode a 1×64×44 skeleton image sequence and outputs a 128×16×11 feature map; element-by-element addition is used to aggregate the feature maps of SkePEnc and SkeIEnc, and the aggregated feature maps are input into the skeleton silhouette decoder to output a 1×64×44 silhouette image.
[0053] Table 1 Ske2SilNet module structure;
[0054] ;
[0055] The mean square error loss is introduced, which quantifies the average square difference between the output silhouette sequence and the true silhouette sequence, and the expression is:
[0056] ;
[0057] in, is the mean square error loss; and Respectively represent the number of frames, height and width of the output silhouette sequence; represents a frame in the true silhouette sequence, Represents the index of a pixel in the sequence, that is, the first pixel in the sequence frame OK Column of pixels.
[0058] The discriminator consists of 4 convolutional layers and 2 fully connected layers to ensure the difference between the real silhouette sequence and the generated silhouette sequence, i.e., the adversarial loss ,The goal during training is to minimize the adversarial loss; The expression is:
[0059] ;
[0060] in, For adversarial loss, represents the discriminator, It is a true silhouette sequence.
[0061] The ID feature retention module is the gait recognition network trained in step 1, which is used to make the generated silhouette sequence contain discriminative ID information; the generated silhouette sequence and the real silhouette sequence are concatenated in the batch dimension and input into the ID feature retention module, and the identity retention loss is used to obtain the ID information. Constraint generation sequence ID information, The expression is:
[0062] ;
[0063] in, represents the pre-trained gait recognition model, express The dimension of the extracted features, Indicates the index of the gait feature.
[0064] Overall loss function of Ske2SilNet for:
[0065] ;
[0066] The loss function includes mean squared error loss, adversarial loss and identity preservation loss, which effectively balances the requirements of silhouette accuracy, authenticity and identity consistency in the generated sequence.
[0067] S3, use the SkeS algorithm to synthesize the skeleton sequence corresponding to the new ID information, and use the trained Ske2SilNet to generate the corresponding silhouette sequence, such as Figure 3 As shown;
[0068] First, the skeleton data is represented by a directed acyclic graph (DAG) to ensure that there is no loop in the skeleton structure. Each part of the human body is represented by a line segment, such as Figure 5 As shown in (a), each part is defined by two key points; a root key point is selected, and all key points except the root key point are converted into relative coordinates based on DAG. In this embodiment, the root key point selected is the neck; a breadth-first search algorithm is used, starting from the root key point, and the difference between the end point and the starting point of each line segment is sequentially calculated;
[0069] Second, each line segment in the DAG is assigned a unique identifier, representing a different part of the skeleton; one or more identifiers are randomly selected and different scaling factors are assigned to the selected identifiers, which are used to reduce or expand the distance between two key points corresponding to each part. The range of scaling factors is strictly limited to ensure that the modified skeleton maintains structural similarity with the human form. The line segment length, that is, the relative coordinates of the endpoints, is changed according to the identifier.
[0070] Specifically, specific body parts are selectively manipulated to produce new skeleton sequences, focusing on changing seven body parts, including forearms, upper arms, shoulders, torsos, hips, thighs, and calves. Symmetrical limbs are considered to be the same body part. For example, when modifying the forearm, the left and right forearms are modified at the same time. In order to ensure the authenticity of the modifications made, the adjustments are limited to a specific range. The contraction range of each body part is 0.6 to 0.8 times the distance between the original two joints, and the expansion range is 1.2 to 1.4 times the distance between the original two joints, that is, the range of scaling factors is (0.6, 0.8) and (1.2, 1.4); this controlled scaling range ensures that the changes in the skeleton sequence are both realistic and anatomically reasonable. In order to increase the number of synthetic IDs and avoid generating similar IDs, 1 to 3 of the 7 parts are randomly selected for modification each time, and each part in the combination can only use the same operation once. For example, if the forearm of ID X is shortened to 0.6 of the original, then the forearm of ID X will not be shortened by 0.8.
[0071] Finally, starting from the root keypoint, the modified relative coordinates are converted back to absolute coordinates, resulting in a new skeleton. Figure 5 As shown in (b), the length of the upper arm and lower leg is reduced, while the length of the hip is increased, resulting in a new skeleton as Figure 5 As shown in (c), the newly synthesized skeletons show significant differences in body structure and proportions compared to the original skeletons, thus representing unique IDs. Although changes in skeleton structure can produce different IDs, the intrinsic motion characteristics of the gait remain unchanged, so the temporal consistency of the gait sequence is preserved, reflecting the temporal consistency of the original sequence.
[0072] The newly created skeleton sequence is resized to 64×44 and input into the trained Ske2SilNet to generate the corresponding silhouette sequence.
[0073] The newly generated silhouette sequence is used together with the original real silhouette sequence to train the gait recognition model. In order to balance the contribution of generated samples and real samples to the network gradient, a weighted triplet loss is constructed. The formula of the loss function is as follows:
[0074]
[0075] in, and are the distances from the anchor point to the positive sample and from the anchor point to the negative sample in the triplet, is the margin, coefficient , and Depending on whether the anchor point, positive sample and negative sample are real or generated samples, a, p and n are three randomly selected samples.
[0076] With a large number of new ID silhouette sequences available, a gait recognition model was trained from scratch over 80,000 iterations. In each mini-batch, the number of persons (p) and the number of sequences per person (k) were the same as those of the real samples. For the generated samples, p and k were initially set to 8, then reduced to 4 at 40,000 iterations and further reduced to 2 at 70,000 iterations, while p and k of the real samples remained unchanged throughout the process. The optimizer parameters and learning rate remained the same as the original gait recognition model. This training method gradually reduces the proportion of generated samples in the training set, thereby keeping the number of real samples stable throughout the training period.
[0077] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A gait data expansion method for generating a gait silhouette image based on skeleton data, characterized in that: The following steps are involved: S1. Use real silhouette sequences to build a training set, and use the training set to pre-train the gait recognition network GaitSet to maximize the network's ability to distinguish different IDs in the training set. ID represents the identity of the pedestrian, and one pedestrian corresponds to one ID. S2. Construct a skeleton generation silhouette network Ske2SilNet and train Ske2SilNet until it reaches Nash equilibrium. The Ske2SilNet training framework includes Ske2SilNet, discriminator and ID feature retention modules. S3, use the SkeS algorithm to synthesize the skeleton sequence corresponding to the new ID information, and use the trained Ske2SilNet to generate the silhouette sequence; The Ske2SilNet is used to convert the generated skeleton sequence into a silhouette sequence, which includes a skeleton point encoder, a skeleton image encoder and a skeleton silhouette decoder; The skeleton point encoder uses a graph convolutional network to encode the coordinates of the key points of the body. The output of the skeleton point encoder is input into the linear layer. j The key points are mapped to a vector of length 176, which is then converted into a 16×11 feature map through a reshape operation; The skeleton image encoder uses CNN to encode the skeleton image sequence and outputs a 16×11 feature map; Use element-wise addition to aggregate the feature maps of SkePEnc and SkeIEnc, and then input the aggregated feature maps into the skeleton silhouette decoder. The skeleton silhouette decoder consists of two upsampling layers and multiple convolutional layers, and the output is a silhouette sequence F ed (x p , x i ), the expression is: F ed (x p ,x i )=D e (E sp (x p )+E si (x i )); Among them, x i is the skeleton sequence, that is, the coordinates of different key points on the body, through N s ×2×N j Matrix representation, N s is the number of samples in the skeleton sequence, N j is the number of key points, 2 represents the two-dimensional coordinates of each key point; x p is the skeleton image sequence; F ed (x p , x i ) is to generate a silhouette sequence; D e is the skeleton silhouette decoder; E sp (x p ) is the skeleton point encoder; E si (x i ) is a skeleton image encoder; The discriminator includes 4 convolutional layers and 2 fully connected layers to ensure the difference between the real silhouette sequence and the generated silhouette sequence, that is, the adversarial loss L adv , the goal during training is to minimize the adversarial loss; L adv The expression is: L adv =log e D(x rs )+log e (1-D(F ed )); Among them, L adv is the adversarial loss, D represents the discriminator, and x rs It’s a true silhouette sequence; The ID feature retention module is the gait recognition network trained in step 1. The generated silhouette sequence and the real silhouette sequence are concatenated in the batch dimension and input into the ID feature retention module. id Generate sequence ID information, L id The expression is: Among them, f gait (·) represents the pre-trained gait recognition model, K represents f gait (·) The dimension of the extracted features, k represents the index of the gait feature; Step S3 is specifically as follows: First, the skeleton data is represented by a directed acyclic graph (DAG) to ensure that there is no loop in the skeleton structure. The parts of the human body are represented by line segments, and each part is defined by two joint points. The root key point is selected, and all key points except the root key point are converted into relative coordinates based on DAG. The breadth-first search algorithm is used, starting from the root key point, to sequentially calculate the difference between the end point and the starting point of each line segment. Secondly, each line segment in the DAG is assigned a unique identifier, representing a different part of the skeleton; one or more identifiers are randomly selected, and different scaling factors are assigned to the selected identifiers. The scaling factors are used to reduce or expand the distance between the two joint points corresponding to each part, and the range is (0.6, 0.8) and (1.2, 1.4); Finally, starting from the root keypoint, the modified relative coordinates are converted back to absolute coordinates, resulting in a new skeleton.
2. The gait data expansion method for generating a gait silhouette image based on skeleton data according to claim 1, characterized in that: The mean square error loss is introduced, which quantifies the average square difference between the output silhouette sequence and the true silhouette sequence, and the expression is: Among them, L mse is the mean square error loss; S, H and W represent the number of frames, height and width of the output silhouette sequence respectively; x rs represents a true silhouette sequence, (s, h, w) represents the index of a pixel in the sequence, that is, the pixel in the hth row and wth column of the sth frame in the sequence.
3. The gait data expansion method for generating a gait silhouette image based on skeleton data according to claim 1, characterized in that: The overall loss function L of Ske2SilNet total for: L total =L mse +L adv +L id .
Citation Information
Patent Citations
Multi-person gait recognition method based on human skeleton heat map
CN114187665A
Cross-view gait recognition method based on hierarchical and block feature fusion
CN114677755A
Improved GaitSet infrared gait recognition method
CN116012955A
Monocular unsupervised depth estimation method based on contextual attention mechanism
US20210390723A1
Privacy-preserving human action recognition, storage, and retrieval via joint edge and cloud computing
US20220147736A1
