WO2021212737A1 - 一种行人重识别方法、系统、设备及计算机可读存储介质 - Google Patents

一种行人重识别方法、系统、设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2021212737A1
WO2021212737A1 PCT/CN2020/117333 CN2020117333W WO2021212737A1 WO 2021212737 A1 WO2021212737 A1 WO 2021212737A1 CN 2020117333 W CN2020117333 W CN 2020117333W WO 2021212737 A1 WO2021212737 A1 WO 2021212737A1
Authority
WO
WIPO (PCT)
Prior art keywords
pedestrian
sample set
trained
training
hyperparameter
Prior art date
Application number
PCT/CN2020/117333
Other languages
English (en)
French (fr)
Inventor
张润泽
金良
郭振华
Original Assignee
苏州浪潮智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Priority to US17/914,799 priority Critical patent/US20240005633A1/en
Publication of WO2021212737A1 publication Critical patent/WO2021212737A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Definitions

  • This application relates to the technical field of pedestrian re-identification, and more specifically, to a pedestrian re-identification method, system, equipment, and computer-readable storage medium.
  • Pedestrian Re-identification is a technology that uses computer vision technology to determine whether there is a specific pedestrian in an image or video sequence. This technology is usually used in the security field. In surveillance video, due to the low resolution of the camera and the special shooting angle, it is usually impossible to obtain high-quality pictures. Therefore, when technologies such as face recognition fail, ReID becomes an important alternative technology.
  • Pedestrian re-recognition is to retrieve all the pictures of pedestrians who are interested in one camera from other cameras.
  • Data sets are usually pictures obtained by target detection or manual annotation, and are usually divided into training set, validation set, Query, and Gallery. Train the model on the training set, calculate the image features in the Query set and the Gallery set, and then calculate the feature similarity, and find the top N similar pictures for each picture in the Query set. Training and testing require that the identity of the person is not repeated.
  • pedestrian re-identification when the scale of the data set is too small, the quality of the data set is not high, and there is a serious category imbalance problem, how to ensure the recognition effect of pedestrian re-identification Become a problem.
  • This application is to provide a pedestrian re-identification method, which can solve the technical problem of how to ensure the recognition effect of pedestrian re-identification to a certain extent.
  • This application also provides a pedestrian re-identification system, equipment and computer-readable storage medium.
  • a pedestrian re-identification method including:
  • the pedestrian categories between any two groups are different.
  • the training of a pre-built pedestrian re-identification model through data resampling and cross-validation methods based on the sample set to be trained includes:
  • the pre-built pedestrian re-identification model is trained through a cross-validation method.
  • the process of training the pre-built pedestrian re-identification model through the cross-validation method based on the first target sample set includes:
  • the value of the first preset value includes 100; the value of the second preset value includes 4; and the cross-validation method includes a 4-cross-validation method.
  • the process of training the pre-built pedestrian re-recognition model through data resampling and cross-validation based on the sample set to be trained includes:
  • the hyperparameter types include: the number of pictures of each pedestrian, the boundary of the number of pictures, the initial learning rate, the training period, the triplet loss threshold, and the Rerank parameter set;
  • the hyperparameter search space of the number of pictures of each pedestrian includes ⁇ 2,4,8 ⁇ ; the hyperparameter search space of the boundary of the number of pictures includes ⁇ 10,30,50,70,100 ⁇ ; the initial learning rate
  • the hyperparameter search space includes ⁇ 0.00035,0.001,0.003,0.01 ⁇ ; the hyperparameter search space of the training period includes ⁇ 80,120,160,240 ⁇ ; the hyperparameter search space of the triple loss threshold includes ⁇ 0.3,1.2,4.8,10.0 ,20.0 ⁇ ;
  • the hyperparameter search space of K1 in the Rerank parameter set includes ⁇ 1,5,10,15,20 ⁇ , and the hyperparameter search space of k2 in the Rerank parameter set includes ⁇ 1,2,3,4 ,5,6 ⁇
  • the hyperparameter search space of ⁇ in the Rerank parameter set includes ⁇ 0.3,0.6,0.9 ⁇ ;
  • the order of the hyperparameter adjustment priority from high to low is: the training period, the initial learning rate, the number of pictures of each pedestrian, the triplet loss threshold, the boundary of the number of pictures, Said K1, said k2, said ⁇ .
  • the process of training the pre-built pedestrian re-recognition model through data resampling and cross-validation based on the sample set to be trained includes:
  • the pedestrian re-identification model is trained through the training set, the pedestrian re-identification model is verified through the verification set, and the average of the mAP and Rank1 values calculated through the verification set is used as the The accuracy value of the pedestrian re-identification model is used to optimize the pedestrian re-identification model based on the accuracy value.
  • a pedestrian re-identification system including:
  • the first acquisition module is used to acquire a sample set to be trained
  • the first training module is configured to train the pre-built pedestrian re-recognition model based on the sample set to be trained by data resampling and cross-validation methods to obtain the trained pedestrian re-recognition model;
  • the first recognition module is configured to perform pedestrian re-recognition based on the trained pedestrian re-recognition model
  • the pedestrian categories between any two groups are different.
  • a pedestrian re-identification device including:
  • Memory used to store computer programs
  • the processor is used to implement the steps of any one of the above-mentioned pedestrian re-identification methods when the computer program is executed.
  • a computer-readable storage medium in which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the pedestrian re-identification methods described above are realized.
  • a pedestrian re-identification method provided in this application obtains a sample set to be trained; based on the sample set to be trained, a pre-built pedestrian re-identification model is trained through data resampling and cross-validation methods to obtain a trained pedestrian re-identification model ; Pedestrian re-recognition based on the trained pedestrian re-recognition model; among them, after the training sample set is grouped according to the cross-validation method, the pedestrian categories between any two groups are different.
  • the pre-built pedestrian re-recognition model is trained through data resampling and cross-validation methods, so that the number of sample sets to be trained after data resampling increases, and the sample set to be trained After grouping according to the cross-validation method, the pedestrian categories between any two groups are different, which can reduce the impact of repeated samples on the training process, enhance the training effect, and further improve the recognition effect of pedestrian re-identification.
  • the pedestrian re-identification system, equipment, and computer-readable storage medium provided in this application also solve the corresponding technical problems.
  • Fig. 1 is a flowchart of a pedestrian re-identification method provided by an embodiment of the application
  • FIG. 2 is a schematic structural diagram of a pedestrian re-identification system provided by an embodiment of the application.
  • FIG. 3 is a schematic structural diagram of a pedestrian re-identification device provided by an embodiment of the application.
  • FIG. 4 is a schematic diagram of another structure of a pedestrian re-identification device provided by an embodiment of the application.
  • FIG. 1 is a flowchart of a pedestrian re-identification method according to an embodiment of the application.
  • Step S101 Obtain a sample set to be trained.
  • the sample set to be trained can be obtained first.
  • the sample set to be trained refers to the sample set used to train the pedestrian re-recognition model, which may include multiple types of pictures of multiple pedestrians.
  • Step S102 Based on the sample set to be trained, the pre-built pedestrian re-recognition model is trained through data resampling and cross-validation methods to obtain a trained pedestrian re-recognition model.
  • the pre-built pedestrian re-recognition model can be trained based on the sample set to be trained through data resampling and cross-validation methods.
  • the samples in the training sample set can be reprocessed through data resampling, so that the sample set to be trained can meet the training requirements; the pedestrian re-identification model is trained through the cross-validation method, and the sample set to be trained is set in accordance with the cross-validation method After grouping, the categories of pedestrians in any two groups are different, reducing the impact of repeated samples on the training process; in addition, the type of pedestrian re-identification model in this application can be determined according to actual needs, for example, the pedestrian re-identification model can be For neural network models, etc.;
  • Step S103 Perform pedestrian re-identification based on the trained pedestrian re-identification model; wherein, after the training sample set is grouped according to the cross-validation method, the pedestrian categories between any two groups are different.
  • pedestrian re-recognition can be performed based on the trained pedestrian re-recognition model.
  • a pedestrian re-identification method provided in this application obtains a sample set to be trained; based on the sample set to be trained, a pre-built pedestrian re-identification model is trained through data resampling and cross-validation methods to obtain a trained pedestrian re-identification model ; Pedestrian re-recognition based on the trained pedestrian re-recognition model; among them, after the training sample set is grouped according to the cross-validation method, the pedestrian categories between any two groups are different.
  • the pre-built pedestrian re-recognition model is trained through data resampling and cross-validation methods, so that the number of sample sets to be trained after data resampling increases, and the sample set to be trained After grouping according to the cross-validation method, the pedestrian categories between any two groups are different, which can reduce the impact of repeated samples on the training process, enhance the training effect, and further improve the recognition effect of pedestrian re-identification.
  • the process of training the pre-built pedestrian re-recognition model through data resampling and cross-validation based on the sample set to be trained can be specifically: removing the sample set to be trained Pictures of pedestrians whose number of pictures are greater than the first preset value are removed from the sample set; determine the first target pedestrian whose number of pictures in the removed sample set is less than the second preset value; copy the pictures of the first target pedestrian, Obtain the first copied picture; use the first copied picture and the eliminated sample set as the first target sample set; based on the first target sample set, train the pre-built pedestrian re-recognition model through the cross-validation method.
  • the pictures of pedestrians whose number of pictures in the training sample set is greater than the first preset value can be eliminated first to obtain the eliminated sample set; and then the deleted sample set can be determined.
  • the process of training the pre-built pedestrian re-recognition model through the cross-validation method based on the first target sample set may include: determining that the number of pictures in the first target sample set is greater than the second preset value and smaller than the first target sample set.
  • a second target pedestrian with a preset value copy the picture of the second target pedestrian to obtain a second copied picture, and use the second copied picture and the first target sample set as the second target sample set to be based on the second target sample set Conduct training.
  • the pictures of pedestrians whose number of pictures in the training sample set is greater than the first preset value can be eliminated first to obtain the eliminated sample set; determine the eliminated image in the sample set The first target pedestrian whose number is less than the second preset value; copy the picture of the first target pedestrian to obtain the first copy picture; use the first copy picture and the deleted sample set as the first target sample set;
  • the second target pedestrian whose number of pictures in the first target sample set is greater than the second preset value and less than the first preset value is determined, and the picture of the second target pedestrian is copied to obtain the second copy Picture, the second copied picture and the first target sample set are used as the second target sample set to perform training based on the second target sample set.
  • the value of the first preset value may include 100; the value of the second preset value may include 4; the cross-validation method may include 4 cross-validation methods. At this time, the number of image categories of any pedestrian in the sample set to be trained Also 4.
  • the pedestrian re-recognition model needs to be trained in the process of training the pre-built pedestrian re-recognition model through data resampling and cross-validation based on the sample set to be trained The process is evaluated in order to further train the pedestrian re-identification model according to the evaluation results.
  • the target sample set can be divided into N grouped sample sets according to the pedestrian category, and the value of N is equal to the number of crossings of the cross-validation method, such as For the 4 cross-validation method, the value of N is 4, and for the 5 cross-validation method, the value of N is 5, etc.; select N-1 grouped sample sets as the training set, and use the remaining grouped sample set As a validation set; train the pedestrian re-identification model through the training set, verify the pedestrian re-identification model through the validation set, and use the average of the mAP and Rank1 values calculated from the validation set as the accuracy value of the pedestrian re-identification model , To optimize the pedestrian re-identification model based on the accuracy value.
  • both mAP and Rank1 are pedestrian re-identification evaluation indicators in the prior art; and in specific application scenarios, when determining the optimal value of each type of parameter in the pedestrian re-identification model, it can ensure that other parameters remain unchanged and repeat Perform the steps provided in this embodiment N times, and use the average value of the accuracy values N times as the final accuracy of the parameter, given the discrete parameter search space, select the parameter with the highest final accuracy as the optimal value of the parameter, and so on.
  • the pre-built pedestrian re-recognition model is trained through data resampling and cross-validation methods.
  • the pedestrian re-recognition model can be determined in advance.
  • Hyperparameter information to quickly adjust the parameters of the pedestrian re-recognition model during the training process.
  • the hyperparameter type, hyperparameter search space, and hyperparameter adjustment priority of the pedestrian re-identification model can be determined; based on the hyperparameter type , Hyperparameter search space and hyperparameter adjustment priority train the pedestrian re-identification model.
  • the types of hyperparameters can include: the number of pictures of each pedestrian, the boundary of the number of pictures, the initial learning rate, the training period, the triple loss threshold, and the set of Rerank parameters;
  • the hyperparameter search space for the number of pictures of each pedestrian includes ⁇ 2,4,8 ⁇ ; the hyperparameter search space for the boundary of the number of pictures includes ⁇ 10,30,50,70,100 ⁇ ; the hyperparameter search space for the initial learning rate includes ⁇ 0.00035,0.001,0.003,0.01 ⁇ ; the hyperparameter search space of the training period includes ⁇ 80,120,160,240 ⁇ ; the hyperparameter search space of the triple loss threshold includes ⁇ 0.3,1.2,4.8,10.0,20.0 ⁇ ; the K1 in the Rerank parameter set The hyperparameter search space includes ⁇ 1,5,10,15,20 ⁇ , the hyperparameter search space of k2 in the Rerank parameter set includes ⁇ 1,2,3,4,5,6 ⁇ , the hyperparameter of ⁇ in the Rerank parameter set The search space includes ⁇ 0.3,0.6,0.9 ⁇ ;
  • the order of hyperparameter adjustment priority from high to low can be: training period, initial learning rate, number of pictures per pedestrian, triple loss threshold, boundary of the number of pictures, K1, k2, ⁇ .
  • the structure of the pedestrian re-identification model in this application can be determined according to actual needs.
  • the pedestrian re-identification model in this application can be a neural network based on the backbone network of Resnet (residual neural network) 50, pedestrian re-identification model
  • the Batch Size (the number of samples selected for one training) can be 64, and can include stem network, four-layer stage network, fully connected layer, etc.
  • the picture passes through the stem network of the pedestrian re-recognition model, stage1 to stage4 network structure Later, the feature map becomes 1/32 of the original size, and then GAP (Global Average Pooling) is performed on this feature map, and then the final fully connected layer is connected for the final classification; and the loss function of the pedestrian re-identification model can use cross entropy The function of the combination of loss and triple loss, etc.
  • GAP Global Average Pooling
  • the pedestrian re-identification method provided in this application is tested under the experimental environment of 8 V100 GPUs.
  • the database uses the Market1501 data set and NAIC 2019 pedestrian re-identification competition preliminary data. set.
  • the Market1501 data set contains 751 people, a total of 12936 images, and an average of 17.2 training data per person.
  • the NAIC 2019 Pedestrian Recognition Competition Data Set training set has 20,429 images.
  • the model uses a Resnet50-based backbone network, and the data enhancement uses horizontal flipping and random erasure.
  • the input picture resolution is 256*128.
  • the best parameters searched for Market1501 are shown in Table 1; the best parameters searched for the NAIC data set are shown in Table 2.
  • the accuracy of the parameters in Table 1 and Table 2 on the validation set is shown as Table 3; where N represents the number of pictures of each pedestrian, M represents the boundary of the number of pictures, lr represents the initial learning rate, epoch represents the training period, and ⁇ represents the ternary loss threshold.
  • FIG. 2 is a schematic structural diagram of a pedestrian re-identification system provided by an embodiment of the application.
  • the first obtaining module 101 is used to obtain a sample set to be trained
  • the first training module 102 is used to train the pre-built pedestrian re-recognition model based on the sample set to be trained through data resampling and cross-validation methods to obtain a trained pedestrian re-recognition model;
  • the first recognition module 103 is configured to perform pedestrian re-recognition based on the trained pedestrian re-recognition model
  • the pedestrian categories between any two groups are different.
  • the first training module may include:
  • the first removal unit is used to remove pictures of pedestrians whose number of pictures in the sample set to be trained is greater than the first preset value to obtain the removed sample set;
  • the first determining unit is used to determine the first target pedestrian whose number of pictures in the sample set after being eliminated is less than a second preset value
  • the first copying unit is used to copy the picture of the target pedestrian to obtain the first copied picture
  • the first setting unit is configured to use the first copied picture and the eliminated sample set as the first target sample set
  • the first training unit is used to train the pre-built pedestrian re-identification model based on the first target sample set through a cross-validation method.
  • the first training unit may include:
  • the second training unit is used to determine the second target pedestrian whose number of pictures in the sample set is greater than the second preset value and less than the first preset value, copy the picture of the second target pedestrian to obtain the second copied picture, 2.
  • the copied picture and the first target sample set are used as the second target sample set to perform training based on the second target sample set.
  • the value of the first preset value may include 100; the value of the second preset value includes 4; the cross-validation method includes a 4-cross-validation method.
  • the first training module may include:
  • the first splitting unit is used to divide the target sample set into N grouped sample sets according to the pedestrian category and the picture category, and the value of N is equal to the number of crossings of the cross-validation method;
  • the second setting unit is used to select N-1 grouped sample sets among them as the training set, and use the remaining grouped sample set as the verification set;
  • the third training unit is used to train the pedestrian re-identification model through the training set, verify the pedestrian re-identification model through the verification set, and use the average of the mAP and Rank1 values calculated from the verification set as the pedestrian re-identification model
  • the accuracy value is used to optimize the pedestrian re-identification model based on the accuracy value.
  • the first training module may include:
  • the second determining unit is used to determine the hyperparameter type, hyperparameter search space, and hyperparameter adjustment priority of the pedestrian re-identification model;
  • the fourth training unit is used to train the pedestrian re-identification model based on the hyperparameter type, the hyperparameter search space, and the hyperparameter adjustment priority.
  • the hyperparameter types may include: the number of pictures of each pedestrian, the boundary of the number of pictures, the initial learning rate, the training period, the triplet loss threshold, and the Rerank parameter set;
  • the hyperparameter search space for the number of pictures of each pedestrian includes ⁇ 2,4,8 ⁇ ; the hyperparameter search space for the boundary of the number of pictures includes ⁇ 10,30,50,70,100 ⁇ ; the hyperparameter search space for the initial learning rate includes ⁇ 0.00035,0.001,0.003,0.01 ⁇ ; the hyperparameter search space of the training period includes ⁇ 80,120,160,240 ⁇ ; the hyperparameter search space of the triple loss threshold includes ⁇ 0.3,1.2,4.8,10.0,20.0 ⁇ ; the K1 in the Rerank parameter set The hyperparameter search space includes ⁇ 1,5,10,15,20 ⁇ , the hyperparameter search space of k2 in the Rerank parameter set includes ⁇ 1,2,3,4,5,6 ⁇ , the hyperparameter of ⁇ in the Rerank parameter set The search space includes ⁇ 0.3,0.6,0.9 ⁇ ;
  • the order of hyperparameter adjustment priority from high to low is: training period, initial learning rate, number of pictures per pedestrian, triple loss threshold, boundary of the number of pictures, K1, k2, ⁇ .
  • the present application also provides a pedestrian re-identification device and a computer-readable storage medium, both of which have the corresponding effects of the pedestrian re-identification method provided in the embodiments of the present application.
  • FIG. 3 is a schematic structural diagram of a pedestrian re-identification device provided by an embodiment of the application.
  • a pedestrian re-identification device provided by an embodiment of the present application includes a memory 201 and a processor 202.
  • the memory 201 stores a computer program.
  • the processor 202 implements the following steps when the computer program is executed:
  • the pre-built pedestrian re-recognition model is trained through data resampling and cross-validation methods to obtain a trained pedestrian re-recognition model
  • the pedestrian categories between any two groups are different.
  • a pedestrian re-identification device provided by an embodiment of the present application includes a memory 201 and a processor 202.
  • a computer program is stored in the memory 201.
  • the processor 202 executes the computer program, the following steps are implemented: The pictures of pedestrians with a preset value are removed from the sample set; the first target pedestrian whose number of pictures in the removed sample set is less than the second preset value is determined; the picture of the first target pedestrian is copied to obtain the first copied picture ; The first copied picture and the removed sample set are used as the first target sample set; based on the first target sample set, the pre-built pedestrian re-recognition model is trained through the cross-validation method.
  • a pedestrian re-identification device includes a memory 201 and a processor 202.
  • the memory 201 stores a computer program.
  • the processor 202 executes the computer program, the following steps are implemented: It is determined that the number of pictures in the first target sample set is greater than For a second target pedestrian with a second preset value and less than the first preset value, copy the picture of the second target pedestrian to obtain a second copied picture, and use the second copied picture and the first target sample set as the second target sample set , To train based on the second target sample set.
  • a pedestrian re-identification device provided by an embodiment of the present application includes a memory 201 and a processor 202.
  • the memory 201 stores a computer program.
  • the processor 202 executes the computer program, the following steps are implemented: the value of the first preset value includes 100; The value of the second preset value includes 4; the cross-validation method includes 4 cross-validation methods.
  • a pedestrian re-identification device provided by an embodiment of the present application includes a memory 201 and a processor 202.
  • a computer program is stored in the memory 201.
  • the processor 202 executes the computer program, the following steps are implemented: The category is divided into N grouped sample sets, the value of N is equal to the number of cross-validation methods; N-1 grouped sample sets are selected as the training set, and the remaining grouped sample set is used as the validation set; through training Set to train the pedestrian re-identification model, verify the pedestrian re-identification model through the verification set, and use the average of the mAP and Rank1 values calculated from the verification set as the accuracy value of the pedestrian re-identification model based on the accuracy value Optimal selection of pedestrian re-identification models.
  • a pedestrian re-identification device provided by an embodiment of the present application includes a memory 201 and a processor 202.
  • the memory 201 stores a computer program.
  • the processor 202 executes the computer program, the following steps are implemented: determining the hyperparameter type of the pedestrian re-identification model, Hyperparameter search space and hyperparameter adjustment priority; based on the hyperparameter type, hyperparameter search space, and hyperparameter adjustment priority, the pedestrian re-identification model is trained.
  • a pedestrian re-identification device includes a memory 201 and a processor 202.
  • a computer program is stored in the memory 201.
  • the processor 202 executes the computer program, the following steps are implemented:
  • the hyperparameter type includes: a picture of each pedestrian The number of pictures, the boundary of the number of pictures, the initial learning rate, the training period, the triple loss threshold, and the Rerank parameter set;
  • the hyperparameter search space for the number of pictures of each pedestrian includes ⁇ 2,4,8 ⁇ ; the boundary of the number of pictures exceeds the
  • the parameter search space includes ⁇ 10,30,50,70,100 ⁇ ;
  • the hyperparameter search space for the initial learning rate includes ⁇ 0.00035,0.001,0.003,0.01 ⁇ ;
  • the hyperparameter search space for the training period includes ⁇ 80,120,160,240 ⁇ ;
  • the search space of hyperparameters includes ⁇ 0.3,1.2,4.8,10.0,20.0 ⁇ ;
  • the hyperparameter search space of K1 in the Rerank parameter set
  • another pedestrian re-identification device may further include: an input port 203 connected to the processor 202, for transmitting commands input from the outside to the processor 202; connected to the processor 202
  • the display unit 204 is used to display the processing result of the processor 202 to the outside;
  • the communication module 205 connected to the processor 202 is used to realize the communication between the pedestrian re-identification device and the outside.
  • the display unit 204 may be a display panel, a laser scanning display, etc.; the communication method adopted by the communication module 205 includes, but is not limited to, mobile high-definition link technology (HML), universal serial bus (USB), high-definition multimedia interface (HDMI), Wireless connection: wireless fidelity technology (WiFi), Bluetooth communication technology, low-power Bluetooth communication technology, communication technology based on IEEE802.11s.
  • HML mobile high-definition link technology
  • USB universal serial bus
  • HDMI high-definition multimedia interface
  • WiFi wireless fidelity technology
  • Bluetooth communication technology Low-power Bluetooth communication technology
  • An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the pre-built pedestrian re-recognition model is trained through data resampling and cross-validation methods to obtain a trained pedestrian re-recognition model
  • the pedestrian categories between any two groups are different.
  • An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: the number of pictures in the sample set to be trained is removed that is greater than a first preset value Pedestrian pictures, get the culled sample set; Determine the first target pedestrian whose number of pictures in the culled sample set is less than the second preset value; Copy the picture of the first target pedestrian to get the first copied picture; The copied picture and the removed sample set are used as the first target sample set; based on the first target sample set, the pre-built pedestrian re-recognition model is trained through the cross-validation method.
  • An embodiment of the present application provides a computer-readable storage medium in which a computer program is stored.
  • the computer program is executed by a processor, the following steps are implemented: it is determined that the number of pictures in the first target sample set is greater than the second preset
  • the second target pedestrian whose value is less than the first preset value is copied from the picture of the second target pedestrian to obtain the second copied picture, and the second copied picture and the first target sample set are used as the second target sample set based on the first Two target sample sets are trained.
  • An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: the value of the first preset value includes 100; the second preset Values include 4; cross-validation methods include 4 cross-validation methods.
  • An embodiment of the present application provides a computer-readable storage medium in which a computer program is stored.
  • the computer program When the computer program is executed by a processor, the following steps are implemented: divide the target sample set into N according to the pedestrian category and the picture category.
  • the value of N is equal to the number of crossings of the cross-validation method; N-1 of the grouped sample sets are selected as the training set, and the remaining grouped sample set is used as the validation set; the pedestrian is re-weighted through the training set
  • the recognition model is trained, the pedestrian re-identification model is verified through the verification set, and the average of the mAP and Rank1 values calculated from the verification set is used as the accuracy value of the pedestrian re-identification model to re-identify pedestrians based on the accuracy value Model selection.
  • An embodiment of the present application provides a computer-readable storage medium in which a computer program is stored.
  • the computer program is executed by a processor, the following steps are implemented: determining the hyperparameter type and hyperparameter search space of the pedestrian re-identification model , Hyperparameter adjustment priority; based on the hyperparameter type, hyperparameter search space, and hyperparameter adjustment priority, the pedestrian re-identification model is trained.
  • An embodiment of the present application provides a computer-readable storage medium in which a computer program is stored.
  • the type of hyperparameter includes: the number of pictures per pedestrian, the number of pictures The boundary, initial learning rate, training period, triple loss threshold, Rerank parameter set;
  • the hyperparameter search space for the number of pictures of each pedestrian includes ⁇ 2,4,8 ⁇ ;
  • the hyperparameter search space for the boundary of the number of pictures includes ⁇ 10,30,50,70,100 ⁇ ;
  • the hyperparameter search space of the initial learning rate includes ⁇ 0.00035,0.001,0.003,0.01 ⁇ ;
  • the hyperparameter search space of the training period includes ⁇ 80,120,160,240 ⁇ ;
  • the hyperparameter search of the triple loss threshold The space includes ⁇ 0.3,1.2,4.8,10.0,20.0 ⁇ ;
  • the hyperparameter search space of K1 in the Rerank parameter set includes ⁇ 1,5,10,15,20 ⁇ , and the hyperparameter search space of k2 in the Rerank parameter set includes ⁇ 1 ,2,3,
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically programmable ROM
  • EEPly erasable programmable ROM registers
  • hard disks hard disks
  • removable disks or CD-ROMs , Or any other form of storage medium known in the technical field.

