A method, device, equipment and storage medium for creating a pedestrian re-identification model

By using preset posture constraint rules and phased training methods in the pedestrian recognition model, the low model robustness caused by sample imbalance in the existing technology is solved, and the accuracy and retrieval accuracy of pedestrian recognition are improved. .

CN114495175BActive Publication Date: 2024-12-17JINAN BOGUAN INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210133696.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-14
Publication Date
2024-12-17
Estimated Expiration
2042-02-14

AI Technical Summary

Technical Problem

The existing supervised pedestrian re-identification model is low in robustness due to sample imbalance when processing low-resolution training image sets, which can't accurately re-identify pedestrians, affecting feature comparison and image collection effects.

Method used

Group the training sets through preset posture constraint rules to form the target batch, ensuring that each batch contains multiple pedestrian pictures of different postures, using Combined Margin Loss or arcfaceloss loss functions for end-to-end training, and using phased Training method to improve the model's posture robustness and generalization ability.

Benefits of technology

The identification accuracy and retrieval accuracy of the pedestrian re-identification model are improved, the model's ability to extract different posture features is enhanced, and the problem of sample imbalance and insufficient data volume is alleviated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114495175B_ABST
    Figure CN114495175B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and storage medium for creating a pedestrian re-identification model. The method includes: obtaining pedestrian image data to obtain a training set; grouping the training set according to preset posture constraint rules to obtain multiple groups of target batches; the preset posture constraint rules include the number of pedestrian IDs and posture types; constructing a network to be trained, using the training set to perform a first-stage training on the network to be trained to obtain a first-stage trained model, and using the target batch to perform a second-stage training on the first-stage trained model to obtain the pedestrian re-identification model. The model can fully train the posture of pedestrians in each batch, can more effectively extract features of different postures with the same ID, effectively improve the posture robustness and model generalization ability of the pedestrian re-identification model, make the model more accurate when performing pedestrian re-identification, and improve the model feature extraction ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of pedestrian re-identification, and in particular to a method, device, equipment and storage medium for creating a pedestrian re-identification model. Background Art

[0002] At present, the existing supervised pedestrian re-identification technology is similar to the conventional supervised image recognition model in extracting features and performing feature comparison, that is, training a strong feature extraction model, using the feature extraction model to extract features from the original pedestrian image, obtaining an abstract pedestrian description, and then learning a distance metric function to perform similarity judgment on the pedestrian features, thereby obtaining a preliminary sorting list, and finally optimizing the original sorting list according to the relevant sorting, and finally obtaining the final pedestrian recognition result. For example, in the prior art, a conventional image classification model such as the ResNet series model or the VGG series model is used as the model framework, and the training data reading method adopts the triple data reading method for triple loss, that is, randomly selecting P pedestrians in each training batch, and randomly selecting K different pictures for each pedestrian. A batch contains a triple consisting of P×K pictures, and the overall model training method adopts conventional full data training. However, the existing supervised person re-identification model training methods often use simple random reading and training for low-resolution training image sets obtained from the real world, and there is a serious sample imbalance problem in the obtained human training materials, which will reduce the robustness of the trained model and have a huge impact on subsequent feature comparisons, making it impossible to accurately re-identify pedestrians, which has a great negative impact on model convergence and human image search effects. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for creating a pedestrian re-identification model, which can improve the recognition ability of the pedestrian re-identification model. The specific scheme is as follows:

[0004] In a first aspect, the present application discloses a method for creating a pedestrian re-identification model, comprising:

[0005] Obtain pedestrian image data to obtain a training set;

[0006] The training set is grouped according to preset posture constraint rules to obtain multiple target batches; the preset posture constraint rules include the number of pedestrian IDs and posture types;

[0007] A network to be trained is constructed, the network to be trained is trained in the first stage using the training set to obtain a first-stage trained model, and the first-stage trained model is trained in the second stage using the target batch to obtain the pedestrian re-identification model.

