Data generation method and device
By decomposing the feature vectors of pedestrian image samples into identity and change components and weightedly fusing them, the sample quality problem of the pedestrian re-identification model under long-tail distribution is solved, and balanced category distribution and improved recognition effect are achieved.
Patent Information
- Application Number
- CN202110664408.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-16
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2041-06-16
AI Technical Summary
The sample quality of existing person re-identification models is easily affected by long-tail distribution data, resulting in poor recognition results.
By decomposing the feature vector of pedestrian image samples into identity component features and change component features and performing weighted fusion on them, new pedestrian image samples are generated to achieve balanced category distribution.
Without affecting the sample quality, the class balanced distribution of the pedestrian image sample set is achieved, which improves the effect of pedestrian re-identification.
Smart Images

Figure CN115482554B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data generation method and device. Background Art
[0002] In surveillance scenarios, pedestrians are key analysis targets for intelligent monitoring. Person re-identification (PNR) utilizes computer vision technology to determine whether a specific pedestrian exists in an image or video sequence. However, during PNR model training, the long-tail distribution of pedestrian sample data is a common problem.
[0003] Unbalanced learning primarily studies machine learning problems for long-tail distributed data. Data resampling is a commonly used method to address this problem. This method typically adopts an oversampling strategy, which increases the sampling frequency of tail category samples, or an undersampling strategy, which reduces the sampling frequency of head category samples. However, oversampling may cause the model to overfit to the noise information of the tail category, while undersampling may lose the effective information of the head category samples, thereby affecting sample quality and resulting in poor pedestrian re-identification results. Summary of the Invention
[0004] Embodiments of the present invention provide a data generation method and device to solve the problem that the relevant technologies for dealing with long-tail distribution problems are prone to affecting sample quality and resulting in poor pedestrian re-identification effect.
[0005] In a first aspect, an embodiment of the present invention provides a data generation method, comprising:
[0006] Acquire a first pedestrian image sample set, wherein the first pedestrian image sample set has a long-tail distribution;
[0007] Performing feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample;
[0008] Decomposing each first eigenvector into a first identity component feature and K first variation component features, where K is an integer greater than 1;
[0009] The first identity component feature and the K first change component features after decomposition of each first eigenvector are weightedly fused to obtain a second eigenvector, and the second eigenvector is used to generate a pedestrian image sample of the tail category.
[0010] Optionally, decomposing each first eigenvector into a first identity component feature and K first variation component features includes:
[0011] Using a component decomposition model, each first eigenvector is decomposed into a first identity component feature and K first change component features;
[0012] The component decomposition model is trained in the following way:
[0013] Obtain a second pedestrian image sample set;
[0014] performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample;
[0015] Using the initial component decomposition model, each third eigenvector is decomposed into a second identity component feature and K second variation component features;
[0016] Calculate the identity change decorrelation loss between the second identity component feature after decomposition of each third eigenvector and the K second change component features;
[0017] The parameters of the initial component decomposition model are trained by minimizing the identity change decorrelation loss to obtain a trained component decomposition model.
[0018] Optionally, after decomposing each third eigenvector into one second identity component feature and K second variation component features using the initial component decomposition model, the method further includes:
[0019] Calculate the multivariate decorrelation loss between the K second variation component features after decomposition of each third eigenvector;
[0020] The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises:
[0021] The parameters of the initial component decomposition model are trained by minimizing the identity change decorrelation loss and minimizing the multivariate change decorrelation loss to obtain a trained component decomposition model.
[0022] Optionally, the performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample includes:
[0023] Inputting each second pedestrian image sample in the second pedestrian image sample set into a convolutional neural network for feature extraction to obtain a third feature vector corresponding to each second pedestrian image sample;
[0024] Normalize each third eigenvector to obtain the corresponding fourth eigenvector.
[0025] The method of using the initial component decomposition model to decompose each third eigenvector into a second identity component feature and K second variation component features includes:
[0026] The initial component decomposition model is used to decompose each fourth eigenvector into a second identity component feature and K second variation component features.
[0027] Optionally, after decomposing each fourth eigenvector into one second identity component feature and K second variation component features using the initial component decomposition model, the method further includes:
[0028] The second identity component feature and K second change component features after decomposition of each fourth eigenvector are fused to obtain a fifth eigenvector;
[0029] performing a denormalization process on the fifth eigenvector to obtain a sixth eigenvector;
[0030] Calculating a Softmax loss based on the fifth eigenvector and the fourth eigenvector;
[0031] Calculating a triplet loss based on the sixth eigenvector and the third eigenvector;
[0032] Training the parameters of the convolutional neural network by minimizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained convolutional neural network;
[0033] The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises:
[0034] The parameters of the component decomposition module are trained by minimizing the identity change decorrelation loss and maximizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained component decomposition module.
[0035] Optionally, performing weighted fusion on the first identity component feature and the K first change component features after decomposition of each first eigenvector to obtain the second eigenvector includes:
[0036] Randomly assigning weights to the K first change component features after decomposition of each first eigenvector, wherein the sum of the weights assigned to the K first change component features after decomposition of each first eigenvector is 1;
[0037] The K change component features after decomposition of each first eigenvector are weighted and summed according to the assigned weights to obtain a weighted value;
[0038] The weighted value and the first identity component feature after decomposition of each first eigenvector are summed to obtain a second eigenvector.
[0039] Optionally, the first identity component feature after decomposition of each first eigenvector is equal to the sum of the first eigenvectors corresponding to each image sample in the target image sample set divided by the capacity of the target image sample set, wherein the target image sample set is an image sample set in the first pedestrian image sample set that has the same category as the first identity component feature.
[0040] Optionally, after performing feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample, and before decomposing each first feature vector into a first identity component feature and K first variation component features, the method further includes:
[0041] performing normalization processing on the first eigenvector;
[0042] After weighted fusion of the first identity component features and the K first change component features after decomposition of each first eigenvector to obtain the second eigenvector, the method further includes:
[0043] Perform denormalization processing on the second eigenvector.
[0044] In a second aspect, an embodiment of the present invention further provides a data generating device, comprising:
[0045] an acquisition module, configured to acquire a first pedestrian image sample set, wherein the first pedestrian image sample set has a long-tail distribution;
[0046] a feature extraction module, configured to perform feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample;
[0047] a component decomposition module, configured to decompose each first feature vector into a first identity component feature and K first variation component features, where K is an integer greater than 1;
[0048] The feature generation module is used to perform weighted fusion on the first identity component feature and K first change component features after decomposition of each first feature vector to obtain a second feature vector, and the second feature vector is used to generate pedestrian image samples of the tail category.
[0049] Optionally, the component decomposition module is used to decompose each first feature vector into a first identity component feature and K first change component features using a component decomposition model;
[0050] The component decomposition model is trained in the following way:
[0051] Obtain a second pedestrian image sample set;
[0052] performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample;
[0053] Using the initial component decomposition model, each third eigenvector is decomposed into a second identity component feature and K second variation component features;
[0054] Calculate the identity change decorrelation loss between the second identity component feature after decomposition of each third eigenvector and the K second change component features;
[0055] The parameters of the initial component decomposition model are trained by minimizing the identity change decorrelation loss to obtain a trained component decomposition model.
[0056] Optionally, after decomposing each third eigenvector into one second identity component feature and K second variation component features using the initial component decomposition model, the method further includes:
[0057] Calculate the multivariate decorrelation loss between the K second variation component features after decomposition of each third eigenvector;
[0058] The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises:
[0059] The parameters of the initial component decomposition model are trained by minimizing the identity change decorrelation loss and minimizing the multivariate change decorrelation loss to obtain a trained component decomposition model.
[0060] Optionally, the performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample includes:
[0061] Inputting each second pedestrian image sample in the second pedestrian image sample set into a convolutional neural network for feature extraction to obtain a third feature vector corresponding to each second pedestrian image sample;
[0062] Normalize each third eigenvector to obtain the corresponding fourth eigenvector;
[0063] The method of using the initial component decomposition model to decompose each third eigenvector into a second identity component feature and K second variation component features includes:
[0064] The initial component decomposition model is used to decompose each fourth eigenvector into a second identity component feature and K second variation component features.
[0065] Optionally, after decomposing each fourth eigenvector into one second identity component feature and K second variation component features using the initial component decomposition model, the method further includes:
[0066] The second identity component feature and K second change component features after decomposition of each fourth eigenvector are fused to obtain a fifth eigenvector;
[0067] performing a denormalization process on the fifth eigenvector to obtain a sixth eigenvector;
[0068] Calculating a Softmax loss based on the fifth eigenvector and the fourth eigenvector;
[0069] Calculating a triplet loss based on the sixth eigenvector and the third eigenvector;
[0070] Training the parameters of the convolutional neural network by minimizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained convolutional neural network;
[0071] The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises:
[0072] The parameters of the component decomposition module are trained by minimizing the identity change decorrelation loss and maximizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained component decomposition module.
[0073] Optionally, the feature generation module includes:
[0074] a weight assignment unit, configured to randomly assign weights to the K first change component features after decomposition of each first eigenvector, wherein the sum of the weights assigned to the K first change component features after decomposition of each first eigenvector is 1;
[0075] A first calculation unit is used to perform weighted summation on the K change component features after decomposition of each first eigenvector according to the assigned weights to obtain a weighted value;
[0076] The second calculation unit is used to sum the weighted value and the first identity component feature after decomposition of each first eigenvector to obtain a second eigenvector.
[0077] Optionally, the first identity component feature after decomposition of each first eigenvector is equal to the sum of the first eigenvectors corresponding to each image sample in the target image sample set divided by the capacity of the target image sample set, wherein the target image sample set is an image sample set in the first pedestrian image sample set that has the same category as the first identity component feature.
[0078] Optionally, the data generating device further includes:
[0079] A normalization module, configured to perform normalization processing on the first eigenvector;
[0080] A denormalization module is used to perform denormalization processing on the second eigenvector.
[0081] In a third aspect, an embodiment of the present invention further provides a data generating device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the data generating method described above when executing the computer program.
[0082] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the data generation method described above are implemented.
[0083] In an embodiment of the present invention, a first pedestrian image sample set is obtained, wherein the first pedestrian image sample set exhibits a long-tail distribution; feature extraction is performed on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample; each first feature vector is decomposed into a first identity component feature and K first variation component features, wherein K is an integer greater than 1; the first identity component feature and the K first variation component features after decomposition of each first feature vector are weightedly fused to obtain a second feature vector, and the second feature vector is used to generate pedestrian image samples of the tail category. In this way, by decomposing each pedestrian feature in the pedestrian image sample set exhibiting a long-tail distribution into an identity-related feature component and multiple variation-related feature components, and then weightedly fusion of the multiple decomposed feature components to generate new pedestrian image samples, a balanced distribution of categories in the pedestrian image sample set can be achieved without affecting sample quality, thereby ensuring the effect of pedestrian re-identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in describing the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0085] Figure 1 is a flow chart of a data generation method provided by an embodiment of the present invention;
[0086] Figure 2 is a schematic diagram of a long-tail person re-identification framework provided by an embodiment of the present invention;
[0087] Figure 3 This is one of the structural diagrams of the data generating device provided by an embodiment of the present invention;
[0088] Figure 4 This is the second structural diagram of the data generating device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0089] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0090] See also Figure 1 , Figure 1 is a flow chart of a data generation method provided by an embodiment of the present invention, such as Figure 1 As shown, the following steps are included:
[0091] Step 101: Acquire a first pedestrian image sample set, wherein the first pedestrian image sample set presents a long-tail distribution.
[0092] The above-mentioned first pedestrian image sample set can be a pedestrian image collected from a monitoring device as a sample set, and the first pedestrian image sample set can be a long-tail distribution, that is, the number of samples of different categories in the first pedestrian image sample set is a long-tail distribution, in which the number of samples of the head category is large and the number of samples of the tail category is small.
[0093] Step 102: Perform feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample.
[0094] The above-mentioned feature extraction is performed on each first pedestrian image sample in the first pedestrian image sample set, and each first pedestrian image sample can be converted into a one-dimensional image feature vector. Specifically, it can be implemented using a convolutional neural network (CNN). For example, the first pedestrian image sample set can be input into a convolutional neural network, and the convolutional neural network is used to perform one-dimensional feature extraction on each first pedestrian image sample in the sample set, and output a one-dimensional feature vector corresponding to each first pedestrian image sample, that is, a first feature vector, which can be represented by x.
[0095] Step 103: Decompose each first eigenvector into a first identity component feature and K first variation component features, where K is an integer greater than 1.
[0096] In the embodiment of the present invention, it can be assumed that the pedestrian feature is composed of a pedestrian identity component and multiple pedestrian variation components, so that for each first feature vector x, it can be decomposed into an identity component feature and and K variation component features Among them, the pedestrian identity component can only encode the pedestrian's identity information, and multiple pedestrian change components specifically capture different pedestrian image changes, such as pedestrian posture, body occlusion, complex background, etc.
[0097] Specifically, the pedestrian features can be decomposed into a pedestrian identity component feature and K pedestrian change component features by the independent component factorization (ICF) method, that is, the first input feature vector x can be decomposed into: in, α k ≥0,α k The weight parameter used to control the k-th pedestrian variation component feature.
[0098] Among them, the first identity component feature after decomposition of each first eigenvector is equal to the sum of the first eigenvectors corresponding to each image sample in the target image sample set divided by the capacity of the target image sample set, wherein the target image sample set is the image sample set with the same category as the first identity component feature in the first pedestrian image sample set.
[0099] Since the category center feature can greatly preserve the pedestrian identity information and exclude most of the change noise, the category center feature can be used To approximately represent the pedestrian identity information, that is, the identity component features can be used Indicates that, Indicates that it has the characteristics The index set of image samples with the same identity label, Indicates the capacity of the collection.
[0100] Then, we can use the pedestrian features, that is, the first feature vector x minus the identity component features To obtain the coarse-grained variation component characteristics Right now Since different image variation component features may be distributed in different regions in the feature space, a pedestrian variation component decomposition module can be constructed to separate the coarse-grained variation component features into Decompose into K fine-grained change component features Specifically, in, represents the parameters of the k-th pedestrian change component decomposition module, is with and Related functions.
[0101] Optionally, step 103 includes:
[0102] Using a component decomposition model, each first eigenvector is decomposed into a first identity component feature and K first change component features;
[0103] The component decomposition model is trained in the following way:
[0104] Obtain a second pedestrian image sample set;
[0105] performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample;
[0106] Using the initial component decomposition model, each third eigenvector is decomposed into a second identity component feature and K second variation component features;
[0107] Calculate the identity change decorrelation loss between the second identity component feature after decomposition of each third eigenvector and the K second change component features;
[0108] The parameters of the initial component decomposition model are trained by minimizing the identity change decorrelation loss to obtain a trained component decomposition model.
[0109] That is, in one embodiment, the multi-component decomposition of the feature vector can be completed by training a component decomposition model. Specifically, a second pedestrian image sample set can be obtained. The pedestrian image sample set can also be obtained from pedestrian images collected from monitoring equipment. It can be the same sample set as the first pedestrian image sample set, or it can be a different sample set; then, feature extraction is performed on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample. Then, each third feature vector can be input into the initial component decomposition model to be trained. The initial component decomposition model decomposes each third feature vector into an identity component feature and K change component features. The feature extraction process and the component decomposition process are similar to those described in the aforementioned steps. For details, please refer to the aforementioned related introduction and will not be repeated here.
[0110] For the feature decomposition process, it is crucial to ensure that there is no correlation between the K+1 component features to ensure the complexity of the newly generated samples. To this end, the independence between the identity component features and the variation component features can be maintained by calculating the identity variation decorrelation (IVD) loss. If the identity component features and the variation component features are independent of each other, then the predicted classification probability distribution obtained by inputting the variation component features into the identity classifier should be a uniform distribution, which can achieve the maximum information entropy and the minimum IVD loss. Specifically, the IVD loss can be calculated using the following formula: Among them, W represents the classifier weight, represents the predicted probability distribution of the classifier output, and N is the number of the second pedestrian image samples.
[0111] In this way, in the process of training the initial component decomposition model, the IVD loss can be minimized as the training goal, and the parameters of the initial component decomposition model, i.e. The training is performed until the IVD loss meets the requirements, and finally a trained component decomposition model is obtained.
[0112] In this embodiment, by training a model that can effectively decompose pedestrian features, independent components of identity and change features are obtained, which can ensure better decomposition effect and efficiency.
[0113] Optionally, after decomposing each third eigenvector into one second identity component feature and K second variation component features using the initial component decomposition model, the method further includes:
[0114] Calculate the multivariate decorrelation loss between the K second variation component features after decomposition of each third eigenvector;
[0115] The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises:
[0116] The parameters of the initial component decomposition model are trained by minimizing the identity change decorrelation loss and minimizing the multivariate change decorrelation loss to obtain a trained component decomposition model.
[0117] In another embodiment, considering that different variation component features may be interdependent and affect the component decomposition effect, the independence between different variation component features can be maintained by calculating the Multiple Variation Decorrelation (MVD) loss during the training of the component decomposition model. Specifically, the MVD loss can be calculated using the following formula: in, represents the i-th pedestrian feature, that is, the k-th change component feature of the i-th third eigenvector, express and The cosine similarity between express The absolute value of .
[0118] Thus, in the process of training the initial component decomposition model, the IVD loss and the MVD loss can be minimized as the training objective. More specifically, the weighted sum of the IVD loss and the MVD loss can be minimized as the training objective. The parameters of the initial component decomposition model, i.e. The training is performed until the IVD loss and MVD loss meet the requirements, and finally a trained component decomposition model is obtained. This embodiment can further enhance the decomposition effect of the component decomposition model.
[0119] Step 104 : performing weighted fusion on the first identity component feature and the K first change component features after decomposition of each first eigenvector to obtain a second eigenvector, wherein the second eigenvector is used to generate a pedestrian image sample of the tail category.
[0120] In this step, in order to enhance the diversity of sample data, generate fewer false features for the head category and more false features for the tail category, and solve the category imbalance problem of pedestrian re-identification sample set, the identity component features and K change component features after the decomposition of each first eigenvector can be weighted fused to generate false features. That is, the identity component features are fixed and then multiple variable component features are randomly fused to generate a false feature, that is, the second feature vector. Specifically, the factorizable feature generation (FFG) method can be used to randomly fuse K+1 component features to synthesize a new false feature, that is, in, represents the kth variation component feature, β k It can be the weight of the randomly sampled components, which can be determined by randomly sampling a uniform distribution and then summing and normalizing it.
[0121] Optionally, step 104 includes:
[0122] Randomly assigning weights to the K first change component features after decomposition of each first eigenvector, wherein the sum of the weights assigned to the K first change component features after decomposition of each first eigenvector is 1;
[0123] The K change component features after decomposition of each first eigenvector are weighted and summed according to the assigned weights to obtain a weighted value;
[0124] The weighted value and the first identity component feature after decomposition of each first eigenvector are summed to obtain a second eigenvector.
[0125] That is, when fusing the K+1 component features after the decomposition of each first eigenvector, the K change component features after the decomposition of each first eigenvector can be randomly weighted, and the sum of the weights assigned to the K change component features can be guaranteed to be 1. Then, the K change component features can be weighted and summed according to their respective assigned weights, and then summed with the corresponding identity component features to obtain the generated new features. In other words, the formula can be used The K+1 component features of each first eigenvector are fused.
[0126] It should be noted that for each first eigenvector, different second eigenvectors can be generated by fusion through multiple random weight assignments of the K component change features after decomposition, so as to increase the number of samples.
[0127] In this way, through this implementation, the component features after decomposition of each sample can be randomly fused to generate new sample features, thereby solving the problem of imbalanced sample categories.
[0128] Optionally, after step 102 and before step 103, the method further includes:
[0129] performing normalization processing on the first eigenvector;
[0130] After step 104, the method further includes:
[0131] Perform denormalization processing on the second eigenvector.
[0132] That is, in one embodiment, in order to ensure that the feature vectors of the pedestrian image samples are distributed in different feature spaces and to ensure data stability, feature extraction can be performed on each first pedestrian image sample to obtain the corresponding first feature vector, and then each first feature vector can be normalized. Specifically, the normalized first feature vector can be obtained through the batch normalization (BN) layer. After the first identity component feature and the K first change component features after decomposition of each first eigenvector are weighted and fused to obtain the second eigenvector, each second eigenvector can be denormalized. Specifically, the normalized false features can be denormalized by the batch denormalization (BDN) layer. Transformed into a non-normalized pseudo feature z.
[0133] Optionally, the performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample includes:
[0134] Inputting each second pedestrian image sample in the second pedestrian image sample set into a convolutional neural network for feature extraction to obtain a third feature vector corresponding to each second pedestrian image sample;
[0135] Normalize each third eigenvector to obtain the corresponding fourth eigenvector;
[0136] The method of using the initial component decomposition model to decompose each third eigenvector into a second identity component feature and K second variation component features includes:
[0137] The initial component decomposition model is used to decompose each fourth eigenvector into a second identity component feature and K second variation component features.
[0138] That is, in one embodiment, the features of pedestrian image samples can be extracted by training a convolutional neural network, and in order to ensure that the feature vectors of the pedestrian image samples are distributed in different feature spaces and to ensure data stability, feature extraction can be performed on each second pedestrian image sample separately, and after obtaining the corresponding third feature vector, each third feature vector can be normalized. Specifically, the normalized third feature vector can be obtained through the BN layer to obtain the corresponding fourth feature vector, so that the normalized fourth feature vector can be feature decomposed.
[0139] Optionally, after decomposing each fourth eigenvector into one second identity component feature and K second variation component features using the initial component decomposition model, the method further includes:
[0140] The second identity component feature and K second change component features after decomposition of each third eigenvector are fused to obtain a fifth eigenvector;
[0141] performing a denormalization process on the fifth eigenvector to obtain a sixth eigenvector;
[0142] Calculating a Softmax loss based on the fifth eigenvector and the fourth eigenvector;
[0143] Calculating a triplet loss based on the sixth eigenvector and the third eigenvector;
[0144] Training the parameters of the convolutional neural network by minimizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained convolutional neural network;
[0145] The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises:
[0146] The parameters of the component decomposition module are trained by minimizing the identity change decorrelation loss and maximizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained component decomposition module.
[0147] That is, after performing feature decomposition on each fourth eigenvector, the second identity component feature and K second change component features after the decomposition of each fourth eigenvector can be fused to obtain a newly generated sample feature, that is, the fifth eigenvector, and in order to obtain a non-normalized new feature, each fifth eigenvector after fusion can be denormalized to obtain a non-normalized sixth eigenvector.
[0148] In this implementation, it is considered that although the FFG method can alleviate the long-tail distribution problem of category samples by generating false features, it ignores the imbalance problem between simple samples and difficult samples. Therefore, in order to solve the imbalance problem of difficult and easy samples, it is proposed to use the Adversarial Feature Generation (AFG) method to train the component decomposition model by using adversarial learning to increase the number of difficult false features. Since the optimization goal of AFG is to simultaneously ensure the learning of true features with discriminative properties (minimizing the loss function) and the generation of false features with classification difficulties (maximizing the loss function), the entire model training process can be regarded as a game problem of minimum loss value and maximum loss value. Specifically, the model can be trained by calculating the Softmax loss and Triplet loss of the original sample and all newly generated samples after feature fusion, and constructing a suitable loss function. More specifically, the normalized fourth eigenvector can be and the fifth eigenvector The merged feature vector Calculate the Softmax loss, and calculate the Triplet loss for the eigenvector g after merging the non-normalized third eigenvector x and the sixth eigenvector z. The constructed loss function can be L s and L t are Softmax loss and Triplet loss respectively, λ s and λ t L s and L t The loss weight, θ D represents the learning parameters of the convolutional neural network and classifier, θ H Represents the parameters of all pedestrian change component decomposition modules, that is, the parameters of the convolutional neural network and the classifier can be trained by minimizing the weighted sum of the Softmax loss and the Triplet loss, and the parameters of the component decomposition module can be trained by maximizing the weighted sum of the Softmax loss and the Triplet loss. The parameters of the component decomposition module can also be trained in combination with the aforementioned identity change decorrelation loss IVD.
[0149] In this way, by training the model in an adversarial learning manner to increase the number of difficult-to-generate false features, this method can generate false features that are difficult to classify and improve the gradient amplitude of the model, which provides the pedestrian re-identification model with more opportunities to traverse the parameter space to obtain the optimal model parameters.
[0150] The following combination Figure 2The Long-Tailed Person Re-Identification (LTReID) framework shown in FIG. 1 is used to illustrate specific implementation methods of the present invention.
[0151] like Figure 2 As shown in Figure 1, the LTReID framework includes a CNN network, a normalized BN layer, an independent component decomposition ICF module, a decomposable feature generation FFG module, an anti-normalized BDN layer, and an adversarial feature generation AFG module. Assuming that a pedestrian image is input, the CNN network will output a one-dimensional feature vector x. In order to ensure the convergence stability of the Softmax loss and the Triplet loss, the BN layer is used to obtain the normalized feature vector Assuming that the pedestrian feature is composed of a pedestrian identity component and multiple pedestrian change components, the ICF module normalizes the true feature Decompose into an identity component feature and K variation component features The FFG module can generate false features by weighted fusion of K+1 component features according to the randomly sampled component weights. Solve the problem of sample category imbalance; Different from the BN layer, the BDN layer will Denormalization is performed to obtain the false feature z; the AFG module uses adversarial learning to promote the generation of difficult false features to solve the problem of imbalance between difficult and easy samples.
[0152] In this embodiment of the present invention, the person re-identification model trained using the FFG method achieved higher recognition accuracy than the baseline model. This is because the artificial features generated by the FFG method can alleviate the imbalance of class samples in the training data. In addition, combining the FFG method and the AFG method to train the person re-identification model can further improve the model's performance, indicating that generating difficult artificial features can help alleviate the imbalance between easy and difficult samples. In addition, using the IVD loss and the MVD loss consistently improves the model's recognition accuracy, indicating that maintaining the independence of component features helps improve the generalization ability of the LTReID framework.
[0153] The data generation method of an embodiment of the present invention obtains a first pedestrian image sample set, wherein the first pedestrian image sample set has a long-tail distribution; performs feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample; decomposes each first feature vector into a first identity component feature and K first change component features, where K is an integer greater than 1; and performs weighted fusion on the first identity component feature and the K first change component features after decomposition of each first feature vector to obtain a second feature vector, which is used to generate pedestrian image samples of the tail category. In this way, by decomposing each pedestrian feature in the pedestrian image sample set with a long-tail distribution into an identity-related feature component and multiple change-related feature components, and then performing weighted fusion on the multiple decomposed feature components to generate new pedestrian image samples, a balanced distribution of categories in the pedestrian image sample set can be achieved without affecting the sample quality, thereby ensuring the pedestrian re-identification effect.
[0154] The embodiment of the present invention also provides a data generating device. Figure 3 , Figure 3 1 is a structural diagram of a data generating device provided by an embodiment of the present invention. Since the principle of solving the problem by the data generating device is similar to that of the data generating method in the embodiment of the present invention, the implementation of the data generating device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0155] like Figure 3 As shown, the data generating device 300 includes:
[0156] An acquisition module 301 is configured to acquire a first pedestrian image sample set, wherein the first pedestrian image sample set has a long-tail distribution;
[0157] A feature extraction module 302 is configured to perform feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample;
[0158] A component decomposition module 303 is configured to decompose each first feature vector into a first identity component feature and K first variation component features, where K is an integer greater than 1;
[0159] The feature generation module 304 is used to perform weighted fusion on the first identity component feature and the K first change component features after decomposition of each first feature vector to obtain a second feature vector, and the second feature vector is used to generate a pedestrian image sample of the tail category.
[0160] Optionally, the component decomposition module 303 is configured to decompose each first feature vector into a first identity component feature and K first change component features using a component decomposition model;
[0161] The component decomposition model is trained in the following way:
[0162] Obtain a second pedestrian image sample set;
[0163] performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample;
[0164] Using the initial component decomposition model, each third eigenvector is decomposed into a second identity component feature and K second variation component features;
[0165] Calculate the identity change decorrelation loss between the second identity component feature after decomposition of each third eigenvector and the K second change component features;
[0166] The parameters of the initial component decomposition model are trained by minimizing the identity change decorrelation loss to obtain a trained component decomposition model.
[0167] Optionally, after decomposing each third eigenvector into one second identity component feature and K second variation component features using the initial component decomposition model, the method further includes:
[0168] Calculate the multivariate decorrelation loss between the K second variation component features after decomposition of each third eigenvector;
[0169] The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises:
[0170] The parameters of the initial component decomposition model are trained by minimizing the identity change decorrelation loss and minimizing the multivariate change decorrelation loss to obtain a trained component decomposition model.
[0171] Optionally, the performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample includes:
[0172] Inputting each second pedestrian image sample in the second pedestrian image sample set into a convolutional neural network for feature extraction to obtain a third feature vector corresponding to each second pedestrian image sample;
[0173] Normalize each third eigenvector to obtain the corresponding fourth eigenvector;
[0174] The method of using the initial component decomposition model to decompose each third eigenvector into a second identity component feature and K second variation component features includes:
[0175] The initial component decomposition model is used to decompose each fourth eigenvector into a second identity component feature and K second variation component features.
[0176] Optionally, after decomposing each fourth eigenvector into one second identity component feature and K second variation component features using the initial component decomposition model, the method further includes:
[0177] The second identity component feature and K second change component features after decomposition of each fourth eigenvector are fused to obtain a fifth eigenvector;
[0178] performing a denormalization process on the fifth eigenvector to obtain a sixth eigenvector;
[0179] Calculating a Softmax loss based on the fifth eigenvector and the fourth eigenvector;
[0180] Calculating a triplet loss based on the sixth eigenvector and the third eigenvector;
[0181] Training the parameters of the convolutional neural network by minimizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained convolutional neural network;
[0182] The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises:
[0183] The parameters of the component decomposition module are trained by minimizing the identity change decorrelation loss and maximizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained component decomposition module.
[0184] Optionally, the feature generation module includes:
[0185] a weight assignment unit, configured to randomly assign weights to the K first change component features after decomposition of each first eigenvector, wherein the sum of the weights assigned to the K first change component features after decomposition of each first eigenvector is 1;
[0186] A first calculation unit is used to perform weighted summation on the K change component features after decomposition of each first eigenvector according to the assigned weights to obtain a weighted value;
[0187] The second calculation unit is used to sum the weighted value and the first identity component feature after decomposition of each first eigenvector to obtain a second eigenvector.
[0188] Optionally, the first identity component feature after decomposition of each first eigenvector is equal to the sum of the first eigenvectors corresponding to each image sample in the target image sample set divided by the capacity of the target image sample set, wherein the target image sample set is an image sample set in the first pedestrian image sample set that has the same category as the first identity component feature.
[0189] Optionally, the data generating device 300 further includes:
[0190] A normalization module, configured to perform normalization processing on the first eigenvector;
[0191] A denormalization module is used to perform denormalization processing on the second eigenvector.
[0192] The data generation device provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be repeated here in this embodiment.
[0193] The data generation device 300 of an embodiment of the present invention obtains a first pedestrian image sample set, wherein the first pedestrian image sample set exhibits a long-tail distribution; performs feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample; decomposes each first feature vector into a first identity component feature and K first variation component features, where K is an integer greater than 1; and weightedly fuses the first identity component feature and the K first variation component features after decomposition of each first feature vector to obtain a second feature vector, which is used to generate pedestrian image samples of the tail category. In this way, by decomposing each pedestrian feature in the pedestrian image sample set exhibiting a long-tail distribution into an identity-related feature component and multiple variation-related feature components, and then weightedly fusing the multiple decomposed feature components to generate new pedestrian image samples, a balanced distribution of categories in the pedestrian image sample set can be achieved without affecting sample quality, thereby ensuring the effectiveness of pedestrian re-identification.
[0194] The embodiment of the present invention also provides a data generating device. Since the principle of solving the problem by the data generating device is similar to that of the data generating method in the embodiment of the present invention, the implementation of the data generating device can refer to the implementation of the method, and the repeated parts will not be repeated. Figure 4 As shown, the data generating device according to the embodiment of the present invention includes: a processor 400 configured to read a program in a memory 420 and execute the following process:
[0195] Acquire a first pedestrian image sample set, wherein the first pedestrian image sample set has a long-tail distribution;
[0196] Performing feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample;
[0197] Decomposing each first eigenvector into a first identity component feature and K first variation component features, where K is an integer greater than 1;
[0198] The first identity component feature and the K first change component features after decomposition of each first eigenvector are weightedly fused to obtain a second eigenvector, and the second eigenvector is used to generate a pedestrian image sample of the tail category.
[0199] Among them, Figure 4 In the present disclosure, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits such as one or more processors represented by processor 400 and memory represented by memory 420. The bus architecture may also link various other circuits such as peripherals, voltage regulators, and power management circuits, all of which are well known in the art and are not further described herein. The bus interface provides an interface. Processor 400 is responsible for managing the bus architecture and general processing, while memory 420 may store data used by processor 400 when performing operations.
[0200] Optionally, the processor 400 is further configured to read a program in the memory 420 and execute the following steps:
[0201] Using a component decomposition model, each first eigenvector is decomposed into a first identity component feature and K first change component features;
[0202] The component decomposition model is trained in the following way:
[0203] Obtain a second pedestrian image sample set;
[0204] performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample;
[0205] Using the initial component decomposition model, each third eigenvector is decomposed into a second identity component feature and K second variation component features;
[0206] Calculate the identity change decorrelation loss between the second identity component feature after decomposition of each third eigenvector and the K second change component features;
[0207] The parameters of the initial component decomposition model are trained by minimizing the identity change decorrelation loss to obtain a trained component decomposition model.
[0208] Optionally, the processor 400 is further configured to read a program in the memory 420 and execute the following steps:
[0209] Calculate the multivariate decorrelation loss between the K second variation component features after decomposition of each third eigenvector;
[0210] The parameters of the initial component decomposition model are trained by minimizing the identity change decorrelation loss and minimizing the multivariate change decorrelation loss to obtain a trained component decomposition model.
[0211] Optionally, the processor 400 is further configured to read a program in the memory 420 and execute the following steps:
[0212] Inputting each second pedestrian image sample in the second pedestrian image sample set into a convolutional neural network for feature extraction to obtain a third feature vector corresponding to each second pedestrian image sample;
[0213] Normalize each third eigenvector to obtain the corresponding fourth eigenvector;
[0214] The initial component decomposition model is used to decompose each fourth eigenvector into a second identity component feature and K second variation component features.
[0215] Optionally, the processor 400 is further configured to read a program in the memory 420 and execute the following steps:
[0216] The second identity component feature and K second change component features after decomposition of each fourth eigenvector are fused to obtain a fifth eigenvector;
[0217] performing a denormalization process on the fifth eigenvector to obtain a sixth eigenvector;
[0218] Calculating a Softmax loss based on the fifth eigenvector and the fourth eigenvector;
[0219] Calculating a triplet loss based on the sixth eigenvector and the third eigenvector;
[0220] Training the parameters of the convolutional neural network by minimizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained convolutional neural network;
[0221] The parameters of the component decomposition module are trained by minimizing the identity change decorrelation loss and maximizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained component decomposition module.
[0222] Optionally, the processor 400 is further configured to read a program in the memory 420 and execute the following steps:
[0223] Randomly assigning weights to the K first change component features after decomposition of each first eigenvector, wherein the sum of the weights assigned to the K first change component features after decomposition of each first eigenvector is 1;
[0224] The K change component features after decomposition of each first eigenvector are weighted and summed according to the assigned weights to obtain a weighted value;
[0225] The weighted value and the first identity component feature after decomposition of each first eigenvector are summed to obtain a second eigenvector.
[0226] Optionally, the first identity component feature after decomposition of each first eigenvector is equal to the sum of the first eigenvectors corresponding to each image sample in the target image sample set divided by the capacity of the target image sample set, wherein the target image sample set is an image sample set in the first pedestrian image sample set that has the same category as the first identity component feature.
[0227] Optionally, the processor 400 is further configured to read a program in the memory 420 and execute the following steps:
[0228] performing normalization processing on the first eigenvector;
[0229] Perform denormalization processing on the second eigenvector.
[0230] The data generation device provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be repeated here in this embodiment.
[0231] In addition, a computer-readable storage medium according to an embodiment of the present invention is used to store a computer program, and the computer program can be executed by a processor to implement the following steps:
[0232] Acquire a first pedestrian image sample set, wherein the first pedestrian image sample set has a long-tail distribution;
[0233] Performing feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample;
[0234] Decomposing each first eigenvector into a first identity component feature and K first variation component features, where K is an integer greater than 1;
[0235] The first identity component feature and the K first change component features after decomposition of each first eigenvector are weightedly fused to obtain a second eigenvector, and the second eigenvector is used to generate a pedestrian image sample of the tail category.
[0236] Optionally, decomposing each first eigenvector into a first identity component feature and K first variation component features includes:
[0237] Using the component decomposition model, each first eigenvector is decomposed into a first identity component feature and K first change component features;
[0238] The component decomposition model is trained in the following way:
[0239] Obtain a second pedestrian image sample set;
[0240] performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample;
[0241] Using the initial component decomposition model, each third eigenvector is decomposed into a second identity component feature and K second variation component features;
[0242] Calculate the identity change decorrelation loss between the second identity component feature after decomposition of each third eigenvector and the K second change component features;
[0243] The parameters of the initial component decomposition model are trained by minimizing the identity change decorrelation loss to obtain a trained component decomposition model.
[0244] Optionally, after decomposing each third eigenvector into one second identity component feature and K second variation component features using the initial component decomposition model, the method further includes:
[0245] Calculate the multivariate decorrelation loss between the K second variation component features after decomposition of each third eigenvector;
[0246] The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises:
[0247] The parameters of the initial component decomposition model are trained by minimizing the identity change decorrelation loss and minimizing the multivariate change decorrelation loss to obtain a trained component decomposition model.
[0248] Optionally, the performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample includes:
[0249] Inputting each second pedestrian image sample in the second pedestrian image sample set into a convolutional neural network for feature extraction to obtain a third feature vector corresponding to each second pedestrian image sample;
[0250] Normalize each third eigenvector to obtain the corresponding fourth eigenvector;
[0251] The method of using the initial component decomposition model to decompose each third eigenvector into a second identity component feature and K second variation component features includes:
[0252] The initial component decomposition model is used to decompose each fourth eigenvector into a second identity component feature and K second variation component features.
[0253] Optionally, after decomposing each fourth eigenvector into one second identity component feature and K second variation component features using the initial component decomposition model, the method further includes:
[0254] The second identity component feature and K second change component features after decomposition of each fourth eigenvector are fused to obtain a fifth eigenvector;
[0255] performing a denormalization process on the fifth eigenvector to obtain a sixth eigenvector;
[0256] Calculating a Softmax loss based on the fifth eigenvector and the fourth eigenvector;
[0257] Calculating a triplet loss based on the sixth eigenvector and the third eigenvector;
[0258] Training the parameters of the convolutional neural network by minimizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained convolutional neural network;
[0259] The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises:
[0260] The parameters of the component decomposition module are trained by minimizing the identity change decorrelation loss and maximizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained component decomposition module.
[0261] Optionally, performing weighted fusion on the first identity component feature and the K first change component features after decomposition of each first eigenvector to obtain the second eigenvector includes:
[0262] Randomly assigning weights to the K first change component features after decomposition of each first eigenvector, wherein the sum of the weights assigned to the K first change component features after decomposition of each first eigenvector is 1;
[0263] The K change component features after decomposition of each first eigenvector are weighted and summed according to the assigned weights to obtain a weighted value;
[0264] The weighted value and the first identity component feature after decomposition of each first eigenvector are summed to obtain a second eigenvector.
[0265] Optionally, the first identity component feature after decomposition of each first eigenvector is equal to the sum of the first eigenvectors corresponding to each image sample in the target image sample set divided by the capacity of the target image sample set, wherein the target image sample set is an image sample set in the first pedestrian image sample set that has the same category as the first identity component feature.
[0266] Optionally, after performing feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample, and before decomposing each first feature vector into a first identity component feature and K first variation component features, the method further includes:
[0267] performing normalization processing on the first eigenvector;
[0268] After weighted fusion of the first identity component features and the K first change component features after decomposition of each first eigenvector to obtain the second eigenvector, the method further includes:
[0269] Perform denormalization processing on the second eigenvector.
[0270] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection of some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0271] In addition, the functional units in various embodiments of the present invention may be integrated into a single processing unit, each unit may be physically included separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional units.
[0272] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to perform some steps of the sending and receiving methods described in various embodiments of the present invention. The aforementioned storage medium includes: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., various media that can store program code.
[0273] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A data generation method, characterized in that: include: Acquire a first pedestrian image sample set, wherein the first pedestrian image sample set has a long-tail distribution; Performing feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample; Decomposing each first eigenvector into a first identity component feature and K first variation component features, where K is an integer greater than 1; Performing weighted fusion on the first identity component feature and the K first change component features after decomposition of each first eigenvector to obtain a second eigenvector, wherein the second eigenvector is used to generate a pedestrian image sample of the tail category; Decomposing each first eigenvector into a first identity component feature and K first variation component features includes: Using the component decomposition model, each first eigenvector is decomposed into a first identity component feature and K first change component features; The component decomposition model is trained in the following way: Obtain a second pedestrian image sample set; performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample; Using the initial component decomposition model, each third eigenvector is decomposed into a second identity component feature and K second variation component features; Calculate the identity change decorrelation loss between the second identity component feature after decomposition of each third eigenvector and the K second change component features; Training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model; After decomposing each third eigenvector into a second identity component feature and K second variation component features using the initial component decomposition model, the method further includes: Calculate the multivariate decorrelation loss between the K second variation component features after decomposition of each third eigenvector; The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises: Training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss and minimizing the multivariate change decorrelation loss to obtain a trained component decomposition model; The performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample includes: Inputting each second pedestrian image sample in the second pedestrian image sample set into a convolutional neural network for feature extraction to obtain a third feature vector corresponding to each second pedestrian image sample; Normalize each third eigenvector to obtain the corresponding fourth eigenvector; The method of using the initial component decomposition model to decompose each third eigenvector into a second identity component feature and K second variation component features includes: Using the initial component decomposition model, each fourth eigenvector is decomposed into a second identity component feature and K second variation component features; After decomposing each fourth eigenvector into a second identity component feature and K second variation component features using the initial component decomposition model, the method further includes: The second identity component feature and K second change component features after decomposition of each fourth eigenvector are fused to obtain a fifth eigenvector; performing a denormalization process on the fifth eigenvector to obtain a sixth eigenvector; Calculating a Softmax loss based on the fifth eigenvector and the fourth eigenvector; Calculating a triplet loss based on the sixth eigenvector and the third eigenvector; Training the parameters of the convolutional neural network by minimizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained convolutional neural network; The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises: The parameters of the component decomposition model are trained by minimizing the identity change decorrelation loss and maximizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained component decomposition model.
2. The method according to claim 1, characterized in that The step of weightedly fusing the first identity component features and the K first change component features after decomposition of each first eigenvector to obtain a second eigenvector includes: Randomly assigning weights to the K first change component features after decomposition of each first eigenvector, wherein the sum of the weights assigned to the K first change component features after decomposition of each first eigenvector is 1; The K change component features after decomposition of each first eigenvector are weighted and summed according to the assigned weights to obtain a weighted value; The weighted value and the first identity component feature after decomposition of each first eigenvector are summed to obtain a second eigenvector.
3. The method according to claim 1, characterized in that The first identity component feature after decomposition of each first eigenvector is equal to the sum of the first eigenvectors corresponding to each image sample in the target image sample set divided by the capacity of the target image sample set, wherein the target image sample set is the image sample set of the same category as the first identity component feature in the first pedestrian image sample set.
4. The method according to claim 1, wherein After performing feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample, and before decomposing each first feature vector into a first identity component feature and K first variation component features, the method further includes: performing normalization processing on the first eigenvector; After weighted fusion of the first identity component features and the K first change component features after decomposition of each first eigenvector to obtain the second eigenvector, the method further includes: Perform denormalization processing on the second eigenvector.
5. A data generating device, characterized in that: include: an acquisition module, configured to acquire a first pedestrian image sample set, wherein the first pedestrian image sample set has a long-tail distribution; a feature extraction module, configured to perform feature extraction on each first pedestrian image sample in the first pedestrian image sample set to obtain a first feature vector corresponding to each first pedestrian image sample; a component decomposition module, configured to decompose each first feature vector into a first identity component feature and K first variation component features, where K is an integer greater than 1; a feature generation module, configured to perform weighted fusion on the first identity component feature and the K first change component features decomposed from each first feature vector to obtain a second feature vector, wherein the second feature vector is used to generate a pedestrian image sample of the tail category; The component decomposition module is used to decompose each first feature vector into a first identity component feature and K first change component features using a component decomposition model; The component decomposition model is trained in the following way: Obtain a second pedestrian image sample set; performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample; Using the initial component decomposition model, each third eigenvector is decomposed into a second identity component feature and K second variation component features; Calculate the identity change decorrelation loss between the second identity component feature after decomposition of each third eigenvector and the K second change component features; Training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model; After decomposing each third eigenvector into one second identity component feature and K second variation component features using the initial component decomposition model, the method further includes: Calculate the multivariate decorrelation loss between the K second variation component features after decomposition of each third eigenvector; The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises: Training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss and minimizing the multivariate change decorrelation loss to obtain a trained component decomposition model; The performing feature extraction on each second pedestrian image sample in the second pedestrian image sample set to obtain a third feature vector corresponding to each second pedestrian image sample includes: Inputting each second pedestrian image sample in the second pedestrian image sample set into a convolutional neural network for feature extraction to obtain a third feature vector corresponding to each second pedestrian image sample; Normalize each third eigenvector to obtain the corresponding fourth eigenvector; The method of using the initial component decomposition model to decompose each third eigenvector into a second identity component feature and K second variation component features includes: Using the initial component decomposition model, each fourth eigenvector is decomposed into a second identity component feature and K second variation component features; After decomposing each fourth eigenvector into one second identity component feature and K second variation component features using the initial component decomposition model, the method further includes: The second identity component feature and K second change component features after decomposition of each fourth eigenvector are fused to obtain a fifth eigenvector; performing a denormalization process on the fifth eigenvector to obtain a sixth eigenvector; Calculating a Softmax loss based on the fifth eigenvector and the fourth eigenvector; Calculating a triplet loss based on the sixth eigenvector and the third eigenvector; Training the parameters of the convolutional neural network by minimizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained convolutional neural network; The step of training the parameters of the initial component decomposition model by minimizing the identity change decorrelation loss to obtain a trained component decomposition model comprises: The parameters of the component decomposition model are trained by minimizing the identity change decorrelation loss and maximizing the weighted sum of the Softmax loss and the Triplet loss to obtain a trained component decomposition model.
6. A data generating device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor; wherein the processor is configured to read the program in the memory to implement the steps of the method according to any one of claims 1 to 4.
7. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Few-sample unmanned aerial vehicle image recognition method based on virtual sample generation
CN111062310A