Abstract

一种行人重识别方法、系统、设备及计算机可读存储介质,获取待训练样本集(S101);基于待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,得到训练好的行人重识别模型(S102);基于训练好的行人重识别模型进行行人重识别;其中,待训练样本集按照交叉验证方法进行分组后,任意两个分组间的行人类别均不同(S103)。上述方法通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,使得数据重采样后的待训练样本集的数量增多,并且使得交叉验证方法中各个分组中的行人类别均不相同,增强了训练效果,进而可以提高行人重识别的识别效果。

Description

一种行人重识别方法、系统、设备及计算机可读存储介质
本申请要求于2020年4月23日提交中国专利局、申请号为202010327772.1、发明名称为“一种行人重识别方法、系统、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及行人重识别技术领域,更具体地说,涉及一种行人重识别方法、系统、设备及计算机可读存储介质。
背景技术
行人重识别(Person Re-identification,Re-ID)是利用计算机视觉技术判断图像或者视频序列中是否存在特定行人的技术。该项技术通常被应用于安防领域。在监控视频中,由于相机分辨率较低,拍摄角度比较特别,通常无法得到质量高的图片。因而当像人脸识别等技术失效时,ReID就成为一个很重要的替代技术。
行人重识别是对一个摄像头感兴趣的行人,检索到该行人在其他摄像头的所有图片。数据集通常是由目标检测或者人工标注得到的图片,通常分为训练集、验证集、Query、Gallery。在训练集上训练模型,在Query集及Gallery集计算图像特征,然后用来计算特征相似度,对于Query集中每张图片找出前N个与其相似图片。训练、测试要求人物身份不重复,然而,在行人重识别中,当数据集的规模过小、数据集质量不高、且存在严重的类别不平衡问题时,如何保证行人重识别的识别效果便成为一个问题。
综上所述,如何保证行人重识别的识别效果是目前本领域技术人员亟待解决的问题。
发明内容
本申请的目的是提供一种行人重识别方法,其能在一定程度上解决如何保证行人重识别的识别效果的技术问题。本申请还提供了一种行人重识 别系统、设备及计算机可读存储介质。
为了实现上述目的,本申请提供如下技术方案:
一种行人重识别方法,包括:
获取待训练样本集;
基于所述待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,得到训练好的所述行人重识别模型;
基于训练好的所述行人重识别模型进行行人重识别;
其中,所述待训练样本集按照所述交叉验证方法进行分组后,任意两个分组间的行人类别均不同。
优选的,所述基于所述待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,包括:
剔除所述待训练样本集中图片数大于第一预设值的行人的图片,得到剔除后的样本集;
确定出所述剔除后的样本集中图片数小于第二预设值的第一目标行人;
将所述第一目标行人的图片复制,得到第一复制图片;
将所述第一复制图片及所述剔除后的样本集作为第一目标样本集;
基于所述第一目标样本集,通过交叉验证方法对预先搭建的所述行人重识别模型进行训练。
优选的,所述基于所述第一目标样本集,通过所述交叉验证方法对预先搭建的所述行人重识别模型进行训练的过程中,包括:
确定出所述第一目标样本集中图片数大于所述第二预设值且小于所述第一预设值的第二目标行人,将所述第二目标行人的图片复制,得到第二复制图片,将所述第二复制图片及所述第一目标样本集作为第二目标样本集,以基于所述第二目标样本集进行训练。
优选的,所述第一预设值的值包括100;所述第二预设值的值包括4;所述交叉验证方法包括4交叉验证方法。
优选的,所述基于所述待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练的过程中,包括:
确定所述行人重识别模型的超参数类型、超参数搜寻空间、超参数调整优先级;
基于所述超参数类型、所述超参数搜寻空间、所述超参数调整优先级对所述行人重识别模型进行训练。
优选的,所述超参数类型包括:每个行人的图片数、图片数目的边界、初始学习率、训练周期、三元组损失阈值、Rerank参数集合;
所述每个行人的图片数的超参数搜寻空间包括{2,4,8};所述图片数目的边界的超参数搜寻空间包括{10,30,50,70,100};所述初始学习率的超参数搜寻空间包括{0.00035,0.001,0.003,0.01};所述训练周期的超参数搜寻空间包括{80,120,160,240};所述三元组损失阈值的超参数搜寻空间包括{0.3,1.2,4.8,10.0,20.0};所述Rerank参数集合中K1的超参数搜索空间包括{1,5,10,15,20},所述Rerank参数集合中k2的超参数搜索空间包括{1,2,3,4,5,6},所述Rerank参数集合中λ的超参数搜索空间包括{0.3,0.6,0.9};
所述超参数调整优先级由高到低的顺序为:所述训练周期、所述初始学习率、所述每个行人的图片数、所述三元组损失阈值、所述图片数目的边界、所述K1、所述k2、所述λ。
优选的,所述基于所述待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练的过程中,包括:
将所述待训练样本集,按照行人类别分为N份分组样本集,N的值与所述交叉验证方法的交叉次数相等;
选取其中的N-1份所述分组样本集作为训练集,将剩下的一份所述分组样本集作为验证集;
通过所述训练集对所述行人重识别模型进行训练,通过所述验证集对所述行人重识别模型进行验证,并将通过所述验证集计算得到的mAP及Rank1值的平均值作为所述行人重识别模型的准确度值,以基于所述准确度值对所述行人重识别模型进行选优。
一种行人重识别系统,包括:
第一获取模块,用于获取待训练样本集;
第一训练模块,用于基于所述待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,得到训练好的所述行人重识别模型;
第一识别模块,用于基于训练好的所述行人重识别模型进行行人重识别;
其中,所述待训练样本集按照所述交叉验证方法进行分组后,任意两个分组间的行人类别均不同。
一种行人重识别设备,包括:
存储器,用于存储计算机程序;
处理器,用于执行所述计算机程序时实现如上任一所述行人重识别方法的步骤。
一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序被处理器执行时实现如上任一所述行人重识别方法的步骤。
本申请提供的一种行人重识别方法,获取待训练样本集;基于待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,得到训练好的行人重识别模型;基于训练好的行人重识别模型进行行人重识别;其中,待训练样本集按照交叉验证方法进行分组后,任意两个分组间的行人类别均不同。本申请中,在获取待训练样本集后,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,使得数据重采样后的待训练样本集的数量增多,并且待训练样本集按照交叉验证方法进行分组后,任意两个分组间的行人类别均不同,可以降低重复样本对训练过程的影响,增强了训练效果,进而可以提高行人重识别的识别效果。本申请提供的一种行人重识别系统、设备及计算机可读存储介质也解决了相应技术问题。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请实施例提供的一种行人重识别方法的流程图;
图2为本申请实施例提供的一种行人重识别系统的结构示意图;
图3为本申请实施例提供的一种行人重识别设备的结构示意图;
图4为本申请实施例提供的一种行人重识别设备的另一结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
请参阅图1,图1为本申请实施例提供的一种行人重识别方法的流程图。
本申请实施例提供的一种行人重识别方法,可以包括以下步骤:
步骤S101:获取待训练样本集。
实际应用中,可以先获取待训练样本集,待训练样本集指的是用于对行人重识别模型进行训练的样本集,其中可以包括多个行人的多类图片。
步骤S102:基于待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,得到训练好的行人重识别模型。
实际应用中,在获取待训练样本集之后,便可以基于待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练。
应当指出,通过数据重采样可以对待训练样本集中的样本进行重新处理,使得待训练样本集可以满足训练要求;通过交叉验证方法对行人重识别模型进行训练,并且设置待训练样本集按照交叉验证方法进行分组后,任意两个分组中的行人类别均不相同,降低了重复样本对训练过程的影响;此外,本申请中的行人重识别模型的类型可以根据实际需要确定,比如行人重识别模型可以为神经网络模型等;
步骤S103:基于训练好的行人重识别模型进行行人重识别;其中,待训练样本集按照交叉验证方法进行分组后,任意两个分组间的行人类别均 不同。
实际应用中,在得到训练好的行人重识别模型之后,便可以基于训练好的行人重识别模型进行行人重识别。
本申请提供的一种行人重识别方法,获取待训练样本集;基于待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,得到训练好的行人重识别模型;基于训练好的行人重识别模型进行行人重识别;其中,待训练样本集按照交叉验证方法进行分组后,任意两个分组间的行人类别均不同。本申请中,在获取待训练样本集后,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,使得数据重采样后的待训练样本集的数量增多,并且待训练样本集按照交叉验证方法进行分组后,任意两个分组间的行人类别均不同,可以降低重复样本对训练过程的影响,增强了训练效果,进而可以提高行人重识别的识别效果。
本申请实施例提供的一种行人重识别方法中,基于待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练的过程,可以具体为:剔除待训练样本集中图片数大于第一预设值的行人的图片,得到剔除后的样本集;确定出剔除后的样本集中图片数小于第二预设值的第一目标行人;将第一目标行人的图片复制,得到第一复制图片;将第一复制图片及剔除后的样本集作为第一目标样本集;基于第一目标样本集,通过交叉验证方法对预先搭建的行人重识别模型进行训练。也即在训练前通过数据重采样对待训练样本集进行处理时,可以先剔除待训练样本集中图片数大于第一预设值的行人的图片,得到剔除后的样本集;再确定出剔除后的样本集中图片数小于第二预设值的第一目标行人;将第一目标行人的图片复制,得到第一复制图片;将第一复制图片及剔除后的样本集作为第一目标样本集;基于第一目标样本集,通过交叉验证方法对预先搭建的行人重识别模型进行训练。
实际应用中,基于第一目标样本集,通过交叉验证方法对预先搭建的行人重识别模型进行训练的过程中,可以包括:确定出第一目标样本集中 图片数大于第二预设值且小于第一预设值的第二目标行人,将第二目标行人的图片复制,得到第二复制图片,将第二复制图片及第一目标样本集作为第二目标样本集,以基于第二目标样本集进行训练。也即在通过数据重采样对待训练样本集进行处理时,可以先剔除待训练样本集中图片数大于第一预设值的行人的图片,得到剔除后的样本集;确定出剔除后的样本集中图片数小于第二预设值的第一目标行人;将第一目标行人的图片复制,得到第一复制图片;将第一复制图片及剔除后的样本集作为第一目标样本集;再在对行人重识别模型进行训练的过程中,确定出第一目标样本集中图片数大于第二预设值且小于第一预设值的第二目标行人,将第二目标行人的图片复制,得到第二复制图片,将第二复制图片及第一目标样本集作为第二目标样本集,以基于第二目标样本集进行训练。
实际应用中,第一预设值的值可以包括100;第二预设值的值可以包括4;交叉验证方法可以包括4交叉验证方法,此时,待训练样本集中任一行人的图片类别数也为4。
本申请实施例提供的一种行人重识别方法中,基于待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练的过程中,需要对行人重识别模型的训练过程进行评价,以便根据评价结果进一步对行人重识别模型进行训练,此时,可以将目标样本集,按照行人类别分为N份分组样本集,N的值与交叉验证方法的交叉次数相等,比如4交叉验证方法时,N的值便为4,5交叉验证方法时,N的值便为5等;选取其中的N-1份分组样本集作为训练集,将剩下的一份分组样本集作为验证集;通过训练集对行人重识别模型进行训练,通过验证集对行人重识别模型进行验证,并将通过验证集计算得到的mAP及Rank1值的平均值作为行人重识别模型的准确度值,以基于准确度值对行人重识别模型进行选优。应当指出,mAP及Rank1均为现有技术中的行人重识别评价指标;且在具体应用场景中,在确定行人重识别模型中每类参数的最优值时,可以保证其他参数不变,重复执行N次本实施例提供的步骤,并将N次准确度值的均值作为最终该参数的准确度,给定离散参数搜索空间,选取最终准确度最高的 参数作为该参数的最优值等。
本申请实施例提供的一种行人重识别方法中,基于待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练的过程中,可以事先确定行人重识别模型的超参数信息,以便在训练过程中快速对行人重识别模型进行参数调整,在此过程中,可以确定行人重识别模型的超参数类型、超参数搜寻空间、超参数调整优先级;基于超参数类型、超参数搜寻空间、超参数调整优先级对行人重识别模型进行训练。
实际应用中,超参数类型可以包括:每个行人的图片数、图片数目的边界、初始学习率、训练周期、三元组损失阈值、Rerank参数集合;
每个行人的图片数的超参数搜寻空间包括{2,4,8};图片数目的边界的超参数搜寻空间包括{10,30,50,70,100};初始学习率的超参数搜寻空间包括{0.00035,0.001,0.003,0.01};训练周期的超参数搜寻空间包括{80,120,160,240};三元组损失阈值的超参数搜寻空间包括{0.3,1.2,4.8,10.0,20.0};Rerank参数集合中K1的超参数搜索空间包括{1,5,10,15,20},Rerank参数集合中k2的超参数搜索空间包括{1,2,3,4,5,6},Rerank参数集合中λ的超参数搜索空间包括{0.3,0.6,0.9};
超参数调整优先级由高到低的顺序可以为:训练周期、初始学习率、每个行人的图片数、三元组损失阈值、图片数目的边界、K1、k2、λ。
应当指出,可以根据实际需要来确定本申请中行人重识别模型的结构,比如本申请中行人重识别模型可以为基于Resnet(残差神经网络)50的骨干网络搭建的神经网络,行人重识别模型的Batch Size(一次训练所选取的样本数)可以为64,且可以包括stem网络、四层stage网络、全连接层等,此时,图片经过行人重识别模型的stem网络、stage1到stage4网络结构后,特征图变为原来尺寸的1/32,然后对这个特征图进行GAP(Global Average Pooling),再接最终的全连接层进行最终的分类;且行人重识别模型的损失函数可以采用交叉熵损失与三元组损失结合的函数等。
为了对本申请提供的行人重识别方法的效果进行描述,现在8块V100  GPU的实验环境下对本申请提供的行人重识别方法进行测试,数据库采用的是Market1501数据集及NAIC 2019行人重识别比赛初赛数据集。Market1501数据集包含751人,共12936张图像,平均每人有17.2张训练数据。NAIC 2019行人重识别比赛数据集训练集有20429张图片,模型采用基于Resnet50的骨干网络,数据增强采用了水平翻转、随机擦除。输入图片分辨率为256*128。
最终对Market1501搜索到的最佳参数如表格1;最终对NAIC数据集搜索到的最佳参数为如表格2;对于NAIC数据集采用表格1和表格2的参数在验证集上得到的准确率如表格3;其中,N表示每个行人的图片数,M表示图片数目的边界,lr表示初始学习率,epoch表示训练周期,α表示三元损失阈值。可以看到两个数据集搜寻到的参数存在很大的差距,尤其在重采样参数以及三元组损失正负样本距离阈值α;这说明两个数据集的数据分布存在很大的不同,NAIC的数据正负样本差距较大,并且类别极为不平衡。同时通过表格3数据可以看出不同的参数对于模型性能的影响是很大的。而通过本申请的方法,可以很好地得到的数据集的最佳参数组合,模型训练效果好,识别效果好。
表1对Market1501搜索到的最佳参数
N 4
M 10
epoch 120
lr 0.00035
α 0.3
k1 20
k2 6
λ 0.3
表2对NAIC数据集搜索到的最佳参数
N 4
M 100
epoch 80
lr 0.001
α 10
k1 3
k2 2
λ 0.6
表3不同参数在NAIC数据集下性能
参数 准确率
表格1 75.23
表格2 81.38
请参阅图2,图2为本申请实施例提供的一种行人重识别系统的结构示意图。
本申请实施例提供的一种行人重识别系统,可以包括:
第一获取模块101,用于获取待训练样本集;
第一训练模块102,用于基于待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,得到训练好的行人重识别模型;
第一识别模块103,用于基于训练好的行人重识别模型进行行人重识别;
其中,待训练样本集按照交叉验证方法进行分组后,任意两个分组间的行人类别均不同。
本申请实施例提供的一种行人重识别系统,第一训练模块可以包括:
第一剔除单元,用于剔除待训练样本集中图片数大于第一预设值的行人的图片,得到剔除后的样本集;
第一确定单元,用于确定出剔除后的样本集中图片数小于第二预设值的第一目标行人;
第一复制单元,用于将目标行人的图片复制,得到第一复制图片;
第一设置单元,用于将第一复制图片及剔除后的样本集作为第一目标样本集;
第一训练单元,用于基于第一目标样本集,通过交叉验证方法对预先搭建的行人重识别模型进行训练。
本申请实施例提供的一种行人重识别系统,第一训练单元可以包括:
第二训练单元,用于确定出剔除样本集中图片数大于第二预设值且小于第一预设值的第二目标行人,将第二目标行人的图片复制,得到第二复制图片,将第二复制图片及第一目标样本集作为第二目标样本集,以基于第二目标样本集进行训练。
本申请实施例提供的一种行人重识别系统,第一预设值的值可以包括100;第二预设值的值包括4;交叉验证方法包括4交叉验证方法。
本申请实施例提供的一种行人重识别系统,第一训练模块可以包括:
第一拆分单元,用于将目标样本集,按照行人类别及图片类别分为N份分组样本集,N的值与交叉验证方法的交叉次数相等;
第二设置单元,用于选取其中的N-1份分组样本集作为训练集,将剩下的一份分组样本集作为验证集;
第三训练单元,用于通过训练集对行人重识别模型进行训练,通过验证集对行人重识别模型进行验证,并将通过验证集计算得到的mAP及Rank1值的平均值作为行人重识别模型的准确度值,以基于准确度值对行人重识别模型进行选优。
本申请实施例提供的一种行人重识别系统,第一训练模块可以包括:
第二确定单元,用于确定行人重识别模型的超参数类型、超参数搜寻空间、超参数调整优先级;
第四训练单元,用于基于超参数类型、超参数搜寻空间、超参数调整优先级对行人重识别模型进行训练。
本申请实施例提供的一种行人重识别系统,超参数类型可以包括:每 个行人的图片数、图片数目的边界、初始学习率、训练周期、三元组损失阈值、Rerank参数集合;
每个行人的图片数的超参数搜寻空间包括{2,4,8};图片数目的边界的超参数搜寻空间包括{10,30,50,70,100};初始学习率的超参数搜寻空间包括{0.00035,0.001,0.003,0.01};训练周期的超参数搜寻空间包括{80,120,160,240};三元组损失阈值的超参数搜寻空间包括{0.3,1.2,4.8,10.0,20.0};Rerank参数集合中K1的超参数搜索空间包括{1,5,10,15,20},Rerank参数集合中k2的超参数搜索空间包括{1,2,3,4,5,6},Rerank参数集合中λ的超参数搜索空间包括{0.3,0.6,0.9};
超参数调整优先级由高到低的顺序为:训练周期、初始学习率、每个行人的图片数、三元组损失阈值、图片数目的边界、K1、k2、λ。
本申请还提供了一种行人重识别设备及计算机可读存储介质,其均具有本申请实施例提供的一种行人重识别方法具有的对应效果。请参阅图3,图3为本申请实施例提供的一种行人重识别设备的结构示意图。
本申请实施例提供的一种行人重识别设备,包括存储器201和处理器202,存储器201中存储有计算机程序,处理器202执行计算机程序时实现如下步骤:
获取待训练样本集;
基于待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,得到训练好的行人重识别模型;
基于训练好的行人重识别模型进行行人重识别;
其中,待训练样本集按照交叉验证方法进行分组后,任意两个分组间的行人类别均不同。
本申请实施例提供的一种行人重识别设备,包括存储器201和处理器202,存储器201中存储有计算机程序,处理器202执行计算机程序时实现如下步骤:剔除待训练样本集中图片数大于第一预设值的行人的图片,得到剔除后的样本集;确定出剔除后的样本集中图片数小于第二预设值的第一目标行人;将第一目标行人的图片复制,得到第一复制图片;将第一复制 图片及剔除后的样本集作为第一目标样本集;基于第一目标样本集,通过交叉验证方法对预先搭建的行人重识别模型进行训练。
本申请实施例提供的一种行人重识别设备,包括存储器201和处理器202,存储器201中存储有计算机程序,处理器202执行计算机程序时实现如下步骤:确定出第一目标样本集中图片数大于第二预设值且小于第一预设值的第二目标行人,将第二目标行人的图片复制,得到第二复制图片,将第二复制图片及第一目标样本集作为第二目标样本集,以基于第二目标样本集进行训练。
本申请实施例提供的一种行人重识别设备,包括存储器201和处理器202,存储器201中存储有计算机程序,处理器202执行计算机程序时实现如下步骤:第一预设值的值包括100;第二预设值的值包括4;交叉验证方法包括4交叉验证方法。
本申请实施例提供的一种行人重识别设备,包括存储器201和处理器202,存储器201中存储有计算机程序,处理器202执行计算机程序时实现如下步骤:将目标样本集,按照行人类别及图片类别分为N份分组样本集,N的值与交叉验证方法的交叉次数相等;选取其中的N-1份分组样本集作为训练集,将剩下的一份分组样本集作为验证集;通过训练集对行人重识别模型进行训练,通过验证集对行人重识别模型进行验证,并将通过验证集计算得到的mAP及Rank1值的平均值作为行人重识别模型的准确度值,以基于准确度值对行人重识别模型进行选优。
本申请实施例提供的一种行人重识别设备,包括存储器201和处理器202,存储器201中存储有计算机程序,处理器202执行计算机程序时实现如下步骤:确定行人重识别模型的超参数类型、超参数搜寻空间、超参数调整优先级;基于超参数类型、超参数搜寻空间、超参数调整优先级对行人重识别模型进行训练。
本申请实施例提供的一种行人重识别设备,包括存储器201和处理器202,存储器201中存储有计算机程序,处理器202执行计算机程序时实现如下步骤:超参数类型包括:每个行人的图片数、图片数目的边界、初始学习率、训练周期、三元组损失阈值、Rerank参数集合;每个行人的图片数 的超参数搜寻空间包括{2,4,8};图片数目的边界的超参数搜寻空间包括{10,30,50,70,100};初始学习率的超参数搜寻空间包括{0.00035,0.001,0.003,0.01};训练周期的超参数搜寻空间包括{80,120,160,240};三元组损失阈值的超参数搜寻空间包括{0.3,1.2,4.8,10.0,20.0};Rerank参数集合中K1的超参数搜索空间包括{1,5,10,15,20},Rerank参数集合中k2的超参数搜索空间包括{1,2,3,4,5,6},Rerank参数集合中λ的超参数搜索空间包括{0.3,0.6,0.9};超参数调整优先级由高到低的顺序为:训练周期、初始学习率、每个行人的图片数、三元组损失阈值、图片数目的边界、K1、k2、λ。
请参阅图4,本申请实施例提供的另一种行人重识别设备中还可以包括:与处理器202连接的输入端口203,用于传输外界输入的命令至处理器202;与处理器202连接的显示单元204,用于显示处理器202的处理结果至外界;与处理器202连接的通信模块205,用于实现行人重识别设备与外界的通信。显示单元204可以为显示面板、激光扫描使显示器等;通信模块205所采用的通信方式包括但不局限于移动高清链接技术(HML)、通用串行总线(USB)、高清多媒体接口(HDMI)、无线连接:无线保真技术(WiFi)、蓝牙通信技术、低功耗蓝牙通信技术、基于IEEE802.11s的通信技术。
本申请实施例提供的一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,计算机程序被处理器执行时实现如下步骤:
获取待训练样本集;
基于待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,得到训练好的行人重识别模型;
基于训练好的行人重识别模型进行行人重识别;
其中,待训练样本集按照交叉验证方法进行分组后,任意两个分组间的行人类别均不同。
本申请实施例提供的一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,计算机程序被处理器执行时实现如下步骤:剔除待训练样本集中图片数大于第一预设值的行人的图片,得到剔除后的样本集; 确定出剔除后的样本集中图片数小于第二预设值的第一目标行人;将第一目标行人的图片复制,得到第一复制图片;将第一复制图片及剔除后的样本集作为第一目标样本集;基于第一目标样本集,通过交叉验证方法对预先搭建的行人重识别模型进行训练。
本申请实施例提供的一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,计算机程序被处理器执行时实现如下步骤:确定出第一目标样本集中图片数大于第二预设值且小于第一预设值的第二目标行人,将第二目标行人的图片复制,得到第二复制图片,将第二复制图片及第一目标样本集作为第二目标样本集,以基于第二目标样本集进行训练。
本申请实施例提供的一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,计算机程序被处理器执行时实现如下步骤:第一预设值的值包括100;第二预设值的值包括4;交叉验证方法包括4交叉验证方法。
本申请实施例提供的一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,计算机程序被处理器执行时实现如下步骤:将目标样本集,按照行人类别及图片类别分为N份分组样本集,N的值与交叉验证方法的交叉次数相等;选取其中的N-1份分组样本集作为训练集,将剩下的一份分组样本集作为验证集;通过训练集对行人重识别模型进行训练,通过验证集对行人重识别模型进行验证,并将通过验证集计算得到的mAP及Rank1值的平均值作为行人重识别模型的准确度值,以基于准确度值对行人重识别模型进行选优。
本申请实施例提供的一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,计算机程序被处理器执行时实现如下步骤:确定行人重识别模型的超参数类型、超参数搜寻空间、超参数调整优先级;基于超参数类型、超参数搜寻空间、超参数调整优先级对行人重识别模型进行训练。
本申请实施例提供的一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,计算机程序被处理器执行时实现如下步骤:超参数类型包括:每个行人的图片数、图片数目的边界、初始学习率、训练周期、 三元组损失阈值、Rerank参数集合;每个行人的图片数的超参数搜寻空间包括{2,4,8};图片数目的边界的超参数搜寻空间包括{10,30,50,70,100};初始学习率的超参数搜寻空间包括{0.00035,0.001,0.003,0.01};训练周期的超参数搜寻空间包括{80,120,160,240};三元组损失阈值的超参数搜寻空间包括{0.3,1.2,4.8,10.0,20.0};Rerank参数集合中K1的超参数搜索空间包括{1,5,10,15,20},Rerank参数集合中k2的超参数搜索空间包括{1,2,3,4,5,6},Rerank参数集合中λ的超参数搜索空间包括{0.3,0.6,0.9};超参数调整优先级由高到低的顺序为:训练周期、初始学习率、每个行人的图片数、三元组损失阈值、图片数目的边界、K1、k2、λ。
本申请所涉及的计算机可读存储介质包括随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质。
本申请实施例提供的行人重识别系统、设备及计算机可读存储介质中相关部分的说明请参见本申请实施例提供的行人重识别方法中对应部分的详细说明,在此不再赘述。另外,本申请实施例提供的上述技术方案中与现有技术中对应技术方案实现原理一致的部分并未详细说明,以免过多赘述。
还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
对所公开的实施例的上述说明,使本领域技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域技术人员来说将是显而易见的, 本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (10)

  1. 一种行人重识别方法,其特征在于,包括:
    获取待训练样本集;
    基于所述待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,得到训练好的所述行人重识别模型;
    基于训练好的所述行人重识别模型进行行人重识别;
    其中,所述待训练样本集按照所述交叉验证方法进行分组后,任意两个分组间的行人类别均不同。
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,包括:
    剔除所述待训练样本集中图片数大于第一预设值的行人的图片,得到剔除后的样本集;
    确定出所述剔除后的样本集中图片数小于第二预设值的第一目标行人;
    将所述第一目标行人的图片复制,得到第一复制图片;
    将所述第一复制图片及所述剔除后的样本集作为第一目标样本集;
    基于所述第一目标样本集,通过所述交叉验证方法对预先搭建的所述行人重识别模型进行训练。
  3. 根据权利2所述的方法,其特征在于,所述基于所述第一目标样本集,通过所述交叉验证方法对预先搭建的所述行人重识别模型进行训练的过程中,包括:
    确定出所述第一目标样本集中图片数大于所述第二预设值且小于所述第一预设值的第二目标行人,将所述第二目标行人的图片复制,得到第二复制图片,将所述第二复制图片及所述第一目标样本集作为第二目标样本集,以基于所述第二目标样本集进行训练。
  4. 根据权利要求2或3任一项所述的方法,其特征在于,所述第一预设值的值包括100;所述第二预设值的值包括4;所述交叉验证方法包括4交叉验证方法。
  5. 根据权利要求4所述的方法,其特征在于,所述基于所述待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练的过程中,包括:
    确定所述行人重识别模型的超参数类型、超参数搜寻空间、超参数调整优先级;
    基于所述超参数类型、所述超参数搜寻空间、所述超参数调整优先级对所述行人重识别模型进行训练。
  6. 根据权利要求5所述的方法,其特征在于,所述超参数类型包括:每个行人的图片数、图片数目的边界、初始学习率、训练周期、三元组损失阈值、Rerank参数集合;
    所述每个行人的图片数的超参数搜寻空间包括{2,4,8};所述图片数目的边界的超参数搜寻空间包括{10,30,50,70,100};所述初始学习率的超参数搜寻空间包括{0.00035,0.001,0.003,0.01};所述训练周期的超参数搜寻空间包括{80,120,160,240};所述三元组损失阈值的超参数搜寻空间包括{0.3,1.2,4.8,10.0,20.0};所述Rerank参数集合中k1的超参数搜索空间包括{1,5,10,15,20},所述Rerank参数集合中k2的超参数搜索空间包括{1,2,3,4,5,6},所述Rerank参数集合中λ的超参数搜索空间包括{0.3,0.6,0.9};
    所述超参数调整优先级由高到低的顺序为:所述训练周期、所述初始学习率、所述每个行人的图片数、所述三元组损失阈值、所述图片数目的边界、所述K1、所述k2、所述λ。
  7. 根据权利要求6所述的方法,其特征在于,所述基于所述待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练的过程中,包括:
    将所述待训练样本集,按照行人类别分为N份分组样本集,N的值与所述交叉验证方法的交叉次数相等;
    选取其中的N-1份所述分组样本集作为训练集,将剩下的一份所述分组样本集作为验证集;
    通过所述训练集对所述行人重识别模型进行训练,通过所述验证集对 所述行人重识别模型进行验证,并将通过所述验证集计算得到的mAP及Rank1值的平均值作为所述行人重识别模型的准确度值,以基于所述准确度值对所述行人重识别模型进行选优。
  8. 一种行人重识别系统,其特征在于,包括:
    第一获取模块,用于获取待训练样本集;
    第一训练模块,用于基于所述待训练样本集,通过数据重采样及交叉验证方法对预先搭建的行人重识别模型进行训练,得到训练好的所述行人重识别模型;
    第一识别模块,用于基于训练好的所述行人重识别模型进行行人重识别;
    其中,所述待训练样本集按照所述交叉验证方法进行分组后,任意两个分组间的行人类别均不同。
  9. 一种行人重识别设备,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于执行所述计算机程序时实现如权利要求1至7任一项所述行人重识别方法的步骤。
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述行人重识别方法的步骤。
PCT/CN2020/117333 2020-04-23 2020-09-24 一种行人重识别方法、系统、设备及计算机可读存储介质 WO2021212737A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/914,799 US20240005633A1 (en) 2020-04-23 2020-09-24 Person re-identification method, system, and device, and computer readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010327772.1 2020-04-23
CN202010327772.1A CN111523469B (zh) 2020-04-23 2020-04-23 一种行人重识别方法、系统、设备及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2021212737A1 true WO2021212737A1 (zh) 2021-10-28