[0008] Optionally, obtaining pedestrian image data to obtain a training set includes:

[0009] Obtaining pedestrian image data, and classifying the pedestrian image data according to the pedestrian ID and posture type corresponding to the pedestrian image data;

[0010] The target posture type is determined according to the amount of pedestrian picture data corresponding to each posture type, and data enhancement is performed on the pedestrian picture data corresponding to the target posture type to obtain the training set.

[0011] Optionally, the obtaining of pedestrian image data and classifying the pedestrian image data according to pedestrian IDs and posture types corresponding to the pedestrian image data includes:

[0012] Obtain pedestrian images collected by different cameras at different angles at multiple points to obtain image data of multiple pedestrians in different posture types;

[0013] A corresponding pedestrian ID is added to each pedestrian image according to the pedestrian target in the pedestrian image, and a corresponding posture type identifier is added to each pedestrian image according to the posture type of the pedestrian in the pedestrian image, so as to obtain images classified according to the pedestrian ID and posture type; the posture types include front view, side view and back view.

[0014] Optionally, the classifying the pedestrian image data according to the pedestrian ID and posture type corresponding to the pedestrian image data includes:

[0015] The posture classification model obtained by pre-training is used to identify the posture type corresponding to the pedestrian image data, so as to perform posture classification on the pedestrian image data.

[0016] Optionally, the training set is grouped according to a preset posture constraint rule to obtain multiple groups of target batches, including:

[0017] The training set is screened and grouped according to the number of pedestrian IDs and posture types to obtain multiple groups of target batches; wherein a single target batch contains image data corresponding to a number of pedestrians greater than a preset number of pedestrians, and the image data corresponding to a single pedestrian in the target batch contains images of the pedestrian in different posture types, and the proportions of images of different posture types are balanced.

[0018] Optionally, the training process of the network to be trained further includes:

[0019] The network to be trained is trained end-to-end using a Combined Margin Loss loss function or an arcfaceloss loss function.

[0020] Optionally, the using the target batch to perform a second-stage training on the model trained in the first stage to obtain the person re-identification model includes:

[0021] Fixing the fully connected layer of the first-stage trained model, and inputting the target batch into the first-stage trained model to train the fully connected layer separately;

[0022] When the number of separate training times reaches a preset number, the fixation of the fully connected layer is canceled, so that each layer in the model performs parameter backpropagation and update to obtain the pedestrian re-identification model.

[0023] In a second aspect, the present application discloses a pedestrian re-identification model creation device, comprising:

[0024] A training set determination module, used to obtain pedestrian image data to obtain a training set;

[0025] A target batch determination module is used to group the training set according to preset posture constraint rules to obtain multiple groups of target batches; the preset posture constraint rules include the number of pedestrian IDs and posture types;

[0026] The training module is used to construct a network to be trained, perform a first-stage training on the network to be trained using the training set to obtain a first-stage trained model, and perform a second-stage training on the first-stage trained model using the target batch to obtain the pedestrian re-identification model.

[0027] In a third aspect, the present application discloses an electronic device, comprising:

[0028] Memory, used to store computer programs;

[0029] The processor is used to execute the computer program to implement the aforementioned pedestrian re-identification model creation method.

[0030] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned pedestrian re-identification model creation method.

[0031] In the present application, pedestrian image data is obtained to obtain a training set; the training set is grouped according to preset posture constraint rules to obtain multiple groups of target batches; the preset posture constraint rules include the number of pedestrian IDs and the type of posture; a network to be trained is constructed, the network to be trained is trained in the first stage using the training set to obtain a model after the first stage training, and the model after the first stage training is trained in the second stage using the target batch to obtain the pedestrian re-identification model. As can be seen from the above, by grouping the training set according to the preset posture constraint rules, the multiple groups of target batches obtained all meet the constraints of the number of pedestrian IDs and the type of posture constraints, and then the target batch is used to train the network to be trained, so that in each batch training, the model can improve the full training of each posture of each ID, and can more effectively extract the features of different postures of the same ID, effectively improve the posture robustness and model generalization ability of the pedestrian re-identification model, make the model more accurate when performing pedestrian re-identification, and improve the model feature extraction ability. In addition, by using staged training to improve the model re-identification accuracy and performance, the retrieval accuracy rate is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0033] Figure 1 A flowchart of a method for creating a pedestrian re-identification model provided in this application;

