A method, device and related components for setting boundary threshold of pedestrian re-identification matching

Through the automated threshold setting method, the pedestrian feature similarity score is calculated using the convolutional neural network model, and the threshold is determined based on the negative sample error rate, which solves the problem of threshold adjustment caused by environmental changes and improves the performance and efficiency of the pedestrian re-identification system.

CN112560787BActive Publication Date: 2024-11-22SHENYAN ARTIFICIAL INTELLIGENCE TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011577571.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-28
Publication Date
2024-11-22
Estimated Expiration
2040-12-28

AI Technical Summary

Technical Problem

In the prior art, the pedestrian re-identification system is inconvenient to set the threshold value when the environment changes, resulting in a degradation of performance and requires frequent adjustments, which increases production costs and manpower and material investment.

Method used

By obtaining multiple scenes with matching boundary thresholds to be set, pedestrian data is randomly collected, features are extracted using the convolutional neural network model, similarity scores are calculated, and matching boundary thresholds are determined based on negative sample error rates, to achieve automated threshold settings.

Benefits of technology

Without sample annotation, the accuracy and stability of the threshold value are ensured, the recognition rate of pedestrian re-identification is improved, and the frequency and cost of threshold adjustment are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112560787B_ABST
    Figure CN112560787B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and related components for setting a matching boundary threshold for pedestrian re-identification, the method comprising: obtaining multiple scenes for which matching boundary thresholds are to be set, and randomly collecting multiple pedestrian data for each scene; using a convolutional neural network model to extract features of the pedestrian data in each scene to obtain pedestrian features; calculating the similarity between multiple pedestrian features in each scene to obtain multiple similarity scores, and then sorting them according to the numerical values, and setting a corresponding similarity index number for each similarity score after sorting; for each scene, determining a target similarity index number according to a preset negative sample error rate and the number of similarity scores, and then using the similarity score corresponding to the target similarity index number as the matching boundary threshold for the corresponding scene. The present invention determines the final matching boundary threshold according to the negative sample error rate, which can effectively ensure the accuracy and stability of the matching boundary threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a method and device for setting a boundary threshold of pedestrian re-identification matching, and related components. Background Art

[0002] Object classification and recognition tasks, such as pedestrian re-identification, vehicle re-identification, face recognition, object classification, etc., have always been one of the hot research issues in computer vision. At present, the research on object classification and recognition tasks is often devoted to the research of training data, model structure, and objective function. In order to improve the performance of classification tasks, richer and higher-quality training data can be used, and massive high-quality data can quickly improve the performance of the model. In addition, more effective network structures can be mined and designed to improve the performance of classification tasks. In addition, using more effective objective function training models can also further improve model performance. For example, models such as softmax and center loss can obtain different network performances by training with different objective functions. At present, a lot of research has been carried out mainly from these three aspects (i.e., training data, network structure, and objective function), which greatly improves the performance of classification tasks. However, for an object classification application, in addition to improving the performance from the above three aspects, the selection and setting of thresholds have a great impact on the performance of the object classification system. Currently, the threshold setting is often based on experience, and the set threshold is affected by the application environment. When the application environment changes, such as lighting conditions, weather changes, and camera parameters change, the threshold needs to be constantly adjusted accordingly. However, each adjustment requires a lot of manpower, material resources and experience, which brings great trouble and inconvenience to the production process.

[0003] For classification tasks, especially pedestrian re-identification tasks, in the process of real-world application, it is necessary to perform pedestrian analysis and identification across multiple cameras to determine whether the pedestrians in different cameras are the same person. There are two types of pedestrian re-identification tasks. One is the recognition task, that is, for a pedestrian probe (query), it is necessary to find the corresponding pedestrian in the gallery (pedestrian full-body image database). If the probe is a stranger, that is, the gallery does not contain the identity of the probe, then there is no need to return the pedestrian result. The other is the verification task, that is, for pedestrians in two different cameras, it is necessary to determine whether the two pedestrians across cameras are the same pedestrian (positive sample pair) or different pedestrians (negative sample pair). For the two different tasks of recognition and verification, in real-world application, both need to be judged in combination with thresholds. For the recognition task, the probe matches the gallery and finds the pedestrian corresponding to rank-1 (ranked 1), but at this time it cannot be determined that the rank-1 pedestrian in the gallery is the same identity as the probe, because the probe is likely to be a stranger and its identity ID is not in the gallery. At this time, we need to combine the threshold boundary value for judgment. If the similarity score is greater than the threshold, it is judged as the same person; if the similarity score is less than the threshold, it is judged as a stranger. Therefore, the setting of the threshold is very important in pedestrian re-identification applications. If the threshold is set too large, the detection rate will be too low, that is, the system model is likely to judge positive samples as negative samples, or the probe is often misjudged as a stranger. If the threshold is set too small, the false detection rate will be too high, that is, the system model is likely to judge negative samples as positive samples, or strangers in the probe are often misjudged.