Family

ID=71903799

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/117333 WO2021212737A1 (zh) 2020-04-23 2020-09-24 一种行人重识别方法、系统、设备及计算机可读存储介质

Country Status (3)

Country Link
US (1) US20240005633A1 (zh)
CN (1) CN111523469B (zh)
WO (1) WO2021212737A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115512391A (zh) * 2022-09-29 2022-12-23 珠海视熙科技有限公司 数据自适应重采样的目标检测模型训练方法、装置及设备
WO2023231184A1 (zh) * 2022-06-02 2023-12-07 江苏品生医疗科技集团有限公司 一种特征筛选方法、装置、存储介质及电子设备

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111523469B (zh) * 2020-04-23 2022-02-18 苏州浪潮智能科技有限公司 一种行人重识别方法、系统、设备及计算机可读存储介质
CN112527790B (zh) * 2020-12-24 2023-06-02 四川享宇金信金融科技有限公司 一种基于loo-cv验证的交叉核验方法
CN114120373A (zh) * 2022-01-24 2022-03-01 苏州浪潮智能科技有限公司 一种模型训练方法、装置、设备及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017059576A1 (en) * 2015-10-09 2017-04-13 Beijing Sensetime Technology Development Co., Ltd Apparatus and method for pedestrian detection
US20170236013A1 (en) * 2016-02-15 2017-08-17 Nvidia Corporation System and method for procedurally synthesizing datasets of objects of interest for training machine-learning models
CN108491884A (zh) * 2018-03-27 2018-09-04 中山大学 基于轻量级网络的行人再识别系统及实现方法
CN109145766A (zh) * 2018-07-27 2019-01-04 北京旷视科技有限公司 模型训练方法、装置、识别方法、电子设备及存储介质
US20190377940A1 (en) * 2018-06-12 2019-12-12 Capillary Technologies International Pte Ltd People detection system with feature space enhancement
CN110688888A (zh) * 2019-08-02 2020-01-14 浙江省北大信息技术高等研究院 一种基于深度学习的行人属性识别方法和系统
CN111523469A (zh) * 2020-04-23 2020-08-11 苏州浪潮智能科技有限公司 一种行人重识别方法、系统、设备及计算机可读存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108030494B (zh) * 2017-11-08 2019-11-15 华南理工大学 基于交叉验证的心电信号错误标记训练样本识别方法
CN109272048B (zh) * 2018-09-30 2022-04-12 北京工业大学 一种基于深度卷积神经网络的模式识别方法
CN110245608B (zh) * 2019-06-14 2022-05-17 西北工业大学 一种基于半张量积神经网络的水下目标识别方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017059576A1 (en) * 2015-10-09 2017-04-13 Beijing Sensetime Technology Development Co., Ltd Apparatus and method for pedestrian detection
US20170236013A1 (en) * 2016-02-15 2017-08-17 Nvidia Corporation System and method for procedurally synthesizing datasets of objects of interest for training machine-learning models
CN108491884A (zh) * 2018-03-27 2018-09-04 中山大学 基于轻量级网络的行人再识别系统及实现方法
US20190377940A1 (en) * 2018-06-12 2019-12-12 Capillary Technologies International Pte Ltd People detection system with feature space enhancement
CN109145766A (zh) * 2018-07-27 2019-01-04 北京旷视科技有限公司 模型训练方法、装置、识别方法、电子设备及存储介质
CN110688888A (zh) * 2019-08-02 2020-01-14 浙江省北大信息技术高等研究院 一种基于深度学习的行人属性识别方法和系统
CN111523469A (zh) * 2020-04-23 2020-08-11 苏州浪潮智能科技有限公司 一种行人重识别方法、系统、设备及计算机可读存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023231184A1 (zh) * 2022-06-02 2023-12-07 江苏品生医疗科技集团有限公司 一种特征筛选方法、装置、存储介质及电子设备
CN115512391A (zh) * 2022-09-29 2022-12-23 珠海视熙科技有限公司 数据自适应重采样的目标检测模型训练方法、装置及设备