[0034] Figure 2 A schematic diagram of the structure of a pedestrian re-identification model creation device provided in this application;

[0035] Figure 3 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0037] In the prior art, supervised person re-identification model training methods often use simple random reading and training of low-resolution training image sets obtained from the real world, which reduces the robustness of the trained model and thus cannot accurately perform person re-identification. In order to overcome the above technical problems, this application proposes a method for creating a person re-identification model based on posture constraints, which can improve the recognition ability of the person re-identification model.

[0038] The present application embodiment discloses a method for creating a pedestrian re-identification model. Figure 1 As shown, the method may include the following steps:

[0039] Step S11: Obtain pedestrian image data to obtain a training set.

[0040] In this embodiment, a large number of pedestrian images are first obtained as a training set. The obtaining of pedestrian image data to obtain a training set may include: obtaining pedestrian image data, and classifying the pedestrian image data according to the pedestrian ID and posture type corresponding to the pedestrian image data; determining the target posture type according to the number of pedestrian image data corresponding to each posture type, and performing data enhancement on the pedestrian image data corresponding to the target posture type to obtain the training set. That is, after obtaining the pedestrian image data, the pedestrian image data is classified according to the pedestrian ID and posture type, the images of different pedestrians are distinguished, and the images of different posture types of the same pedestrian are distinguished. The difference in quantity between the image data of different posture types in the training set can be seen according to the posture label of each pedestrian ID, and then the number of images of different posture types in the training set is balanced by performing data enhancement operations on the images of a smaller number of posture types.

[0041] In this embodiment, the obtaining of pedestrian image data and classifying the pedestrian image data according to the pedestrian ID and posture type corresponding to the pedestrian image data may include: obtaining pedestrian images collected by different cameras at different angles at multiple points to obtain image data of multiple pedestrians in different posture types; adding a corresponding pedestrian ID to each pedestrian image according to the pedestrian target in the pedestrian image, and adding a corresponding posture type identifier to each pedestrian image according to the posture type of the pedestrian in the pedestrian image to obtain images classified according to the pedestrian ID and posture type; the posture types include front, side and back.

[0042] For example, pedestrian images collected by different cameras at different angles at various points are used as pedestrian material data sets. Each pedestrian has an ID, which can be represented by Arabic numerals starting from 0. The same ID will contain pictures of various angles and directions, that is, the same pedestrian will contain pictures of different postures. In this embodiment, at least three types of postures are set, which can generally be divided into front, side and back, but the posture samples can also be further refined into more categories according to needs, such as 1 / 3 side, etc., which are not specifically limited in this embodiment. Use a pre-trained conventional posture classification model to perform posture classification on the acquired pedestrian material data set to obtain a posture label for each ID pedestrian (for example: 0 represents front, 1 represents side, and 2 represents back). By obtaining the posture label of each ID, we can understand the quantity distribution of different posture data in the data set, and determine the type of image to be enhanced based on the quantity distribution and the preset threshold. For example, we can perform data enhancement on posture samples that are less than a certain proportion of the total material volume. Data enhancement includes illumination augmentation, random erasing, random cropping, etc. In this way, we can perform data enhancement on samples with seriously insufficient data volume to ensure that postures with insufficient data volume can be read in each batch, and that they are posture images after data enhancement, thereby preventing overfitting and effectively alleviating the problem of unbalanced training samples.