[0004] At present, thresholds are usually set based on manual experience, and the set thresholds are often not optimal. As environmental conditions change, such as lighting conditions, weather conditions, camera parameters, etc., the set thresholds are no longer applicable, resulting in poor application effects in real scenarios. At this time, a large amount of manpower and material resources must be invested in the research and setting of thresholds. The thresholds of classification tasks cannot be adjusted conveniently and intelligently, and threshold maintenance and revision are often required, resulting in excessively high production process costs. Summary of the invention

[0005] The embodiments of the present invention provide a method, device, computer equipment and storage medium for setting a boundary threshold for pedestrian re-identification matching, aiming to provide an accurate and stable threshold setting method.

[0006] In a first aspect, an embodiment of the present invention provides a method for setting a boundary threshold for pedestrian re-identification matching, comprising:

[0007] Obtain multiple scenes for which matching boundary thresholds are to be set, and randomly collect multiple pedestrian data for each scene;

[0008] The preset convolutional neural network model is used to extract features from multiple pedestrian data in each scene to obtain multiple pedestrian features in each scene;

[0009] Calculate the similarity between the multiple pedestrian features in each scene, obtain the corresponding multiple similarity scores, then sort the multiple similarity scores in each scene according to the numerical value, and set the corresponding similarity index number for each similarity score after sorting;

[0010] For each scene, a target similarity index number is determined according to a preset negative sample error rate and the number of similarity scores, and then the similarity score corresponding to the target similarity index number is used as the matching boundary threshold of the corresponding scene.

[0011] In a second aspect, an embodiment of the present invention provides a device for setting a boundary threshold for pedestrian re-identification matching, comprising:

[0012] A collection unit, used to obtain multiple scenes for which matching boundary thresholds are to be set, and randomly collect multiple pedestrian data for each scene;

[0013] A first extraction unit is used to extract features from a plurality of pedestrian data in each scene using a preset convolutional neural network model to obtain a plurality of pedestrian features in each scene;

[0014] A similarity unit is used to calculate the similarity between two of the multiple pedestrian features in each scene to obtain a corresponding multiple similarity scores, and then sort the multiple similarity scores in each scene according to the numerical value, and set a corresponding similarity index number for each similarity score after sorting;

[0015] The first determination unit is used to determine a target similarity index number for each scene according to a preset negative sample error rate and the number of similarity scores, and then use the similarity score corresponding to the target similarity index number as a matching boundary threshold of the corresponding scene.

[0016] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for setting the pedestrian re-identification matching boundary threshold as described in the first aspect is implemented.

[0017] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for setting the pedestrian re-identification matching boundary threshold as described in the first aspect is implemented.

[0018] The embodiment of the present invention provides a method, device, computer equipment and storage medium for setting a matching boundary threshold for pedestrian re-identification, the method comprising: obtaining multiple scenes for which matching boundary thresholds are to be set, and randomly collecting multiple pedestrian data for each scene; using a preset convolutional neural network model to extract features from multiple pedestrian data in each scene to obtain multiple pedestrian features in each scene; calculating the similarity between the multiple pedestrian features in each scene to obtain multiple corresponding similarity scores, and then sorting the multiple similarity scores in each scene according to the numerical value, and setting a corresponding similarity index number for each similarity score after sorting; for each scene, determining a target similarity index number according to a preset negative sample error rate and the number of similarity scores, and then using the similarity score corresponding to the target similarity index number as the matching boundary threshold of the corresponding scene. The embodiment of the present invention can determine the final matching boundary threshold only according to the preset negative sample error rate without labeling the samples, and can effectively ensure the accuracy and stability of the matching boundary threshold. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0020] Figure 1 A schematic diagram of a flow chart of a method for setting a boundary threshold for pedestrian re-identification matching provided by an embodiment of the present invention;

