Pedestrian re-identification feature extraction model construction method and device and pedestrian re-identification method and device
By clustering and constructing camera invariance data sets, the problem of excessive differences in sample characteristics between cameras in cross-domain pedestrian recognition is solved, and the accuracy and camera invariance of pedestrian recognition model are improved.
Patent Information
- Application Number
- CN202411775316.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-12-04
AI Technical Summary
In the cross-domain pedestrian re-identification task, the sample characteristics between cameras are too large due to different camera parameters, resulting in low accuracy of the pedestrian feature extraction model.
By obtaining the feature vectors of image samples of multiple different cameras, clustering is performed to form a clustering cluster, computing the camera change difference value, building a camera invariance data set, and using this data set to train feature extraction models to reduce the model's sensitivity to camera field of view changes.
The accuracy of the pedestrian re-identification model is improved, and the sensitivity to camera field of view is reduced, making the model pay more attention to changes in pedestrian identity than camera changes.
Smart Images

Figure CN119832589A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic technology, and in particular to the construction of a pedestrian re-identification feature extraction model and a pedestrian re-identification method and device. Background Art
[0002] As one of the important applications of image retrieval, the pedestrian re-identification task aims to retrieve a given target pedestrian image from images taken by a large number of non-overlapping cameras. As urban surveillance systems become increasingly sophisticated, pedestrian re-identification technology can quickly retrieve and locate individual pedestrians among a large number of surveillance images and accurately identify their identities. The advent of pedestrian re-identification technology provides a strong technical guarantee for various fields such as social security and intelligent transportation.
[0003] At present, the cross-domain pedestrian re-identification task is realized based on the clustering algorithm. For the model pre-trained in the source domain, the clustering algorithm is executed to assign pseudo labels as "identity information" to the target domain samples. The "identity information" is used to guide the fine-tuning and updating of the model in the target domain, so that the model adapts to the style of the target domain samples and obtains the pedestrian feature extraction model. The clustering-based method has stronger flexibility and generalization. Although the cross-domain pedestrian re-identification research has improved the model in adapting to different data domains, in addition to the impact of inter-domain differences on cross-domain models, the camera shift problem caused by different camera distributions in the same data domain also hinders the improvement of model performance. Camera shift causes the model to be more inclined to classify pedestrians of other identities from the same camera into the same identity rather than the same pedestrians from different cameras into the same identity during the reasoning process. Due to the large difference in sample features between cameras caused by different camera parameters in the cross-domain pedestrian re-identification task, the accuracy of the final pedestrian feature extraction model is low. Summary of the invention
[0004] In view of this, the present invention provides a pedestrian re-identification feature extraction model construction and a pedestrian re-identification method and device to solve the problem that the sample features between cameras are too different due to different camera parameters in the cross-domain pedestrian re-identification task, resulting in a low accuracy of the final pedestrian feature extraction model.
[0005] In a first aspect, the present invention provides a method for constructing a pedestrian re-identification feature extraction model, the method comprising: obtaining first feature vectors and second feature vectors corresponding to multiple image samples of multiple different cameras, the first feature vector being obtained by extracting features from the image samples corresponding to a pre-built first feature extraction model, and the second feature vector being obtained by extracting features from the image samples corresponding to a pre-built second feature extraction model; clustering multiple image sample data of each camera based on the first feature vectors of the multiple image samples of the camera to obtain multiple first clustering clusters corresponding to the camera; and globally clustering multiple image sample data of different cameras based on the first feature vectors of the multiple image samples corresponding to different cameras to obtain multiple second clusters. Clustering clusters, globally clustering multiple image sample data of different cameras based on the second feature vectors of multiple image samples corresponding to different cameras to obtain multiple third clustering clusters; calculating the camera change difference values between each first clustering cluster of each camera and each second clustering cluster and third clustering cluster; constructing a camera invariant data set based on at least one target first clustering cluster among the multiple first clustering clusters corresponding to different cameras, the target first clustering cluster is the first clustering cluster whose camera change difference value is greater than a preset threshold; using each image data and the corresponding feature vector in the camera invariant data set to train the first feature extraction model and the second feature extraction model respectively until the preset conditions are met to obtain a pedestrian re-identification feature extraction model.
[0006] The method for constructing a pedestrian re-identification feature extraction model provided by the present invention clusters multiple image sample data of each camera based on the first feature vector of multiple image samples of the camera to obtain multiple first clustering clusters of the corresponding camera; globally clusters multiple image sample data of different cameras based on the first feature vectors of multiple image samples corresponding to different cameras to obtain multiple second clustering clusters; globally clusters multiple image sample data of different cameras based on the second feature vectors of multiple image samples corresponding to different cameras to obtain multiple third clustering clusters; calculates the camera change difference value between each first clustering cluster of each camera and each second clustering cluster and third clustering cluster; constructs a camera invariant data set based on the first clustering cluster whose camera change difference value is less than a preset threshold; each image sample data in the constructed camera invariant data set is a sample that maintains camera invariance. By performing internal camera sample clustering to more fully explore the potential relationship between pedestrian identities, and by using internal camera sample clustering and overall sample clustering to associate the pedestrian identity information between many cameras, and then selecting samples that maintain camera invariance for the camera invariance learning of the model, the model's sensitivity to changes in the camera's field of view can be reduced, so that the pedestrian re-identification model pays more attention to changes in pedestrian identity rather than changes in the camera. This solves the problem in related technologies that the sample feature differences between cameras caused by different camera shooting angles, backgrounds, camera parameters, etc. are too large to mislead the model in identifying pedestrian identities.
[0007] In an optional embodiment, the step of obtaining first feature vectors and second feature vectors corresponding to multiple image samples of multiple different cameras includes: obtaining multiple image samples corresponding to multiple different cameras, a pre-constructed first feature extraction model and a second feature extraction model; inputting the multiple image samples of each camera into the first feature extraction model and the second feature extraction model, so that the first feature extraction model outputs the first feature vector corresponding to each image sample of the camera; inputting the multiple image samples of each camera into the second feature extraction model, and the second feature extraction model outputs the second feature vector corresponding to each image sample of the camera.
[0008] In an optional embodiment, the first feature extraction model and the second feature extraction model are constructed by the following steps: obtaining a source domain data set; dividing the source domain data set to obtain a first training set and a second training set; using the first training set to train the first preset model until the prediction accuracy of the model meets the first preset requirement, thereby obtaining a first feature extraction model; using the second training set to train the second preset model until the prediction accuracy of the model meets the second preset requirement, thereby obtaining a second feature extraction model.
[0009] In an optional embodiment, the first feature extraction model and the second feature extraction model are trained respectively using each image data and the corresponding feature vector in the camera invariant dataset until a preset condition is met, and the step of obtaining a pedestrian re-identification feature extraction model includes: dividing the camera invariant dataset into a third training set and a fourth training set based on the camera identification of each image sample in the camera invariant dataset; training the first feature extraction model using the third training set to obtain a third feature model; training the second feature model using the third training set to obtain a fourth feature model; training the third feature model using the fourth training set until the model loss converges to obtain a fifth feature model; training the fourth feature model using the fourth training set until the model loss converges to obtain a sixth feature model; using the fifth feature model and / or the sixth feature model as a pedestrian re-identification feature extraction model.
[0010] In a second aspect, the present invention provides a pedestrian re-identification method, the method comprising: obtaining image data to be identified and a pedestrian re-identification feature extraction model, the pedestrian re-identification feature extraction model being constructed by the pedestrian re-identification feature extraction model construction method of the first aspect or any corresponding embodiment thereof; inputting the image data to be identified into the pedestrian re-identification feature extraction model so that the pedestrian re-identification feature extraction model outputs a feature vector of the image data to be identified; comparing the feature vector of the image data to be identified with feature vectors corresponding to different identities in a pre-constructed database to obtain a comparison result; and determining the pedestrian re-identification result in the image data to be identified based on the comparison result.
[0011] The pedestrian re-identification method provided by the present invention utilizes a pedestrian re-identification feature extraction model to extract feature vectors from image data to be identified. The pedestrian re-identification feature extraction model pays more attention to changes in pedestrian identities rather than changes in cameras, and solves the problem in related technologies that the pedestrian re-identification task involves different camera shooting angles, backgrounds, camera parameters and other factors, resulting in excessive differences in sample features between cameras that mislead the model to identify pedestrian identities. The pedestrian re-identification feature extraction model can be used to accurately extract feature vectors from image data to be identified, thereby effectively improving the accuracy of pedestrian re-identification.
[0012] In a third aspect, the present invention provides a device for constructing a pedestrian re-identification feature extraction model, which includes: a first acquisition module, used to obtain first feature vectors and second feature vectors corresponding to multiple image samples of multiple different cameras, the first feature vector is obtained by extracting features from the image samples corresponding to a pre-built first feature extraction model, and the second feature vector is obtained by extracting features from the image samples corresponding to a pre-built second feature extraction model; a first clustering module, used to cluster multiple image sample data of each camera based on the first feature vectors of the multiple image samples of the camera, to obtain multiple first clustering clusters of the corresponding camera; a second clustering module, used to globally cluster multiple image sample data of different cameras based on the first feature vectors of the multiple image samples corresponding to different cameras, to obtain multiple A second clustering cluster is formed, and multiple image sample data of different cameras are globally clustered based on the second feature vectors of the multiple image samples corresponding to different cameras to obtain multiple third clustering clusters; a calculation module is used to calculate the camera change difference value between each first clustering cluster of each camera and each second clustering cluster and the third clustering cluster; a construction module is used to construct a camera invariance data set based on at least one target first clustering cluster in the multiple first clustering clusters corresponding to different cameras, and the target first clustering cluster is the first clustering cluster whose camera change difference value is greater than a preset threshold; a training module is used to use each image data and the corresponding feature vector in the camera invariance data set to train the first feature extraction model and the second feature extraction model respectively until the preset conditions are met to obtain a pedestrian re-identification feature extraction model.
[0013] In a fourth aspect, the present invention provides a pedestrian re-identification device, which includes: a second acquisition module, used to acquire image data to be identified and a pedestrian re-identification feature extraction model, the pedestrian re-identification feature extraction model is constructed by the pedestrian re-identification feature extraction model construction method of the above-mentioned first aspect or any corresponding embodiment; a first determination module, used to input the image data to be identified into the pedestrian re-identification feature extraction model, so that the pedestrian re-identification feature extraction model outputs a feature vector of the image data to be identified; a comparison module, used to compare the feature vector of the image data to be identified with the feature vectors corresponding to different identities in a pre-constructed database to obtain a comparison result; a second determination module, used to determine the pedestrian re-identification result in the image data to be identified based on the comparison result.
[0014] In a fifth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the pedestrian re-identification feature extraction model construction method of the above-mentioned first aspect or any corresponding embodiment thereof, or executes the pedestrian re-identification method of the above-mentioned second aspect by executing the computer instructions.
[0015] In a sixth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the pedestrian re-identification feature extraction model construction method of the above-mentioned first aspect or any corresponding embodiment thereof, or to execute the pedestrian re-identification method of the above-mentioned second aspect.
[0016] In a seventh aspect, the present invention provides a computer program product comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the pedestrian re-identification feature extraction model construction method of the first aspect or any corresponding embodiment thereof, or to execute the pedestrian re-identification method of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 is a flow chart of a method for constructing a pedestrian re-identification feature extraction model according to an embodiment of the present invention;
[0019] Figure 2 is a schematic diagram of a specific example of constructing a camera invariant data set in an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of another specific example of constructing a camera invariant data set in an embodiment of the present application;
[0021] Figure 4 is a flow chart of another method for constructing a person re-identification feature extraction model according to an embodiment of the present invention;
[0022] Figure 5 is a flow chart of another method for constructing a person re-identification feature extraction model according to an embodiment of the present invention;
[0023] Figure 6 is a schematic diagram of a specific example of a method for constructing a pedestrian re-identification feature extraction model in an embodiment of the present application;
[0024] Figure 7 is a schematic flow chart of a pedestrian re-identification method according to an embodiment of the present invention;
[0025] Figure 8 is a structural block diagram of a device for constructing a pedestrian re-identification feature extraction model according to an embodiment of the present invention;
[0026] Fig. 9 is a structural block diagram of a pedestrian re-identification device according to an embodiment of the present invention;
[0027] Fig.10 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0029] In the related art, the cross-domain pedestrian re-identification task is implemented based on the clustering algorithm. For the model pre-trained in the source domain, the clustering algorithm is executed to assign pseudo labels as "identity information" to the target domain samples. The "identity information" is used to guide the fine-tuning and updating of the model in the target domain, so that the model adapts to the style of the target domain samples and obtains the pedestrian feature extraction model. The clustering-based method has stronger flexibility and generalization. Although the cross-domain pedestrian re-identification research has improved the model in adapting to different data domains, in addition to the impact of inter-domain differences on cross-domain models, the camera shift problem caused by different camera distributions in the same data domain also hinders the improvement of model performance. Camera shift causes the model to be more inclined to classify pedestrians of other identities from the same camera into the same identity rather than the same pedestrians from different cameras into the same identity during the reasoning process. Due to the large difference in sample features between cameras caused by different camera parameters in the cross-domain pedestrian re-identification task, the accuracy of the pedestrian feature extraction model obtained is low.
[0030] In view of this, a method for constructing a pedestrian re-identification feature extraction model provided in an embodiment of the present application can be applied to a server to realize the construction of a pedestrian re-identification feature extraction model. The method provided by the present invention more fully explores the potential relationship between pedestrian identities by performing internal camera sample clustering, and associates the pedestrian identity information between many cameras through internal camera sample clustering and overall sample clustering, and then selects samples that maintain camera invariance for camera invariance learning of the model, which can reduce the sensitivity of the model to changes in the camera's field of view, so that the pedestrian re-identification model pays more attention to changes in pedestrian identity rather than changes in the camera, and solves the problem in the related art that the sample feature differences between cameras caused by different camera shooting angles, backgrounds, camera parameters and other factors are too large to mislead the model to identify pedestrian identities.
[0031] According to an embodiment of the present invention, an embodiment of a method for constructing a pedestrian re-identification feature extraction model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0032] In this embodiment, a method for constructing a pedestrian re-identification feature extraction model is provided, which can be used in the above-mentioned server. Figure 1 is a flow chart of a method for extracting a pedestrian re-identification feature model according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0033] Step S101, obtaining first feature vectors and second feature vectors corresponding to multiple image samples of multiple different cameras respectively, wherein the first feature vector is obtained by extracting features from the image samples based on a pre-built first feature extraction model, and the second feature vector is obtained by extracting features from the image samples based on a pre-built second feature extraction model.
[0034] Exemplarily, the feature vector is used to characterize the identity features of pedestrians in the image sample. The first feature extraction model and the second feature extraction model are obtained by training based on the source domain training set samples. In the embodiment of the present application, a plurality of different cameras correspond to the image samples captured by different cameras of the plurality of image samples. The first feature extraction model is obtained by training the backbone network F, and the second feature extraction model is obtained by training the backbone network G. In this embodiment, the source domain training set samples are divided into the training set T f and T g They are used for pre-training of two backbone networks F and G respectively, giving the backbone networks excellent feature extraction capabilities while ensuring that the respective feature encoders pay different attention to the features.
[0035] Step S102 : clustering the multiple image sample data of each camera based on the first feature vectors of the multiple image samples of the camera to obtain multiple first clustering groups corresponding to the camera.
[0036] For example, in the embodiment of the present application, a plurality of different cameras corresponding to a plurality of image samples can also be referred to as a target domain dataset S. Assuming that the number of cameras covered in the target domain dataset S is P, the backbone network F is used to collect the image samples of each camera P. i After extracting the feature vector, the sample is clustered once and a pseudo label is assigned to the sample according to the clustering result. Finally, we get a dataset with labels for each camera. Each camera It includes multiple first clustering clusters, the identities of pedestrians in image samples in different first clustering clusters are different, and the identities of pedestrians in image samples in the same first clustering cluster are the same. Performing camera internal sample clustering can alleviate the problem of pedestrians with the same identity being divided into different clusters.
[0037] Step S103, globally clustering multiple image sample data from different cameras based on the first feature vectors of the multiple image samples respectively corresponding to different cameras to obtain multiple second clustering clusters, and globally clustering multiple image sample data from different cameras based on the second feature vectors of the multiple image samples respectively corresponding to different cameras to obtain multiple third clustering clusters.
[0038] Exemplarily, in the embodiment of the present application, global clustering is performed on all samples based on the first feature vectors of all image samples, and a pseudo label y is assigned to the sample according to the clustering result. f , obtain a dataset D with all samples labeled f , dataset D f There are multiple second clustering clusters in , and the pedestrian identities in the image samples in different second clustering clusters are different, and the pedestrian identities in the image samples in the same second clustering cluster are the same. Perform global clustering on all samples based on the second feature vectors of all image samples, and assign pseudo labels y to the samples according to the clustering results g , obtain a dataset D with all samples labeled g For subsequent camera invariant sample set selection, dataset D g It includes multiple third clustering clusters, the identities of pedestrians in image samples in different third clustering clusters are different, and the identities of pedestrians in image samples in the same third clustering cluster are the same.
[0039] Step S104 : calculating the camera change difference value between each first clustering group and each second clustering group and third clustering group of each camera.
[0040] Exemplarily, in the embodiment of the present application, the camera change difference values between each first clustering group and each second clustering group and third clustering group of each camera are calculated by the following steps:
[0041] Based on three pseudo-labeled datasets D from different feature spaces camera , D f and D g , based on the clustering results of different feature spaces, diversity information is provided to calculate the camera change differences between clusters:
[0042]
[0043] in, Indicates that the camera P iThe sample set from cluster J in the internal clustering process, represents the sample set from cluster K during the overall sample clustering process of encoder F, represents the sample set from cluster L in the overall sample clustering process of encoder G, represents the number of samples in the set obtained by the intersection operation, represents the number of samples in the set obtained by the union operation, Represents camera P i The sample set of cluster J and and The camera change difference between .
[0044] Step S105 , constructing a camera invariance data set based on at least one target first clustering cluster among a plurality of first clustering clusters corresponding to different cameras, wherein the target first clustering cluster is a first clustering cluster whose camera change difference value is greater than a preset threshold.
[0045] For example, in the embodiment of the present application, the inter-cluster camera variation difference of each cluster after clustering the samples within each camera is calculated one by one, and the image sample set with a variation difference less than a preset threshold is calculated. Add to the camera invariant dataset D invariant Used for subsequent model updates:
[0046]
[0047] Among them, threshold represents the threshold of camera change difference between clusters, D invariant Represents the dataset used for model training later. The process of merging datasets is as follows: Figure 2 As shown, cluster A is the cluster corresponding to the image sample set with a change difference less than the preset threshold, and samples that maintain a high degree of camera invariance are continuously incorporated into D invariant In. Figure 3 As shown in the figure, cluster B is the cluster corresponding to the image sample set with a change difference greater than the preset threshold. Clusters with a change difference greater than the preset threshold are not incorporated into the camera invariance dataset. As the training process continues, the camera change difference between clusters of different clusters continues to decrease, and more and more clusters generated by intra-camera clustering will be included in the dataset D. invariant Used for model optimization.
[0048] Step S106, using each image data and the corresponding feature vector in the camera invariant data set to train the first feature extraction model and the second feature extraction model respectively until the preset conditions are met, thereby obtaining a pedestrian re-identification feature extraction model.
[0049] Exemplarily, in an embodiment of the present application, the first feature extraction model and the second feature extraction model are trained respectively using each image data and the corresponding feature vector in the camera invariant data set until the training losses of the first feature extraction model and the second feature extraction model converge, and the first feature extraction model and / or the second feature extraction model are used as pedestrian re-identification feature extraction models.
[0050] The method for constructing a pedestrian re-identification feature extraction model provided in this embodiment more fully explores the potential relationship between pedestrian identities by performing internal camera sample clustering, and associates the pedestrian identity information between many cameras through internal camera sample clustering and overall sample clustering, and then selects samples that maintain camera invariance for camera invariance learning of the model. This can reduce the sensitivity of the model to changes in the camera's field of view, so that the pedestrian re-identification model pays more attention to changes in pedestrian identity rather than changes in the camera, and solves the problem in related technologies that the sample feature differences between cameras involved in the pedestrian re-identification task are too large, resulting in different camera shooting angles, backgrounds, camera parameters and other factors, which misleads the model to identify pedestrian identities.
[0051] In this embodiment, a method for constructing a pedestrian re-identification feature extraction model is provided, which can be used in the above-mentioned server. Figure 4 is a flow chart of a method for constructing a pedestrian re-identification feature extraction model according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0052] Step S401, obtaining first feature vectors and second feature vectors corresponding to multiple image samples of multiple different cameras respectively, wherein the first feature vector is obtained by extracting features from the image samples based on a pre-built first feature extraction model, and the second feature vector is obtained by extracting features from the image samples based on a pre-built second feature extraction model.
[0053] Specifically, the above step S401 includes:
[0054] Step S4011, obtaining a plurality of image samples corresponding to a plurality of different cameras, a pre-built first feature extraction model, and a second feature extraction model.
[0055] In some optional implementations, the first feature extraction model and the second feature extraction model are constructed by the following steps:
[0056] Step a1, obtaining a source domain dataset. Exemplarily, in the embodiment of the present application, the source domain dataset is a dataset including a plurality of pedestrian images and labels corresponding to each pedestrian image.
[0057] Step a2: divide the source domain dataset to obtain a first training set and a second training set. For example, in the embodiment of the present application, the source domain dataset with known labels is divided into two training sets T with similar total sample numbers. f , T g They are used as training samples for collaborative networks F and G respectively.
[0058] Step a3: Use the first training set to train the first preset model until the prediction accuracy of the model meets the first preset requirement, thereby obtaining a first feature extraction model.
[0059] Step a4: Use the second training set to train the second preset model until the prediction accuracy of the model meets the second preset requirement, thereby obtaining a second feature extraction model.
[0060] For example, based on the training set T f and T g Samples of, respectively calculate the triplet loss of backbone network F, G in their respective training sets and
[0061]
[0062] in and are the feature representations of the anchor box samples in encoders F and G, respectively. and is the feature representation of the anchor box difficult positive sample in encoder F and G, and represents the feature representation of the anchor box difficult negative sample in encoder F and G, E(*,*) is the Euclidean distance between feature vectors, m is the edge coefficient, and D f and D g is the number of samples in a batch. Similarly, calculate the identity loss of the backbone network F and G and
[0063]
[0064] Among them, y a,i is the true identity of the sample, P(y a,i |f(x a,i )) is the prediction of model F that the sample belongs to category y a,i The probability, P(y a,i |g(x a,i )) is the prediction of model G that the sample belongs to category y a,i The probability of . Obtain the overall loss of the model in the source domain training and update the model:
[0065]
[0066]
[0067] in, is the source domain loss of encoder F, is the source domain loss of encoder G. The backbone network is updated according to the respective loss function values, and F and G after source domain training are used for fine-tuning of the target domain dataset.
[0068] Step S4012: input multiple image samples of each camera into the first feature extraction model and the second feature extraction model, so that the first feature extraction model outputs a first feature vector corresponding to each image sample of the camera.
[0069] For example, in the embodiment of the present application, the first feature extraction model is used to extract the first feature of each camera P in the target domain dataset S. i The feature vectors are extracted from the image samples to obtain the first feature vectors of the corresponding image samples.
[0070] Step S4013: input multiple image samples of each camera into a second feature extraction model, and the second feature extraction model outputs a second feature vector corresponding to each image sample of the camera.
[0071] Exemplarily, in the embodiment of the present application, a second feature extraction model is used to extract features from samples in the target domain data set S to obtain a second feature vector corresponding to each image sample of each camera.
[0072] Step S402: cluster multiple image sample data of each camera based on the first feature vector of multiple image samples of the camera to obtain multiple first clusters of the corresponding camera. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0073] Step S403, based on the first feature vectors of the multiple image samples corresponding to the different cameras, the multiple image sample data of the different cameras are globally clustered to obtain multiple second clustering clusters, and based on the second feature vectors of the multiple image samples corresponding to the different cameras, the multiple image sample data of the different cameras are globally clustered to obtain multiple third clustering clusters. For details, please refer to Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0074] Step S404, calculating the camera change difference value between each first clustering group and each second clustering group and third clustering group of each camera. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0075] Step S405: construct a camera invariance dataset based on at least one target first cluster among the multiple first clusters corresponding to different cameras, where the target first cluster is a first cluster whose camera change difference value is greater than a preset threshold. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.
[0076] Step S406: Use the image data and the corresponding feature vectors in the camera invariant data set to train the first feature extraction model and the second feature extraction model respectively until the preset conditions are met to obtain a pedestrian re-identification feature extraction model. Figure 1 Step S106 of the illustrated embodiment will not be described in detail here.
[0077] In this embodiment, a method for constructing a pedestrian re-identification feature extraction model is provided, which can be used in the above-mentioned server. Figure 5 is a flow chart of a method for constructing a pedestrian re-identification feature extraction model according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:
[0078] Step S501, obtaining first feature vectors and second feature vectors corresponding to multiple image samples from multiple different cameras, wherein the first feature vector is obtained by extracting features from the image samples based on a pre-built first feature extraction model, and the second feature vector is obtained by extracting features from the image samples based on a pre-built second feature extraction model. Figure 4 Step S401 of the illustrated embodiment will not be described in detail here.
[0079] Step S502: cluster multiple image sample data of each camera based on the first feature vector of multiple image samples of the camera to obtain multiple first clusters of the corresponding camera. Figure 2 Step S402 of the illustrated embodiment will not be described in detail here.
[0080] Step S503: Globally cluster multiple image sample data from different cameras based on the first feature vectors of multiple image samples corresponding to different cameras to obtain multiple second clustering clusters, and globally cluster multiple image sample data from different cameras based on the second feature vectors of multiple image samples corresponding to different cameras to obtain multiple third clustering clusters. Figure 4 Step S403 of the illustrated embodiment will not be described in detail here.
[0081] Step S504: Calculate the camera change difference value between each first clustering group and each second clustering group and third clustering group of each camera. Figure 4 Step S404 of the illustrated embodiment will not be described in detail here.
[0082] Step S505: construct a camera invariance dataset based on at least one target first cluster among the multiple first clusters corresponding to different cameras, where the target first cluster is a first cluster whose camera change difference value is greater than a preset threshold. Figure 4 Step S405 of the illustrated embodiment will not be described in detail here.
[0083] Step S506, using each image data and the corresponding feature vector in the camera invariant data set to train the first feature extraction model and the second feature extraction model respectively until the preset conditions are met, thereby obtaining a pedestrian re-identification feature extraction model.
[0084] Specifically, the above step S506 includes:
[0085] Step S5061: divide the camera invariant dataset into a third training set and a fourth training set based on the camera identifier of each image sample in the camera invariant dataset.
[0086] For example, in the embodiment of the present application, based on the camera invariant dataset D invariant The dataset is divided into the first training set again according to the camera number With the secondary training set Used for actual training samples in a round of iterative training. is the third training set, This is the fourth training set.
[0087] Step S5062: Use the third training set to train the first feature extraction model to obtain a third feature model.
[0088] Step S5063: Use the third training set to train the second feature model to obtain a fourth feature model.
[0089] For example, in the embodiment of the present application, the first feature extraction model and the second feature extraction model correspond to parameter model parameters θ and ω respectively, and the first feature extraction model and the second feature extraction model are calculated based on the third training data set. The training loss and
[0090]
[0091] in, It represents the centroid contrast loss. Taking the backbone network F as an example, the calculation method is:
[0092]
[0093] where f iis the feature representation of the anchor box, f p is the feature representation of the centroid of the cluster to which the anchor box belongs, f j is the feature representation of all cluster centroids, γ cen is the temperature coefficient, N image is the number of samples in a batch, N class is the number of categories. Represents the sample contrast loss, which is calculated as:
[0094]
[0095] Among them, N positive is the number of negative samples of anchor boxes, γ ins is the temperature coefficient. After calculating the first training loss, the network F and G are temporarily updated, and the updated temporary model parameters are expressed as f θ′ , g ω′ .f θ′ is the model parameter of the third characteristic model, g ω′ are the model parameters of the fourth characteristic model.
[0096] Step S5064: Use the fourth training set to train the third feature model until the model loss converges to obtain the fifth feature model.
[0097] Step S5065, train the fourth feature model using the fourth training set until the model loss reaches convergence, and obtain the sixth feature model.
[0098] For example, in the embodiment of the present application, the secondary training set The image samples are input into the third feature model and the fourth feature model respectively, and the secondary training loss of the two network models is calculated:
[0099]
[0100] in, represents the secondary training loss of the backbone network F, Represents the secondary training loss of the backbone network G. The first training loss and the secondary training loss are used together for the back propagation and parameter update of the original parameters θ and ω of the model:
[0101]
[0102] in, and represents the initial training loss, and represents the quadratic training loss. Finally, through the chain rule, according to and The parameters after numerically updating the original model parameters θ and ω are used as the initial parameters for the next round of training.
[0103] Step S5066: Use the fifth feature model and / or the sixth feature model as a pedestrian re-identification feature extraction model.
[0104] Exemplarily, in an embodiment of the present application, after the model loss reaches convergence, the fifth characteristic model is selected as the backbone network for final inference.
[0105] The method for constructing a pedestrian re-identification feature extraction model provided by the present invention is described in detail below through a specific embodiment.
[0106] The model construction method provided in the embodiment of the present application can be constructed as follows: Figure 6 As shown, the following steps are included:
[0107] (1) Collaborative network source domain pre-training, dividing the source domain training set samples into training set T f and T g They are used for pre-training of two backbone networks F and G respectively, giving the backbone networks excellent feature extraction capabilities while ensuring that the respective feature encoders pay different attention to features;
[0108] (2) Clustering of samples within the camera and clustering of samples overall. First, according to the camera number, network F is used to cluster samples of each camera P. i Perform an intra-camera clustering on the samples and assign pseudo labels Then use the backbone network F to perform a clustering of the overall samples and assign pseudo labels y f Finally, the backbone network G is used to perform a clustering of the overall samples and assign pseudo labels y g ;
[0109] (3) Evaluation of inter-cluster camera differences, based on the camera internal clustering results y camera , overall sample clustering result y f and g Calculate the differences in camera distribution between different clusters. For cluster samples with lower differences, build a camera invariant sample dataset for model training. For cluster samples with higher differences, they will be used for subsequent loss calculation and model update as training progresses.
[0110] (4) Camera invariance learning: The data set obtained in step (3) is divided according to the camera number, the initial training loss of the model is calculated to update the temporary parameters, and then the secondary loss value is calculated based on the temporary parameters for the final update of the model. After the loss value converges, the model is used to complete the pedestrian re-identification task.
[0111] The method provided in the embodiment of the present application has the following beneficial effects:
[0112] a. In-camera sample clustering: Since the samples for each clustering are from the same camera, they are not restricted by camera migration caused by camera field of view and parameter issues, and they focus more on the comparison of distinctive features between different pedestrians. In-camera sample clustering can alleviate the problem of pedestrians with the same identity being divided into different clusters. In addition, it can also prevent pedestrians with different identities from being divided into the same cluster. Compared with overall sample clustering, it has higher accuracy and provides more informative auxiliary clues for subsequent overall sample clustering to guide subsequent overall sample clustering.
[0113] b. Different source domain pre-training samples give different learning capabilities to the two backbone networks. During the model update process, the collaborative network ensures the parameter difference between the two networks according to their respective loss update strategies. The different clustering results obtained by the different model parameters ensure the invariance of the selected samples in the camera distribution. The internal sample clustering of the camera and the overall sample clustering of the two backbone networks come from three different feature spaces. The difference in camera changes between clusters is evaluated by comparing the cluster similarities of the three different feature spaces to evaluate whether the clusters of the internal sample clustering of the camera have higher camera invariance to select high-confidence samples for subsequent training, thereby alleviating the continuous accumulation of pseudo-label noise during training. Compared with the single feature extraction network, the design of the dual collaborative network structure also reduces the impact of the fitting noise instance problem of the traditional single feature extraction network on model training.
[0114] c. The strategy of updating the original model parameters by calculating the secondary training loss of the model based on temporary parameters. The camera invariant dataset is split and different camera samples are used for training in the two training processes to promote the model's learning of the camera invariant features of the samples. When the model's temporary parameters are fitted to the camera samples of the first training, an excessively large secondary training loss value can suppress the model's tendency to favor the camera samples of the first training, and instead shift the learning focus to the camera-independent features of the samples, thereby preventing the final model from being affected more by camera changes than identity changes.
[0115] In this embodiment, a pedestrian re-identification method is provided, which can be used in a server to realize pedestrian identity recognition. Figure 7 is a flow chart of a method for constructing a pedestrian re-identification feature extraction model according to an embodiment of the present invention. Figure 7 As shown, the process includes the following steps:
[0116] Step S701 , obtaining image data to be identified and a pedestrian re-identification feature extraction model, wherein the pedestrian re-identification feature extraction model is constructed by the pedestrian re-identification feature extraction model construction method of the above embodiment.
[0117] For example, the image data to be identified may be any image data that needs to be used for pedestrian identification. The specific content of the pedestrian re-identification feature extraction model is described in the above embodiment, and will not be repeated here.
[0118] Step S702: input the image data to be identified into a pedestrian re-identification feature extraction model, so that the pedestrian re-identification feature extraction model outputs a feature vector of the image data to be identified.
[0119] Exemplarily, the feature vector of the image data to be identified is used to characterize the identity features of the pedestrian in the image to be identified.
[0120] Step S703 , comparing the feature vector of the image data to be identified with the feature vectors corresponding to different identities in the pre-built database to obtain a comparison result.
[0121] Exemplarily, a pre-constructed database contains feature vectors corresponding to different pedestrian identities. By calculating the similarity between the feature vector of the image data to be identified and the feature vectors corresponding to each pedestrian identity in the database, the similarity between the feature vector of the image data to be identified and the feature vectors corresponding to different pedestrian identities is used as the comparison result.
[0122] Step S704: determining a pedestrian re-identification result in the image data to be identified based on the comparison result.
[0123] Exemplarily, in an embodiment of the present application, a target sample in a database having the highest similarity to a feature vector of the image data to be identified is determined, and the target sample is used as a pedestrian re-identification result of the image data to be identified.
[0124] The pedestrian re-identification method provided in the embodiment of the present application utilizes a pedestrian re-identification feature extraction model to extract feature vectors from image data to be identified. The pedestrian re-identification feature extraction model pays more attention to changes in pedestrian identity rather than changes in the camera, and solves the problem in the related technology that the pedestrian re-identification task involves different camera shooting angles, backgrounds, camera parameters and other factors, resulting in excessive differences in sample features between cameras that mislead the model to identify the pedestrian identity. The pedestrian re-identification feature extraction model can be used to accurately extract feature vectors of image data to be identified, thereby effectively improving the accuracy of pedestrian re-identification.
[0125] In this embodiment, a pedestrian re-identification feature extraction model construction device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0126] This embodiment provides a pedestrian re-identification feature extraction model construction device, such as Figure 8 As shown, including:
[0127] A first acquisition module 801 is used to acquire first feature vectors and second feature vectors corresponding to a plurality of image samples from a plurality of different cameras, respectively, wherein the first feature vectors are obtained by extracting features from the image samples based on a pre-built first feature extraction model, and the second feature vectors are obtained by extracting features from the image samples based on a pre-built second feature extraction model;
[0128] A first clustering module 802 is used to cluster the multiple image sample data of each camera based on the first feature vector of the multiple image samples of the camera to obtain multiple first clustering clusters corresponding to the camera;
[0129] A second clustering module 803 is used to globally cluster multiple image sample data of different cameras based on the first feature vectors of the multiple image samples respectively corresponding to the different cameras to obtain multiple second clustering clusters, and to globally cluster multiple image sample data of different cameras based on the second feature vectors of the multiple image samples respectively corresponding to the different cameras to obtain multiple third clustering clusters;
[0130] A calculation module 804 is used to calculate the camera change difference value between each first clustering group and each second clustering group and third clustering group of each camera;
[0131] A construction module 805 is used to construct a camera invariance data set based on at least one target first clustering cluster among a plurality of first clustering clusters corresponding to different cameras, wherein the target first clustering cluster is a first clustering cluster whose camera change difference value is greater than a preset threshold;
[0132] The training module 806 is used to train the first feature extraction model and the second feature extraction model respectively using each image data and the corresponding feature vector in the camera invariant data set until the preset conditions are met to obtain a pedestrian re-identification feature extraction model.
[0133] In some optional implementations, the first acquisition module 801 includes:
[0134] An acquisition submodule, used to acquire a plurality of image samples corresponding to a plurality of different cameras, a pre-built first feature extraction model and a second feature extraction model;
[0135] A first determination submodule, used for inputting a plurality of image samples of each camera into a first feature extraction model and a second feature extraction model, so that the first feature extraction model outputs a first feature vector corresponding to each image sample of the camera;
[0136] The second determination submodule is used to input multiple image samples of each camera into a second feature extraction model, and the second feature extraction model outputs a second feature vector corresponding to each image sample of the camera.
[0137] In some optional implementations, the first feature extraction model and the second feature extraction model are constructed by the following steps:
[0138] Obtain source domain dataset;
[0139] Divide the source domain data set to obtain a first training set and a second training set;
[0140] Using the first training set to train the first preset model until the prediction accuracy of the model meets the first preset requirement, thereby obtaining a first feature extraction model;
[0141] The second preset model is trained using the second training set until the prediction accuracy of the model meets the second preset requirement, thereby obtaining a second feature extraction model.
[0142] In some optional implementations, the training module 806 includes:
[0143] A division submodule, used for dividing the camera invariant dataset into a third training set and a fourth training set based on a camera identifier of each image sample of the camera invariant dataset;
[0144] A first training submodule is used to train the first feature extraction model using a third training set to obtain a third feature model;
[0145] A second training submodule is used to train the second feature model using the third training set to obtain a fourth feature model;
[0146] A third training submodule is used to train the third feature model using the fourth training set until the model loss reaches convergence, thereby obtaining a fifth feature model;
[0147] A fourth determination submodule is used to train the fourth feature model using the fourth training set until the model loss reaches convergence, thereby obtaining a sixth feature model;
[0148] The third determination submodule is used to use the fifth feature model and / or the sixth feature model as a pedestrian re-identification feature extraction model.
[0149] In this embodiment, a pedestrian re-identification device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0150] This embodiment provides a pedestrian re-identification feature extraction model construction device, such as Fig. 9 As shown, including:
[0151] The second acquisition module 901 is used to acquire the image data to be identified and the pedestrian re-identification feature extraction model, where the pedestrian re-identification feature extraction model is constructed by the pedestrian re-identification feature extraction model construction method in the above embodiment;
[0152] A first determination module 902 is used to input the image data to be identified into the pedestrian re-identification feature extraction model, so that the pedestrian re-identification feature extraction model outputs a feature vector of the image data to be identified;
[0153] A comparison module 903 is used to compare the feature vector of the image data to be identified with the feature vectors corresponding to different identities in the pre-built database to obtain a comparison result;
[0154] The second determination module 904 is used to determine the pedestrian re-identification result in the image data to be identified based on the comparison result.
[0155] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0156] The pedestrian re-identification feature extraction model building device and the pedestrian re-identification device in this embodiment are presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0157] The embodiment of the present invention also provides a computer device having the above Figure 8 The pedestrian re-identification feature extraction model building device shown in the figure, or having the above Fig. 9 The pedestrian re-identification device shown.
[0158] See also Fig.10 , Fig.10 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.10As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.10 A processor 10 is taken as an example.
[0159] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0160] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0161] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0162] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0163] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0164] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0165] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0166] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for constructing a pedestrian re-identification feature extraction model, characterized in that: The method comprises: Acquire first feature vectors and second feature vectors corresponding to a plurality of image samples from a plurality of different cameras, respectively, wherein the first feature vectors are obtained by extracting features from the image samples based on a pre-built first feature extraction model, and the second feature vectors are obtained by extracting features from the image samples based on a pre-built second feature extraction model; Clustering the plurality of image sample data of each camera based on the first feature vectors of the plurality of image samples of the camera to obtain a plurality of first clustering clusters corresponding to the camera; Based on the first feature vectors of the multiple image samples respectively corresponding to the different cameras, the multiple image sample data of the different cameras are globally clustered to obtain multiple second clustering clusters; based on the second feature vectors of the multiple image samples respectively corresponding to the different cameras, the multiple image sample data of the different cameras are globally clustered to obtain multiple third clustering clusters; Calculating camera change difference values between each first clustering cluster and each second clustering cluster and third clustering cluster of each camera; Building a camera invariance data set based on at least one target first clustering cluster among a plurality of first clustering clusters corresponding to different cameras, wherein the target first clustering cluster is a first clustering cluster whose camera change difference value is greater than a preset threshold; The first feature extraction model and the second feature extraction model are trained respectively using each image data and the corresponding feature vector in the camera invariant data set until a preset condition is met to obtain a pedestrian re-identification feature extraction model.
2. The method according to claim 1, characterized in that The step of obtaining first feature vectors and second feature vectors corresponding to a plurality of image samples from a plurality of different cameras respectively comprises: Acquire a plurality of image samples corresponding to a plurality of different cameras, a pre-built first feature extraction model and a second feature extraction model; Inputting a plurality of image samples of each camera into a first feature extraction model and a second feature extraction model, so that the first feature extraction model outputs a first feature vector corresponding to each image sample of the camera; A plurality of image samples of each camera are input into a second feature extraction model, and the second feature extraction model outputs a second feature vector corresponding to each image sample of the camera.
3. The method according to claim 1, characterized in that The first feature extraction model and the second feature extraction model are constructed by the following steps: Obtain source domain dataset; Dividing the source domain data set to obtain a first training set and a second training set; Using the first training set to train the first preset model until the prediction accuracy of the model meets the first preset requirement, thereby obtaining a first feature extraction model; The second preset model is trained using the second training set until the prediction accuracy of the model meets the second preset requirement, thereby obtaining a second feature extraction model.
4. The method according to claim 3, characterized in that The step of respectively training the first feature extraction model and the second feature extraction model using each image data and the corresponding feature vector in the camera invariant data set until a preset condition is met to obtain a pedestrian re-identification feature extraction model comprises: Dividing the camera invariant dataset into a third training set and a fourth training set based on a camera identifier of each image sample of the camera invariant dataset; Using a third training set to train the first feature extraction model to obtain a third feature model; Using the third training set to train the second feature model, to obtain a fourth feature model; The third feature model is trained using the fourth training set until the model loss reaches convergence, thereby obtaining the fifth feature model; The fourth feature model is trained using the fourth training set until the model loss reaches convergence, thereby obtaining a sixth feature model; The fifth feature model and / or the sixth feature model is used as the pedestrian re-identification feature extraction model.
5. A pedestrian re-identification method, characterized in that: The method comprises: Acquire image data to be identified and a pedestrian re-identification feature extraction model, wherein the pedestrian re-identification feature extraction model is constructed by the pedestrian re-identification feature extraction model construction method according to any one of claims 1 to 4; Inputting the image data to be identified into the pedestrian re-identification feature extraction model so that the pedestrian re-identification feature extraction model outputs a feature vector of the image data to be identified; Comparing the feature vector of the image data to be identified with the feature vectors corresponding to different identities in a pre-built database to obtain a comparison result; A pedestrian re-identification result in the image data to be identified is determined based on the comparison result.
6. A pedestrian re-identification feature extraction model construction device, characterized in that: The device comprises: A first acquisition module is used to acquire first feature vectors and second feature vectors corresponding to a plurality of image samples from a plurality of different cameras, respectively, wherein the first feature vectors are obtained by extracting features from the image samples based on a pre-built first feature extraction model, and the second feature vectors are obtained by extracting features from the image samples based on a pre-built second feature extraction model; A first clustering module, used for clustering a plurality of image sample data of each camera based on a first feature vector of a plurality of image samples of the camera, to obtain a plurality of first clustering clusters corresponding to the camera; A second clustering module is used to globally cluster multiple image sample data of different cameras based on the first feature vectors of the multiple image samples respectively corresponding to the different cameras to obtain multiple second clustering clusters, and to globally cluster multiple image sample data of different cameras based on the second feature vectors of the multiple image samples respectively corresponding to the different cameras to obtain multiple third clustering clusters; A calculation module, used for calculating the camera change difference value between each first clustering cluster and each second clustering cluster and third clustering cluster of each camera; A construction module, configured to construct a camera invariance data set based on at least one target first clustering cluster among a plurality of first clustering clusters corresponding to different cameras, wherein the target first clustering cluster is a first clustering cluster whose camera change difference value is greater than a preset threshold; The training module is used to train the first feature extraction model and the second feature extraction model respectively using each image data and the corresponding feature vector in the camera invariant data set until the preset conditions are met to obtain a pedestrian re-identification feature extraction model.
7. A pedestrian re-identification device, characterized in that: The device comprises: A second acquisition module, used to acquire image data to be identified and a pedestrian re-identification feature extraction model, wherein the pedestrian re-identification feature extraction model is constructed by the pedestrian re-identification feature extraction model construction method according to any one of claims 1 to 4; A first determination module, configured to input the image data to be identified into the pedestrian re-identification feature extraction model, so that the pedestrian re-identification feature extraction model outputs a feature vector of the image data to be identified; A comparison module, used to compare the feature vector of the image data to be identified with the feature vectors corresponding to different identities in a pre-built database to obtain a comparison result; The second determination module is used to determine the pedestrian re-identification result in the image data to be identified based on the comparison result.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for constructing a pedestrian re-identification feature extraction model according to any one of claims 1 to 4, or executes the pedestrian re-identification method according to claim 5 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the pedestrian re-identification feature extraction model construction method described in any one of claims 1 to 4, or to execute the pedestrian re-identification method described in claim 5.
10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the method for constructing a pedestrian re-identification feature extraction model according to any one of claims 1 to 4, or to execute the method for pedestrian re-identification according to claim 5.
Citation Information
Patent Citations
Moving object re-identification and model training method and device thereof, and storage medium
CN113515995A
Unsupervised domain adaptive pedestrian re-identification method based on camera perception and deep learning
CN115578746A
Unsupervised cross-modal pedestrian re-identification method
CN116229510A
Self-adaptive teacher-student structure-based unsupervised domain pedestrian re-identification method and system
CN116935447A
Method for establishing unsupervised cross-domain pedestrian re-recognition model based on attention mechanism and related device
CN117710788A