[0043] Step S12: grouping the training set according to preset posture constraint rules to obtain multiple groups of target batches; the preset posture constraint rules include the number of pedestrian IDs and posture types.

[0044] In this embodiment, after obtaining the above training set, the above training set is classified according to the preset posture constraint rules, and multiple groups of target batches are obtained after classification, wherein the preset posture constraint rules include the number of pedestrian IDs and the type of posture. Specifically, classifying the above training set according to the preset posture constraint rules may include: screening and grouping the training set according to the number of pedestrian IDs and the type of posture to obtain multiple groups of target batches; wherein a single target batch contains image data corresponding to pedestrians greater than the preset number of pedestrians, and the image data corresponding to a single pedestrian in the target batch contains images of different posture types of the pedestrian, and the proportions of images of different posture types are balanced. batch is used to define the number of samples to be processed before updating the internal model parameters. Batch processing is regarded as looping through one or more samples and making predictions. It can be understood that the loss function required for each parameter update of deep learning is not obtained by one data, but by a group of data weighted. The amount of data in this group of data is batchsize, which is the batch size. In deep learning, when training the model, batchsize samples are taken from the training set for training each time.

[0045] For example, taking the three-classification of posture as an example, Arabic numerals are used to represent different postures, such as 0 for front, 1 for side, and 2 for back. The training set is grouped according to the pedestrian ID, and each group contains all the posture pictures of the pedestrian with the ID. It is judged whether the postures in each group are balanced, and the postures with a small number are randomly read repeatedly to increase the number of times the pictures of the posture are read. According to the preset posture constraint rule (abbreviated as b-pose-bind in this embodiment), all ID groups are randomly shuffled, and more than 3 ID groups are selected each time, and each ID group reads an even number of pictures of different postures, and the single batch data is constrained by multiple postures. Thus, each target batch obtained contains the picture data corresponding to pedestrians greater than the preset number of pedestrians, and the picture data corresponding to a single pedestrian in the target batch contains pictures of the pedestrian in different posture types, and the proportions of pictures of different posture types are balanced. That is to say, the b-pose-bind proposed in this embodiment performs multi-pose constraints on the data of each batchsize, that is, the training data of each batchsize are adjacent pictures with the same pedestrian ID but different poses, and the training data of each batchsize contains at least 3 IDs, so that the data reading of each batchsize is arranged according to the posture constraint requirements.

[0046] The traditional triplet data reading method will face this kind of human multi-pose and multi-posture retrieval, especially in the posture retrieval with unbalanced training samples and less training data, and there will be problems with the poor robustness of the model for the posture, and the generalization ability of the model is weak. There will be huge differences in the re-identification effects of pedestrians with different postures, which cannot solve the problem of poor robustness of postures with unbalanced training samples and less training data. Different from triplet data reading, the b-pose-bind posture constraint data reading method in this application is that the number of IDs in a single batch of data is different, at least more than 3 IDs, and the picture data of the same ID are adjacent and different posture pictures, that is, the training set that meets the second stage training requirements is screened and constructed through posture and ID constraints in the existing training samples. Therefore, this data reading method can ensure that the model is fully trained for each posture of each ID in each batch, so that the model can more accurately extract the features of different postures of the same ID, and further improve the robustness of the model to posture.

[0047] Step S13: constructing a network to be trained, performing a first-stage training on the network to be trained using the training set to obtain a first-stage trained model, and performing a second-stage training on the first-stage trained model using the target batch to obtain the pedestrian re-identification model.