[0021] Figure 2 A specific example diagram of a method for setting a boundary threshold for pedestrian re-identification matching provided by an embodiment of the present invention;

[0022] Figure 3 A schematic block diagram of a device for setting a boundary threshold for pedestrian re-identification matching provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0025] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0026] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0027] See below Figure 1 , Figure 1 A flowchart of a method for setting a boundary threshold of pedestrian re-identification matching provided by an embodiment of the present invention specifically includes: steps S101 to S104.

[0028] S101, obtaining a plurality of scenes for which matching boundary thresholds are to be set, and randomly collecting a plurality of pedestrian data for each scene;

[0029] S102, using a preset convolutional neural network model to extract features from multiple pedestrian data in each scene to obtain multiple pedestrian features in each scene;

[0030] S103, calculating the similarity between two of the multiple pedestrian features in each scene to obtain multiple corresponding similarity scores, then sorting the multiple similarity scores in each scene according to the numerical values, and setting a corresponding similarity index number for each sorted similarity score;

[0031] S104 . For each scene, determine a target similarity index number according to a preset negative sample error rate and the number of similarity scores, and then use the similarity score corresponding to the target similarity index number as a matching boundary threshold of the corresponding scene.

[0032] In this embodiment, firstly, scenes 1, 2, ..., k for which matching boundary thresholds need to be set are determined, and for each scene, N1, N2, ..., N are randomly collected. kPedestrian data is collected randomly in each scene. It is only necessary to obtain pedestrian data without manual labeling. Pedestrian features are extracted from the pedestrian data in each scene, and then the similarity score is calculated for the pedestrian features, and a similarity index number is set for the similarity score. The negative sample error rate corresponding to each scene can be calculated based on the pedestrian data in each scene, and then the target similarity index number of the corresponding scene can be determined based on the negative sample error rate. The similarity score corresponding to the target similarity index number is the matching boundary threshold of the corresponding scene.

[0033] This embodiment is based on the scene adaptive threshold method, and sets the pedestrian re-identification matching threshold in a scene adaptive manner. It can achieve the effect of automatically setting a reasonable threshold for different scenes based only on the preset negative sample error rate without calibrating the acquired samples, and the acquired samples are identified and judged under the threshold, and the obtained system negative sample error rate is less than the negative sample error rate preset in this embodiment. In this way, the accuracy and stability of the matching boundary threshold can be effectively guaranteed, and the pedestrian re-identification recognition rate in different scenes can be greatly improved. It should be noted that the preset negative sample error rate described in this embodiment can be flexibly set according to different scenes. It should also be noted that the method for setting the pedestrian re-identification matching boundary threshold provided in this embodiment can be used not only for pedestrian re-identification tasks, but also for other classification tasks, such as vehicle re-identification, face recognition, facial expression recognition, action recognition, etc.

[0034] In one embodiment, before step S101, the following steps are included:

[0035] A preset convolutional neural network model is pre-trained using an image library containing different image categories until the objective function loss in the convolutional neural network model converges or the classification effect output by the convolutional neural network model meets the expected value.

[0036] In this embodiment, before obtaining multiple scenes for which matching boundary thresholds are to be set, a convolutional neural network model for extracting pedestrian re-identification features is first set. And the convolutional neural network model is pre-trained using an image library containing different image categories, so that the convolutional neural network model has functions such as image feature extraction and image classification. In a specific application scenario, the convolutional neural network model is pre-trained using the ImageNet image library (a large visualization database for visual object recognition software research). The ImageNet image library contains 1,000 image categories, which can be used to fully pre-train the convolutional neural network model.

[0037] In one embodiment, before step S101, the method further includes:

[0038] The data in the pedestrian re-identification database is used to optimize and update the pre-trained convolutional neural network model.

[0039] In this embodiment, after the convolutional neural network model has the functions of image feature extraction and image classification, the convolutional neural network model is further fine-tuned and optimized to improve the performance of the convolutional neural network model. Specifically, a pedestrian re-identification database is used to fine-tune and optimize the convolutional neural network model, wherein the pedestrian re-identification database can use CUHK03 database, Market-1501 database, MSMT17 database or DukeMTMC-reID database, etc. Preferably, the convolutional neural network model is fine-tuned and optimized using multiple different pedestrian re-identification databases, so that the convolutional neural network model can obtain a more robust pedestrian representation and improve the generalization ability of pedestrian re-identification.

[0040] In one embodiment, the step S102 includes:

[0041] Input each pedestrian data in each scene into the convolutional neural network model;

[0042] Performing preliminary feature extraction on each piece of pedestrian data using the first convolution layer in the convolutional neural network model to obtain a first feature matrix for each piece of pedestrian data;

[0043] Using a first pooling layer to perform pooling processing on the first feature matrix to obtain a first target matrix for each pedestrian data;

[0044] Inputting the first target matrix into a second convolutional layer, and outputting a second feature matrix by the second convolutional layer;

[0045] Using a second pooling layer to perform pooling processing on the second feature matrix to obtain a second target matrix;

[0046] The second target matrix is ​​classified and processed in sequence using the first fully connected layer and the second fully connected layer to obtain pedestrian features corresponding to each piece of pedestrian data in each scene.

[0047] In this embodiment, a convolutional neural network model that has been fine-tuned and optimized is used to extract pedestrian features from pedestrian data in each scene. Specifically, the pedestrian data is firstly subjected to preliminary feature extraction through the first convolutional layer, and then the feature matrix output by the convolutional layer is pooled through the first pooling layer, and then the first target matrix output by the first pooling layer is sequentially passed through the second convolutional layer and the second pooling layer to obtain the second target matrix, and then the second target matrix is ​​sequentially classified through the first fully connected layer and the second connected layer to obtain the corresponding pedestrian features. It should be noted that, in the process of obtaining pedestrian features, the pedestrian features can be output by the fully connected layer, or by the convolutional layer or the pooling layer, and this embodiment does not limit this. Of course, in other embodiments, a more complex convolutional neural network model can also be used to extract pedestrian features from pedestrian data.

[0048] In one embodiment, the step S103 includes:

[0049] Calculate the cosine similarity between any two pedestrian features in each scene and obtain the corresponding similarity score;

[0050] The number of similarity scores in each scene is determined by the arithmetic progression sum formula (N i ^2-N i ) / 2, where i is the i-th scene, N i The number of pedestrian features in the i-th scene;

[0051] Yes (N i ^2-N i ) / 2 similarity scores are sorted according to the numerical value, and (N i ^2-N i ) / 2 similarity index numbers.

[0052] In this embodiment, for each scene, all pedestrian features are first paired and combined, and each pedestrian feature can be paired and combined with all other pedestrian features, and then the similarity between the two pedestrian features in all combinations is calculated to obtain the corresponding similarity score. In this embodiment, the cosine similarity method is used to calculate the similarity score. In other embodiments, other similarity calculation methods can also be used to calculate the similarity score, such as using Euclidean distance to calculate the similarity score.

[0053] In each scene, the number of combinations of all pedestrian features after any pairing can be determined according to the arithmetic progression summation formula, that is, the number of similarity scores finally calculated, that is, (N i ^2-N i) / 2. For example, suppose in a scene, there are 4 pedestrian features, namely A, B, C, and D. The number of similarity scores that can be calculated using the above formula is (4 2 -4) / 2=6, and when verifying it, the pairing combinations that can be obtained are: AB, AC, AD, BC, BD, CD, a total of 6 combinations.

[0054] The similarity scores in each scene are sorted, for example, in order from large to small or from small to large, and a similarity index number is set for each similarity score in order after sorting, and the corresponding similarity score can be determined according to the similarity index number.

[0055] In one embodiment, the pair (N i ^2-N i ) / 2 similarity scores are sorted according to the numerical value, and (N i ^2-N i ) / 2 similarity index numbers, including:

[0056] Using the sorting algorithm (N i ^2-N i ) / 2 similarity scores are sorted in descending order.

[0057] In this embodiment, a sorting algorithm is used to sort all similarity scores in descending order, and a similarity index number is set for each similarity score in turn. The sorting algorithm described in this embodiment can be an insertion sorting algorithm, a selection sorting algorithm, or other sorting algorithms applicable to this embodiment.

[0058] In one embodiment, the step S104 includes:

[0059] Determine the target similarity index number in each scene according to the following formula:

[0060] idx=(err%*(N i ^2-N i ) / 2)

[0061] Where idx is the target similarity index in each scene, err% is the preset negative sample error rate in each scene, (N i ^2-N i ) / 2 is the number of similarity scores in each scene.

[0062] In this embodiment, the target similarity index number in each scene can be quickly obtained according to the calculation formula of the above-mentioned target similarity index number, and then the similarity index number that is the same as the target similarity index number is found in the sorted similarity scores. The similarity score corresponding to the similarity index number is the matching boundary threshold of the corresponding scene.