Also Published As

Publication number Publication date
CN111523469A (zh) 2020-08-11
US20240005633A1 (en) 2024-01-04
CN111523469B (zh) 2022-02-18

Similar Documents

Publication Publication Date Title
WO2021212737A1 (zh) 一种行人重识别方法、系统、设备及计算机可读存储介质
WO2020169043A1 (zh) 一种密集人群计数的方法、装置、设备以及存储介质
WO2020221298A1 (zh) 文本检测模型训练方法、文本区域、内容确定方法和装置
CN110738125B (zh) 利用Mask R-CNN选择检测框的方法、装置及存储介质
CN110414352B (zh) 从视频文件中提取ppt文件信息的方法及相关设备
CN107784288B (zh) 一种基于深度神经网络的迭代定位式人脸检测方法
CN109993040A (zh) 文本识别方法及装置
JP2006172437A (ja) データのストリームにおけるセグメント境界の位置の決定方法、データサブセットを近隣のデータサブセットと比較してセグメント境界を決定する方法、コンピュータによって実行可能な命令のプログラム、ならびにデータのストリームにおける境界及び非境界を識別するシステム又は装置
CN111126122B (zh) 人脸识别算法评估方法及装置
CN111144314B (zh) 一种篡改人脸视频检测方法
CN102176208A (zh) 基于三维空时特征的鲁棒视频指纹方法
CN108550166B (zh) 一种空间目标图像匹配方法
US20220189008A1 (en) Method for detecting data defects and computing device utilizing method
WO2022148378A1 (zh) 违规用户处理方法、装置及电子设备
Kraaij et al. Trecvid 2011 content-based copy detection: Task overview
CN111435445A (zh) 字符识别模型的训练方法及装置、字符识别方法及装置
CN114972771A (zh) 车辆定损理赔方法、装置、电子设备及存储介质
CN113971644A (zh) 基于数据增强策略选择的图像识别方法及装置
CN106557523B (zh) 代表性图像选择方法和设备以及对象图像检索方法和设备
CN109784291B (zh) 基于多尺度的卷积特征的行人检测方法
TWI803243B (zh) 圖像擴增方法、電腦設備及儲存介質
CN114384073B (zh) 一种地铁隧道裂纹检测方法及系统
CN115984178A (zh) 伪造图像检测方法、电子设备和计算机可读存储介质
US20210295478A1 (en) Method and apparatus for recognizing landmark in panoramic image and non-transitory computer-readable medium
WO2018035768A1 (zh) 一种候选框尺度的获取方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20932315

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 17914799

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20932315

Country of ref document: EP

Kind code of ref document: A1