[0048] In this embodiment, the determined target batch is used to train the constructed network to be trained until the model converges, and a pedestrian re-identification model is obtained. In this embodiment, the training process of the network to be trained may also include: using a Combined Margin Loss loss function or an arcfaceloss loss function to perform end-to-end training on the network to be trained. Compared with the existing pedestrian re-identification scheme, the two loss functions of SoftmaxLoss and TripletLoss are usually used to constrain the network, which is prone to the problem that the network cannot converge synchronously, resulting in the problem that the trained model is not effective. In the process of training the pedestrian re-identification network, the present application uses a Combined Margin Loss loss function or an arcfaceloss loss function to replace the conventional loss function, so that the model can be trained end-to-end, solve the problem of asynchronous convergence of the above two loss functions, optimize the results of multi-classification, and improve the model feature extraction capability.

[0049] It is understandable that in order to effectively alleviate the problem of large pixel differences in training data images and inconsistent image quality, the present application uses staged training to improve the model re-identification accuracy and performance, thereby improving the retrieval accuracy. This, combined with the b-pose-bind posture constraint data reading method, can effectively alleviate the situation of large differences in training data quality, and use high-quality training data to fit the final model, thereby improving the model training effect. In addition, in the first training stage, the training set is used to perform half-precision training on the training network to obtain a half-precision model, that is, the model after the first stage training mentioned above. Then, in the second training stage, the target batch is used to perform full-precision training on the above-mentioned half-precision model, thereby shortening the time required for model training and improving efficiency. That is to say, in the present embodiment, the model training process based on the training set with a large amount of data adopts a half-precision training method, and the model training process based on the high-quality target batch obtained after the posture constraint adopts a full-precision training method, which can improve the model training accuracy while improving the model training speed.

[0050] Compared with the existing technical solution in which the model adopts the triple data reading method to perform model training, the model training method of triple data reading faces the problem of poor robustness of the model for multi-pose and multi-posture retrieval of the human body in the pedestrian re-identification task, especially in the posture retrieval with unbalanced training samples and small amount of training data. The generalization ability of the model is weak, and the pedestrian re-identification effects of different postures vary greatly. It cannot solve the problems of unbalanced training samples and poor posture robustness with small amount of training data, which affects the final image search effect and cannot effectively improve the posture robustness and retrieval accuracy of the model. The present application improves the posture robustness and performance training of the pedestrian re-identification model by adopting the b-pose-bind posture constraint rule. Specifically, the posture classification and data enhancement of the acquired training materials are first performed to alleviate the sample imbalance; the human body training data after data enhancement is then grouped according to the b-pose-bind posture constraint rule; secondly, the pedestrian re-identification model is trained in two stages. In the first stage, the model is trained using the full data with data enhancement, and in the second stage, the model obtained by the first stage training is trained using the high-quality target batch grouped according to the b-pose-bind posture constraint rule, thereby obtaining the final pedestrian re-identification model; and when training the network, the Combined Margin Loss loss function is used to train the model end-to-end to solve the problem that the conventional re-identification network training uses two loss functions, SoftmaxLoss and TripletLoss, to optimize the network, and there is a problem that the network cannot be converged synchronously, affecting the model training effect. The posture robustness and recognition ability of the pedestrian re-identification model are improved.

[0051] In this embodiment, the use of the target batch to perform a second stage training on the first-stage trained model to obtain the pedestrian re-identification model may include: fixing the fully connected layer of the first-stage trained model, inputting the target batch into the first-stage trained model to perform separate training on the fully connected layer; when the number of separate training times reaches a preset number, canceling the fixation of the fully connected layer, and performing parameter backpropagation and updating on each layer in the model to obtain the pedestrian re-identification model.