[0063] For example, assuming that there are 5 similarity scores in a scene, namely A, B, C, D, and E, and the corresponding similarity index numbers are 1001, 1002, 1003, 1004, and 1005, when the target similarity index number of the scene is 1003 calculated according to the above formula, it can be determined that the matching boundary threshold of the scene is C.

[0064] Preferably, after determining the matching boundary threshold of each scene, the sample pairs of pedestrian data in the scene (sample data after pedestrian features are combined in pairs) can also be judged according to the matching boundary threshold, that is, when the similarity of the sample pairs is greater than the matching boundary threshold, the sample pairs are judged as positive samples, and when the similarity of the sample pairs is less than the matching boundary threshold, the sample pairs are judged as negative samples. In addition, the negative sample in this embodiment means that the two pedestrians in the pedestrian data do not belong to the same person, and the positive sample means that the two pedestrians in the pedestrian data belong to the same person.

[0065] In a specific embodiment, assuming that in a scenario, the system negative sample error rate of the scenario can be calculated according to the following formula:

[0066] err%=FP / (FP+TN)

[0067] Where err% is the system negative sample error rate, TN is the number of samples pre-judged as negative samples, and FP is the number of negative samples pre-judged as positive samples.

[0068] At the same time, the scene contains c pedestrians, each of which contains h pictures. The number of positive samples calculated by the arithmetic progression sum formula is c(h^2-h) / 2, and the number of negative samples is ((c*h)^2-(c*h)) / 2-c(h^2-h) / 2. Then, the ratio between the number of negative samples and the number of positive samples is:

[0069]

[0070] It can be seen that the ratio of the number of negative samples to the number of positive samples is greater than c-1 times, where c is the number of categories (usually greater than 1), so the number of negative samples is much larger than the positive samples.

[0071] Therefore, when calculating the negative sample error rate, the result of the negative sample error rate calculated only using the negative sample set is approximately the same as the result of calculating the negative sample error rate by treating both positive and negative samples as negative samples. That is, the values of FP / (FP + TN) and FP / (FP + TN + TP + FP) are close. Here, TP refers to the number of positive samples predicted as positive samples by the model, TN refers to the number of negative samples predicted as negative samples by the model, FP refers to the number of negative samples predicted as positive samples by the model, and FN refers to the number of positive samples predicted as negative samples by the model.

[0072] Without loss of generality, given that the allowed negative sample error rate of the recognition system is err%, assuming that FN, TN, TP, and FP are obtained at the corresponding threshold T at this time, the number of samples greater than the threshold T is TP + FP (because it is considered a positive sample when greater than the threshold T, so it includes the correctly predicted positive samples TP and the samples FP that predict negative samples as positive samples). Then, according to the calculation of FP / (FN + TN + TP + FP), we can get: FP = err% * (FN + TN + TP + FP) = err% * (N^2 - N) / 2. Taking the calculation result as the target similarity index number, the estimated threshold t for this scenario can be obtained. Further, assuming that FN1, TN1, TP1, and FP1 are obtained at the threshold t, then TP1 + FP1 = FP < FP + TP. Therefore, the estimated threshold t is generally greater than the threshold T, and the negative sample error rate at the estimated threshold is generally less than the set threshold err%.

[0073] In another specific embodiment, as Figure 2 shown, based on the CUHK03 validation set of the pedestrian re-identification database, the allowed negative sample error rate of the system is set to 0.2%. The threshold 0.73 obtained according to the pedestrian re-identification matching boundary threshold setting method provided in this embodiment, and the threshold corresponding to the actual negative sample error rate of 0.2% of the system is 0.72. Therefore, the threshold finally obtained by the pedestrian re-identification matching boundary threshold setting method provided in this embodiment meets the requirement that the negative sample error rate is less than 0.2%.

[0074] Figure 3 The following is a schematic block diagram of a device 300 for setting the pedestrian re-identification matching boundary threshold provided by an embodiment of the present invention. The device 300 includes:

[0075] An acquisition unit 301, configured to obtain multiple scenarios for setting the matching boundary threshold, and randomly acquire multiple pieces of pedestrian data for each scenario respectively;

[0076] A first extraction unit 302, configured to extract features from the multiple pieces of pedestrian data in each scenario by using a preset convolutional neural network model, and obtain multiple pedestrian features in each scenario;