[0052] That is to say, since the existing scheme usually uses the whole data to train the network model, it is impossible to solve the problem that the model training effect is poor due to the different quality of the material images, large pixel differences and unbalanced scenes in the training data set. Therefore, this application adopts a two-stage training method in conjunction with the b-pose-bind posture constraint data reading method. In the first stage of model training, full data training is first used, that is, the network is trained using a training set containing all data after data enhancement. The amount of full data training data is large, and the model training requires more rounds of iterative training. Taking a data set with one million pictures as an example, the batchsize is 16, then the required Iteration is 1000000 / 16=62500, that is, one epoch is equal to 62500 Iterations. In the end, it is necessary to train about 20 epochs, that is, 1250000 Iterations. 1 iteration is equal to training once with batchsize sample data; one epoch is equal to training once with all the samples in the training set. In layman's terms, the value of epoch is how many times the data set is trained. Then, the first-stage trained model obtained from the first-stage training is used as the pre-trained model for the second-stage training. The above target batch is used for the second-stage training. The training material images in the target batch are of good quality and each data set contains different postures of multiple IDs, which is suitable for the final fitting training of the model. Specifically, during training, propagate_down is used to fix the fully connected layer of the model so that the parameters of the layers before the fully connected layer remain unchanged, and only the fully connected layer is trained first. After training for 2-3 epochs, propagate_down is removed, and the parameters of each layer of the model are back-propagated and updated normally, and finally a trained pedestrian re-identification model is obtained.

[0053] It should be noted that regarding the b-pose-bind posture constraint data reading method, because different ID data in each batch are mutually exclusive, the data shuffle must be turned off during the model training process to prevent the data prepared after each epoch training from being randomly disrupted and restarting a new round of training. It is impossible to make adjacent pictures with the same ID in each batch data have different postures or partially the same posture, which makes the model unable to fully extract the features of different postures with the same ID. Therefore, after each epoch training, different single batch posture constraint training labels must be re-produced, the pedestrian training data is rearranged again, and new training labels are produced according to the b-pose-bind posture constraint rules in the above steps, so as to ensure that during the model training process, the features of different posture perspectives with the same ID can be extracted between each batch data.

[0054] As can be seen from the above, in this embodiment, pedestrian image data is obtained to obtain a training set; the training set is grouped according to the preset posture constraint rules to obtain multiple groups of target batches; the preset posture constraint rules include the number of pedestrian IDs and the type of posture; the network to be trained is constructed, the training set is used to perform the first stage training on the network to be trained to obtain the first stage trained model, and the target batch is used to perform the second stage training on the first stage trained model to obtain the pedestrian re-identification model. As can be seen from the above, by grouping the training set according to the preset posture constraint rules, the multiple groups of target batches obtained all meet the constraints of the number of pedestrian IDs and the type of posture constraints, and then the target batch is used to train the network to be trained, so that in each batch training, the model can improve the full training of each posture of each ID, and can more effectively extract the features of different postures of the same ID, effectively improve the posture robustness and model generalization ability of the pedestrian re-identification model, make the model more accurate when performing pedestrian re-identification, and improve the model feature extraction ability. In addition, by using staged training to improve the model re-identification accuracy and performance, the retrieval accuracy rate is improved.

[0055] Accordingly, the present application also discloses a pedestrian re-identification model creation device, see Figure 2 As shown, the device comprises:

[0056] A training set determination module 11 is used to obtain pedestrian image data to obtain a training set;

[0057] A target batch determination module 12 is used to group the training set according to preset posture constraint rules to obtain multiple groups of target batches; the preset posture constraint rules include the number of pedestrian IDs and posture types;

[0058] The training module 13 is used to construct a network to be trained, perform a first-stage training on the network to be trained using the training set to obtain a first-stage trained model, and perform a second-stage training on the first-stage trained model using the target batch to obtain the pedestrian re-identification model.

[0059] As can be seen from the above, in this embodiment, pedestrian image data is obtained to obtain a training set; the training set is grouped according to the preset posture constraint rules to obtain multiple groups of target batches; the preset posture constraint rules include the number of pedestrian IDs and the type of posture; the network to be trained is constructed, the training set is used to perform the first stage training on the network to be trained to obtain the first stage trained model, and the target batch is used to perform the second stage training on the first stage trained model to obtain the pedestrian re-identification model. As can be seen from the above, by grouping the training set according to the preset posture constraint rules, the multiple groups of target batches obtained all meet the constraints of the number of pedestrian IDs and the type of posture constraints, and then the target batch is used to train the network to be trained, so that in each batch training, the model can improve the full training of each posture of each ID, and can more effectively extract the features of different postures of the same ID, effectively improve the posture robustness and model generalization ability of the pedestrian re-identification model, make the model more accurate when performing pedestrian re-identification, and improve the model feature extraction ability. In addition, by using staged training to improve the model re-identification accuracy and performance, the retrieval accuracy rate is improved.

[0060] In some specific embodiments, the training set determination module 11 may specifically include:

[0061] A classification unit, used to obtain pedestrian image data, and classify the pedestrian image data according to the pedestrian ID and posture type corresponding to the pedestrian image data;

[0062] A data enhancement unit is used to determine a target posture type according to the amount of pedestrian picture data corresponding to each posture type, and perform data enhancement on the pedestrian picture data corresponding to the target posture type to obtain the training set.

[0063] In some specific embodiments, the training set determination module 11 may specifically include:

[0064] A pedestrian image acquisition unit is used to acquire pedestrian images collected by different cameras at different angles at multiple points, so as to obtain image data of multiple pedestrians in different posture types;

[0065] An identification adding unit is used to add a corresponding pedestrian ID to each pedestrian picture according to the pedestrian target in the pedestrian picture, and to add a corresponding posture type identification to each pedestrian picture according to the posture type of the pedestrian in the pedestrian picture, so as to obtain pictures classified according to the pedestrian ID and posture type; the posture types include front view, side view and back view.

[0066] In some specific embodiments, the classification unit can be specifically used to identify the posture type corresponding to the pedestrian image data using a pre-trained posture classification model, so as to perform posture classification on the pedestrian image data.

[0067] In some specific embodiments, the target batch determination module 12 can be specifically used to filter and group the training set according to the number of pedestrian IDs and posture types to obtain multiple groups of target batches; wherein a single target batch contains image data corresponding to a number of pedestrians greater than a preset number of pedestrians, and the image data corresponding to a single pedestrian in the target batch contains images of the pedestrian in different posture types, and the proportions of images of different posture types are balanced.

[0068] In some specific embodiments, the training module 13 can be specifically used to adopt a Combined Margin Loss loss function or an arcfaceloss loss function to perform end-to-end training on the network to be trained.

[0069] In some specific embodiments, the training module 13 may specifically include:

[0070] A fully connected layer training unit, used to fix the fully connected layer of the first-stage trained model, input the target batch into the first-stage trained model, and train the fully connected layer separately;

[0071] The model updating unit is used to cancel the fixation of the fully connected layer when the number of separate training times reaches a preset number, so that each layer in the model performs parameter backpropagation and updating to obtain the pedestrian re-identification model.

[0072] Furthermore, the present application also discloses an electronic device, see Figure 3 As shown, the contents in the drawings should not be considered as any limitation on the scope of use of the present application.

[0073] Figure 3 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the method for creating a pedestrian re-identification model disclosed in any of the aforementioned embodiments.

[0074] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0075] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222, and data 223 including a training set, etc. The storage method can be temporary storage or permanent storage.

[0076] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the pedestrian re-identification model creation method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0077] Furthermore, an embodiment of the present application also discloses a computer storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the steps of the pedestrian re-identification model creation method disclosed in any of the aforementioned embodiments are implemented.