[0077] The similarity unit 303 is used to calculate the similarity between the multiple pedestrian features in each scene, obtain the corresponding multiple similarity scores, and then sort the multiple similarity scores in each scene according to the numerical value, and set a corresponding similarity index number for each similarity score after sorting;

[0078] The first determination unit 304 is used to determine a target similarity index number for each scene according to a preset negative sample error rate and the number of similarity scores, and then use the similarity score corresponding to the target similarity index number as a matching boundary threshold of the corresponding scene.

[0079] In one embodiment, the acquisition unit 301 includes:

[0080] A pre-training unit, used to pre-train a preset convolutional neural network model using an image library containing different image categories, until the objective function loss in the convolutional neural network model converges or the classification effect output by the convolutional neural network model meets the expected value;

[0081] In one embodiment, the acquisition unit 301 further includes:

[0082] The optimization and updating unit is used to optimize and update the pre-trained convolutional neural network model using the data in the pedestrian re-identification database.

[0083] In one embodiment, the first extraction unit 302 includes:

[0084] An input unit, used to input each pedestrian data in each scene into the convolutional neural network model;

[0085] A first convolution unit, used to perform preliminary feature extraction on each piece of pedestrian data using the first convolution layer in the convolutional neural network model to obtain a first feature matrix for each piece of pedestrian data;

[0086] A first pooling unit, configured to perform pooling processing on the first feature matrix using a first pooling layer to obtain a first target matrix for each piece of pedestrian data;

[0087] A second convolution unit, used for inputting the first target matrix into a second convolution layer, and outputting a second feature matrix by the second convolution layer;

[0088] A second pooling unit, configured to perform pooling processing on the second feature matrix using a second pooling layer to obtain a second target matrix;

[0089] The classification processing unit is used to classify the second target matrix using the first fully connected layer and the second fully connected layer in sequence to obtain pedestrian features corresponding to each pedestrian data in each scene.

[0090] In one embodiment, the similarity unit 303 includes:

[0091] A cosine calculation unit is used to calculate the cosine similarity between any two pedestrian features in each scene to obtain the corresponding similarity score;

[0092] The arithmetic summation unit is used to determine the number of similarity scores in each scene by using the arithmetic sequence summation formula (N i ^2-N i ) / 2, where i is the i-th scene, N i The number of pedestrian features in the i-th scene;

[0093] Setting unit for (N i ^2-N i ) / 2 similarity scores are sorted according to the numerical value, and (N i ^2-N i ) / 2 similarity index numbers.

[0094] In one embodiment, the setting unit includes:

[0095] Sorting unit, used to sort (N i ^2-N i ) / 2 similarity scores are sorted in descending order.

[0096] In one embodiment, the first determining unit 304 includes:

[0097] The second determining unit is used to determine the target similarity index number in each scene according to the following formula:

[0098] idx=(err%*(N i ^2-N i ) / 2)

[0099] Where idx is the target similarity index in each scene, err% is the negative sample error rate in each scene, (N i ^2-N i ) / 2 is the number of similarity scores in each scene.

[0100] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.

[0101] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0102] The embodiment of the present invention also provides a computer device, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps provided in the above embodiment may be implemented. Of course, the computer device may also include various network interfaces, power supplies and other components.

[0103] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of this application.

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

Claims

1. A method for setting the boundary threshold of pedestrian re-identification matching. It is characterized in that include: Obtain multiple scenes for which matching boundary thresholds are to be set, and randomly collect multiple pedestrian data for each scene; The preset convolutional neural network model is used to extract features from multiple pedestrian data in each scene to obtain multiple pedestrian features in each scene; Calculate the similarity between the multiple pedestrian features in each scene, obtain the corresponding multiple similarity scores, then sort the multiple similarity scores in each scene according to the numerical value, and set the corresponding similarity index number for each similarity score after sorting; For each scene, a target similarity index number is determined according to a preset negative sample error rate and the number of similarity scores, and then the similarity score corresponding to the target similarity index number is used as the matching boundary threshold of the corresponding scene; For each scene, a target similarity index number is determined according to a preset negative sample error rate and the number of similarity scores, and then a similarity score corresponding to a similarity index number identical to the target similarity index number is used as a matching boundary threshold of the corresponding scene, including: Determine the target similarity index number in each scene according to the following formula: idx=(err%*(N i ^2-N i ) / 2) Where idx is the target similarity index in each scene, err% is the negative sample error rate in each scene, N i is the number of pedestrian features in the i-th scene, (N i ^2-N i ) / 2 is the number of similarity scores in each scene.