[0078] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0079] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0080] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0081] The above is a detailed introduction to a pedestrian re-identification model creation method, device, equipment and medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for creating a person re-identification model, characterized in that: include: Obtain pedestrian image data to obtain a training set; The training set is grouped according to preset posture constraint rules to obtain multiple groups of target batches; The preset posture constraint rules include the number of pedestrian IDs and posture types; Constructing a network to be trained, performing a first-stage training on the network to be trained using the training set to obtain a first-stage trained model, and performing a second-stage training on the first-stage trained model using the target batch to obtain the person re-identification model; The training set is grouped according to the preset posture constraint rules to obtain multiple groups of target batches, including: The training set is screened and grouped according to the number of pedestrian IDs and posture types to obtain multiple groups of target batches; wherein a single target batch contains image data corresponding to pedestrians greater than a preset number of pedestrians, and the image data corresponding to a single pedestrian in the target batch contains images of the pedestrian in different posture types, and the proportions of the images of different posture types are balanced; The step of performing a second-stage training on the model trained in the first stage using the target batch to obtain the person re-identification model includes: Fixing the fully connected layer of the first-stage trained model, and inputting the target batch into the first-stage trained model to train the fully connected layer separately; When the number of separate training times reaches a preset number, the fixation of the fully connected layer is canceled, so that each layer in the model performs parameter backpropagation and update to obtain the pedestrian re-identification model.

2. The method for creating a person re-identification model according to claim 1, characterized in that: The step of obtaining pedestrian image data to obtain a training set includes: Obtaining pedestrian image data, and classifying the pedestrian image data according to the pedestrian ID and posture type corresponding to the pedestrian image data; The target posture type is determined according to the amount of pedestrian picture data corresponding to each posture type, and data enhancement is performed on the pedestrian picture data corresponding to the target posture type to obtain the training set.

3. The method for creating a person re-identification model according to claim 2, characterized in that: The obtaining of pedestrian image data and classifying the pedestrian image data according to the pedestrian ID and posture type corresponding to the pedestrian image data includes: Obtain pedestrian images collected by different cameras at different angles at multiple points to obtain image data of multiple pedestrians in different posture types; A corresponding pedestrian ID is added to each pedestrian image according to the pedestrian target in the pedestrian image, and a corresponding posture type identifier is added to each pedestrian image according to the posture type of the pedestrian in the pedestrian image, so as to obtain images classified according to the pedestrian ID and posture type; the posture types include front view, side view and back view.

4. The method for creating a person re-identification model according to claim 2, characterized in that: The classifying the pedestrian image data according to the pedestrian ID and posture type corresponding to the pedestrian image data includes: The posture classification model obtained by pre-training is used to identify the posture type corresponding to the pedestrian image data, so as to perform posture classification on the pedestrian image data.

5. The method for creating a person re-identification model according to claim 1, characterized in that: The training process of the network to be trained also includes: The network to be trained is trained end-to-end using a Combined Margin Loss loss function or an arcfaceloss loss function.

6. A pedestrian re-identification model creation device, characterized in that: include: A training set determination module, used to obtain pedestrian image data to obtain a training set; A target batch determination module is used to group the training set according to preset posture constraint rules to obtain multiple groups of target batches; the preset posture constraint rules include the number of pedestrian IDs and posture types; A training module, used for constructing a network to be trained, performing a first-stage training on the network to be trained using the training set to obtain a first-stage trained model, and performing a second-stage training on the first-stage trained model using the target batch to obtain the person re-identification model; The target batch determination module is further used to filter and group the training set according to the number of pedestrian IDs and posture types to obtain multiple groups of target batches; wherein a single target batch contains image data corresponding to pedestrians greater than a preset number of pedestrians, and the image data corresponding to a single pedestrian in the target batch contains images of the pedestrian in different posture types, and the proportions of the images of different posture types are balanced; Among them, the training module is also used to fix the fully connected layer of the model after the first stage training, input the target batch into the model after the first stage training, so as to train the fully connected layer separately; when the number of separate training reaches a preset number, the fixation of the fully connected layer is cancelled, so that the parameters of each layer in the model are back-propagated and updated to obtain the pedestrian re-identification model.

7. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the method for creating a pedestrian re-identification model as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein when the computer programs are executed by a processor, the method for creating a pedestrian re-identification model as described in any one of claims 1 to 5 is implemented.