2. The method for setting the boundary threshold of pedestrian re-identification matching according to claim 1, It is characterized in that The method of obtaining a plurality of scenes for which matching boundary thresholds are to be set and randomly collecting a plurality of pedestrian data for each scene includes: A preset convolutional neural network model is pre-trained using an image library containing different image categories until the objective function loss in the convolutional neural network model converges or the classification effect output by the convolutional neural network model meets the expected value.

3. The method for setting the boundary threshold of pedestrian re-identification matching according to claim 1, It is characterized in that Before obtaining a plurality of scenes for which matching boundary thresholds are to be set and randomly collecting a plurality of pedestrian data for each scene, the method further includes: The data in the pedestrian re-identification database is used to optimize and update the pre-trained convolutional neural network model.

4. The method for setting the boundary threshold of pedestrian re-identification matching according to claim 1, It is characterized in that The preset convolutional neural network model is used to extract features from multiple pedestrian data in each scene to obtain multiple pedestrian features in each scene, including: Input each pedestrian data in each scene into the convolutional neural network model; Performing preliminary feature extraction on each piece of pedestrian data using the first convolution layer in the convolutional neural network model to obtain a first feature matrix for each piece of pedestrian data; Using a first pooling layer to perform pooling processing on the first feature matrix to obtain a first target matrix for each pedestrian data; Inputting the first target matrix into a second convolutional layer, and outputting a second feature matrix by the second convolutional layer; Using a second pooling layer to perform pooling processing on the second feature matrix to obtain a second target matrix; The second target matrix is ​​classified and processed in sequence using the first fully connected layer and the second fully connected layer to obtain pedestrian features corresponding to each piece of pedestrian data in each scene.

5. The method for setting the boundary threshold of pedestrian re-identification matching according to claim 1, It is characterized in that The similarity calculation is performed between two or more pedestrian features in each scene to obtain corresponding multiple similarity scores, and then the multiple similarity scores in each scene are sorted according to the numerical value, and a corresponding similarity index number is set for each sorted similarity score, including: Calculate the cosine similarity between any two pedestrian features in each scene and obtain the corresponding similarity score; The number of similarity scores in each scene is determined by the arithmetic progression sum formula (N i ^2-N i ) / 2, where i is the i-th scene, N i is the number of pedestrian features in the i-th scene; Yes (N i ^2-N i ) / 2 similarity scores are sorted according to the numerical value, and (N i ^2-N i ) / 2 similarity index numbers.

6. The method for setting the boundary threshold of pedestrian re-identification matching according to claim 5, It is characterized in that The pair (N i ^2-N i ) / 2 similarity scores are sorted according to the numerical value, and (N i ^2-N i ) / 2 similarity index numbers, including: Using the sorting algorithm (N i ^2-N i ) / 2 similarity scores are sorted in descending order.

7. A device for setting a boundary threshold for pedestrian re-identification matching, It is characterized in that include: A collection unit, used to obtain multiple scenes for which matching boundary thresholds are to be set, and randomly collect multiple pedestrian data for each scene; A first extraction unit is used to extract features from a plurality of pedestrian data in each scene using a preset convolutional neural network model to obtain a plurality of pedestrian features in each scene; A similarity unit is used to calculate the similarity between two of the multiple pedestrian features in each scene to obtain a corresponding multiple similarity scores, and then sort the multiple similarity scores in each scene according to the numerical value, and set a corresponding similarity index number for each similarity score after sorting; A first determination unit is used to determine a target similarity index number for each scene according to a preset negative sample error rate and the number of similarity scores, and then use the similarity score corresponding to the target similarity index number as a matching boundary threshold of the corresponding scene; The first determining unit includes: The second determining unit is used to determine the target similarity index number in each scene according to the following formula: idx=(err%*(N i ^2-N i ) / 2) Where idx is the target similarity index in each scene, err% is the negative sample error rate in each scene, N i is the number of pedestrian features in the i-th scene, (N i ^2-N i ) / 2 is the number of similarity scores in each scene.

8. A computer device, It is characterized in that The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for setting the boundary threshold of pedestrian re-identification matching according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for setting a pedestrian re-identification matching boundary threshold according to any one of claims 1 to 6 is implemented.