CN110472499B - Pedestrian re-identification method and device - Google Patents

Pedestrian re-identification method and device Download PDF

Info

Publication number
CN110472499B
CN110472499B CN201910616632.3A CN201910616632A CN110472499B CN 110472499 B CN110472499 B CN 110472499B CN 201910616632 A CN201910616632 A CN 201910616632A CN 110472499 B CN110472499 B CN 110472499B
Authority
CN
China
Prior art keywords
threshold
model
similarity score
sample
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910616632.3A
Other languages
Chinese (zh)
Other versions
CN110472499A (en
Inventor
戴磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910616632.3A priority Critical patent/CN110472499B/en
Publication of CN110472499A publication Critical patent/CN110472499A/en
Application granted granted Critical
Publication of CN110472499B publication Critical patent/CN110472499B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/103Static body considered as a whole, e.g. static pedestrian or occupant recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)
  • Traffic Control Systems (AREA)

Abstract

The invention discloses a pedestrian re-identification method and device, relates to the technical field of data processing, and aims to solve the problem that in the prior art, the workload of a service party is increased when a service party changes an identification model. The method mainly comprises the following steps: establishing a threshold mapping relation table according to a preset recognition model; obtaining a sample to be detected, wherein the sample to be detected comprises two images to be identified; selecting a target recognition model from the preset recognition models according to preset recognition rules; calculating the model similarity score of the sample to be detected according to the target identification model; converting the model similarity score into a standard similarity score according to a threshold relation conversion formula and the threshold mapping relation table; and judging whether the two images in the sample to be detected are the same pedestrian image or not according to the standard similarity score. The pedestrian re-identification method and device are mainly applied to the pedestrian re-identification process.

Description

Pedestrian re-identification method and device
Technical Field
The invention relates to the technical field of data processing, in particular to a pedestrian re-identification method and device.
Background
Pedestrian re-recognition refers to a technique of determining whether a particular pedestrian is present in an image or video sequence. In the prior art, a feature vector to be identified of an image or a video sequence is calculated through an identification model, and then pedestrian re-identification is performed according to the similarity of the feature vector to be identified and the feature vector of a specific pedestrian.
In a re-identification (re-id) system, a back-end service system (abbreviated as a service party) for re-identification of a pedestrian and a front-end service system (abbreviated as a service party) for calling the service party to realize re-identification of the pedestrian are generally included. When the pedestrian re-identification system is applied, the service party sends two images containing pedestrians to the service party, the service party returns a similarity score to the service party, and the service party judges whether the pedestrians in the two images are the same person according to the threshold value set by the service party. For example, if the service side uses the identification model a, the similarity score has a value range of [0,1], when the service side sets the threshold to 0.5, the negative sample error rate can reach 0.01%, whereas after the service side changes the identification model to the model B, the similarity score has a value range of [10,20], when the service side sets the threshold to 14, the negative sample error rate can reach 0.01%, at this time, if the service side continues to set the threshold to 0.5, the similarity score of all samples is greater than 0.5, which results in 100% negative sample error rate.
The similarity scores obtained by comparing the same two pedestrian images by using different recognition models are different, and the value ranges of the similarity scores are also different. If the model is modified each time in order to ensure the same comparison accuracy, the service party needs to reset the threshold according to the modified model, so that the workload of the service party is increased.
Disclosure of Invention
In view of the above, the present invention provides a method and apparatus for re-identifying pedestrians, which mainly aims to solve the problem of increasing the workload of a service party when a service party changes an identification model in the prior art.
According to one aspect of the present invention, there is provided a method of pedestrian re-recognition, comprising:
according to preset identification models, a threshold mapping relation table is established, wherein the number of the preset identification models is at least 1, and the threshold mapping relation table comprises a standard threshold, an actual threshold and a negative sample error rate/positive sample passing rate;
obtaining a sample to be detected, wherein the sample to be detected comprises two images to be identified;
selecting a target recognition model from the preset recognition models according to preset recognition rules;
calculating the model similarity score of the sample to be detected according to the target identification model;
converting the model similarity score into a standard similarity score according to a threshold relation conversion formula and the threshold mapping relation table;
and judging whether the two images in the sample to be detected are the same pedestrian image or not according to the standard similarity score.
According to another aspect of the present invention, there is provided an apparatus for pedestrian re-recognition, comprising:
the system comprises a building module, a threshold mapping relation table, a judging module and a judging module, wherein the building module is used for building a threshold mapping relation table according to preset identification models, the number of the preset identification models is at least 1, and the threshold mapping relation table comprises a standard threshold, an actual threshold and a negative sample error rate/positive sample passing rate;
the acquisition module is used for acquiring a sample to be detected, wherein the sample to be detected contains two images to be identified;
the selecting module is used for selecting a target recognition model from the preset recognition models according to preset recognition rules;
the calculation module is used for calculating the model similarity score of the sample to be detected according to the target identification model;
the conversion module is used for converting the model similarity score into a standard similarity score according to a threshold relation conversion formula and the threshold mapping relation table;
and the judging module is used for judging whether the two images in the sample to be detected are the same pedestrian image according to the standard similarity score.
According to still another aspect of the present invention, there is provided a storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the above-described pedestrian re-recognition method.
According to still another aspect of the present invention, there is provided a computer apparatus including: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the pedestrian re-identification method.
By means of the technical scheme, the technical scheme provided by the embodiment of the invention has at least the following advantages:
the invention provides a pedestrian re-recognition method and device, which comprises the steps of firstly establishing a threshold mapping relation table according to a preset recognition model, then obtaining a sample to be detected, selecting a target recognition model from the preset recognition model according to a preset recognition rule, calculating a model similarity score of the sample to be detected according to the target recognition model, converting the model similarity score into a standard similarity score according to a threshold relation conversion formula and the threshold mapping relation table, and finally judging whether two images in the sample to be detected are identical pedestrian images according to the standard similarity score. Compared with the prior art, the embodiment of the invention converts the model similarity score into the standard similarity score through the threshold mapping relation table, so that the negative sample error rate/positive sample passing rate corresponding to the same standard similarity score is the same, and the service side can achieve the same recognition accuracy without changing the threshold according to the service side to update the recognition model, thereby realizing the update of the recognition model by the service side and simultaneously not increasing the workload of the service side.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 shows a flow chart of a method for pedestrian re-identification provided by an embodiment of the invention;
FIG. 2 is a flowchart of another method for pedestrian re-recognition provided by an embodiment of the present invention;
FIG. 3 shows a block diagram of a pedestrian re-recognition apparatus according to an embodiment of the present invention;
FIG. 4 is a block diagram showing another apparatus for pedestrian re-recognition according to an embodiment of the present invention;
fig. 5 shows a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In a re-identification (re-id) system, a back-end service system (abbreviated as a service party) for re-identification of a pedestrian and a front-end service system (abbreviated as a service party) for calling the service party to realize re-identification of the pedestrian are generally included. When the pedestrian re-identification system is applied, the service party sends two images containing pedestrians to the service party, the service party returns a similarity score to the service party, and the service party judges whether the pedestrians in the two images are the same person according to the threshold value set by the service party. The embodiment of the invention provides a pedestrian re-identification method, which is applied to a server as shown in fig. 1, and comprises the following steps:
101. and establishing a threshold mapping relation table according to a preset identification model.
The number of the preset identification models is at least 1, and the threshold mapping relation table comprises a standard threshold, an actual threshold and a negative sample error rate/positive sample passing rate. The standard threshold and the negative sample error rate/positive sample passing rate are a list of data, the value range of the standard threshold can be 0-1, a plurality of values are selected in the value range to jointly form a standard threshold set, and the data in the standard threshold set are arranged in order from small to large. Negative sample error rate/positive sample pass rate is configured for each value in the set of standard thresholds. The number of columns of the actual threshold in the threshold mapping relation table is the same as the number of the preset recognition models, and the numerical value of each row in the actual threshold is the actual threshold which can reach the negative sample error rate/positive sample passing rate by calculating the similarity score of each sample in the sample library by using the preset recognition models. The sample library is a test set which is used when the precision of a preset recognition model is tested and comprises m positive samples and n negative samples, each positive sample comprises two pedestrian images belonging to the same person, and each negative sample comprises two pedestrian images not belonging to the same person.
The threshold mapping relation table taking the negative sample error rate as a reference is used for presetting a recognition model comprising a model A and a model B, assuming that a test set S comprises m positive samples and n negative samples, and the established threshold mapping relation table is as follows:
standard threshold value Negative sample error rate Actual threshold (model A) Actual threshold (model B)
0 100% tA0 tB0
0.2 10% tA1 tB1
0.3 1% tA2 tB2
0.4 0.1% tA3 tB3
0.5 0.01% tA4 tB4
0.6 0.001% tA5 tB5
0.7 0.0001% tA6 tB6
0.8 0.00001% tA7 tB7
1 0 tA8 tB8
Taking tA2 as an example, a similarity score is calculated for each sample in S by the model a, if a threshold t is set, a positive sample number m0 and a negative sample number n0 greater than t are counted, and a value tA2 is calculated when the ratio of n0 to n is approximately equal to 1%. Since the number of negative samples in S is limited, it is often impossible to obtain a value exactly equal to 1% when calculating the ratio, so a value approximately equal to 1% is taken. The required actual thresholds tA0 to tA8 and the corresponding actual thresholds tB0 to tB8 of the model B are determined in a similar manner.
102. And obtaining a sample to be tested.
The service side receives a sample to be detected uploaded by the service side, wherein the sample to be detected contains two images to be identified.
103. And selecting a target recognition model from the preset recognition models according to preset recognition rules.
The preset recognition rule can be that a corresponding target recognition model is selected according to a recognition scene uploaded by a service party, and the target recognition model can also be selected according to a sample to be detected. The recognition scenes can be criminals, old people and children, and for different recognition scenes, if criminals are recognized, the situation that the criminals can change wearing, add accessories and other camouflage in the escaping process is considered, so that the target recognition model needs to take characteristics which are not easy to change, such as physique, face and the like, as main recognition basis so as to reduce the possibility of omission; if the lost old people are identified, the possibility of changing clothing accessories in the lost process of the old people is considered to be small, so that the target identification model screens clothing colors, and screens characteristics of the screened images such as body forms and faces so as to ensure the screening speed. Since the sample to be tested may be a certificate photograph, a living photograph or a video screenshot, two images in the sample to be tested may be photographs of two different types, and pedestrian features which can be extracted in the two images are different, only common pedestrian features which can be extracted by both images can be used as recognition basis.
Before selecting the target recognition model, setting a mapping relation table of a recognition scene and a preset recognition model or a mapping relation table of a recognition basis and a preset recognition model in a server. And then selecting a target recognition model according to the recognition scene uploaded by the service party or the recognition basis of the sample to be detected.
104. And calculating the model similarity score of the sample to be detected according to the target identification model.
The model similarity score of the sample to be measured refers to calculating the similarity of two images in the sample to be measured. When the similarity score is calculated, the calculation is performed according to the target recognition model, and the images in the sample to be detected can be compared in the target recognition model by adopting a histogram matching method, a matrix decomposition method or a characteristic point-based method.
105. And converting the model similarity score into a standard similarity score according to a threshold relation conversion formula and the threshold mapping relation table.
The threshold relation conversion formula is used for converting the model similarity score into a standard similarity score according to a threshold mapping relation table. In the calculation process, firstly, determining an actual threshold value corresponding to a target recognition model in a threshold value mapping relation table, then determining an actual threshold value range in which a similarity score is located, namely 2 data closest to the model similarity score in the actual threshold value in the threshold value mapping relation table, searching a standard threshold value range corresponding to the actual threshold value range, wherein the standard threshold value range is similar to the actual threshold value range, and finally calculating the standard similarity score according to a standard threshold value range, the actual threshold value range and the model similarity score and a threshold value relation conversion formula.
106. And judging whether the two images in the sample to be detected are the same pedestrian image or not according to the standard similarity score.
After receiving the standard similarity score, the business side judges that two images in the sample to be detected are the same pedestrian image if the standard similarity score is larger than a set threshold value of a user; if the standard similarity score is not greater than the set threshold value of the user, judging that the two images in the sample to be detected are not identical pedestrian images. The set threshold value is equivalent to a standard threshold value in the threshold value mapping relation table, and when the set threshold value is unchanged, the negative sample error rate/positive sample passing rate of the judging result of the sample to be tested is kept unchanged even if the target identification models used by the service side are different.
The invention provides a pedestrian re-recognition method, which comprises the steps of firstly establishing a threshold mapping relation table according to a preset recognition model, then obtaining a sample to be detected, selecting a target recognition model from the preset recognition model according to a preset recognition rule, calculating a model similarity score of the sample to be detected according to the target recognition model, converting the model similarity score into a standard similarity score according to a threshold relation conversion formula and the threshold mapping relation table, and finally judging whether two images in the sample to be detected are identical pedestrian images according to the standard similarity score. Compared with the prior art, the embodiment of the invention converts the model similarity score into the standard similarity score through the threshold mapping relation table, so that the negative sample error rate/positive sample passing rate corresponding to the same standard similarity score is the same, and the service side can achieve the same recognition accuracy without changing the threshold according to the service side to update the recognition model, thereby realizing the update of the recognition model by the service side and simultaneously not increasing the workload of the service side.
The embodiment of the invention provides another pedestrian re-identification method, as shown in fig. 2, which comprises the following steps:
201. and dividing the preset full sample into at least one sub-sample according to the identification scene, wherein the sub-sample corresponds to the identification scene one by one.
The identification scene comprises the identification of criminals, the identification of lost old people, the identification of lost children and the like, and the preset full sample is divided into sub-samples corresponding to the identification scene according to different identification scenes, such as the escape and lost old people belong to different sub-samples.
202. Training a preset recognition model which is the same as the recognition scene corresponding to the subsamples according to the subsamples.
Searching for an identification scene corresponding to the subsamples, searching for a corresponding preset identification model according to the identification scene, and training different preset identification models by adopting the subsamples corresponding to the identification scene. By way of example, training model A with an escape sub-sample would be more advantageous for distinguishing between different escapers, realizing a true correspondence between model A and the recognition scenario for recognizing an escape, and training model B with the same missing senior sub-sample would be more advantageous for distinguishing between different seniors. In the training process, the model A and the model B can achieve real-time training on the smaller calculation cost, so that the real-time training and the calculation cost are balanced.
203. And establishing a threshold mapping relation table according to a preset identification model.
The number of the preset recognition models is at least 1, and the threshold mapping relation table comprises a standard threshold, an actual threshold and a negative sample error rate/positive sample passing rate. The specific establishment process comprises the following steps: calculating the standard threshold value according to a preset step length in a preset value range; configuring a negative sample error rate/positive sample passing rate corresponding to the standard threshold; calculating an actual threshold value corresponding to the negative sample error rate/positive sample passing rate reached by the preset recognition model according to a preset sample library; and generating the threshold mapping relation table according to the standard threshold, the actual threshold and the negative sample error rate/the positive sample passing rate.
The value range of the preset value range can be 0-1, the preset step length can be 0.1, a plurality of values are selected in the preset value range according to the preset step length to jointly form a standard threshold value set, and data in the standard threshold value set are arranged according to the sequence from small to large. The threshold mapping relation table taking the positive sample passing rate as a reference is used for presetting a recognition model comprising a model A and a model B, assuming that a test set S comprises m positive samples and n negative samples, and the established threshold mapping relation table is as follows:
standard threshold value Positive sample pass rate Actual threshold (model A) Actual threshold (model B)
0 100% tA0 tB0
0.1 90% tA1 tB1
0.2 80% tA2 tB2
0.3 70% tA3 tB3
0.4 60% tA4 tB4
0.5 50% tA5 tB5
0.6 40% tA6 tB6
0.7 30% tA7 tB7
0.8 20% tA8 tB8
0.9 10% tA9 tB9
1 0 tA10 tB10
Taking tA2 as an example, a similarity score is calculated for each sample in S by the model a, if a threshold t is set, a positive sample number m0 and a negative sample number n0 greater than t are counted, and a value tA2 is calculated when the ratio of m0 to m is approximately equal to 80%. Since the number of negative samples in S is limited, it is often impossible to obtain a value exactly equal to 80% when calculating the ratio, so a value approximately equal to 80% is taken. The required actual thresholds tA0 to tA8 and the corresponding actual thresholds tB0 to tB8 of the model B are determined in a similar manner.
Before the threshold mapping relation table is established, whether the business side uses a certain recognition model to carry out pedestrian re-recognition is further required to be judged, if the judgment result is yes, the actual threshold of the recognition model which is used last time is used as a standard threshold in the preset mapping relation table, so that the business side user does not need to reset the threshold according to a new recognition model, and the workload of the business side user is reduced to the greatest extent. If the judgment result is negative, setting a standard threshold value in the threshold value mapping relation table for the purpose of convenient calculation.
In view of the fact that the pedestrian re-recognition model is continuously improved during use and that it is also possible to invent a new recognition model, it is possible to use the improved recognition model or the new recognition model at the service side after establishing the threshold map. Aiming at the situation, an updating channel of a preset identification model is set at a service side, if an updating instruction of the preset identification model is received, according to a preset sample library, the updating identification model corresponding to the updating instruction is calculated to reach an updating actual threshold corresponding to the negative sample error rate/the positive sample passing rate; and storing the updated actual threshold value into the threshold value mapping relation table.
When updating the threshold mapping relation table, the actual threshold corresponding to the abandoned recognition model can be deleted, and if all the service parties in use abandon the recognition model, the actual threshold corresponding to the abandoned model is deleted again.
204. And obtaining a sample to be tested.
The service side receives a sample to be detected uploaded by the service side, wherein the sample to be detected contains two images to be identified.
205. And selecting a target recognition model from the preset recognition models according to preset recognition rules.
The preset recognition rule can be that a corresponding target recognition model is selected according to a recognition scene uploaded by a service party, and the target recognition model can also be selected according to a sample to be detected. The method for selecting the target recognition model according to the recognition scene specifically comprises the following steps: acquiring a scene application comparison table of the preset recognition model and the recognition scene; and searching a target recognition model corresponding to the preselected recognition scene in the scene application comparison table. The preselected identification scene can be uploaded by a business party, and can also be selected according to sample characteristics of a sample to be detected.
206. And calculating the model similarity score of the sample to be detected according to the target identification model.
The Euclidean distance and the cosine similarity are both measurement methods of vector distance, the Euclidean distance needs to consider both the direction of the vector and the length of the vector, and the cosine similarity only considers the direction, so the calculated amount of the cosine similarity is small, and the model similarity score is the cosine similarity between two images in a sample to be measured.
207. And converting the model similarity score into a standard similarity score according to a threshold relation conversion formula and the threshold mapping relation table.
The conversion method of the standard similarity score specifically comprises the following steps: searching an actual threshold corresponding to the target recognition model in the threshold mapping relation table; extracting an actual threshold range of the model similarity score in an actual threshold corresponding to the target recognition model; extracting the mark corresponding to the actual threshold rangeA quasi-threshold range; calculating a standard similarity score corresponding to the model similarity score according to the threshold relation conversion formula, the standard threshold range and the actual threshold range, wherein the threshold relation conversion formula is as followsWherein s' is the standard similarity score, s is the model similarity score, t - T being the lower boundary in the actual threshold range to which the model similarity score belongs + S being the upper boundary in the actual threshold range to which the model similarity score belongs - Is equal to t - Lower boundary in corresponding standard threshold range, s + Is equal to t + The upper boundary in the corresponding standard threshold range.
By way of example, assuming that the actual threshold range for the model similarity score s is tA 3-tA 4, the corresponding standard threshold range is 0.3-0.4, the standard threshold range substitutes s into the formula,and calculating a standard similarity score corresponding to the model similarity score.
208. And judging whether the two images in the sample to be detected are the same pedestrian image or not according to the standard similarity score.
After receiving the standard similarity score, the business side judges that two images in the sample to be detected are the same pedestrian image if the standard similarity score is larger than a set threshold value of a user; if the standard similarity score is not greater than the set threshold value of the user, judging that the two images in the sample to be detected are not identical pedestrian images. The set threshold value is equivalent to a standard threshold value in the threshold value mapping relation table, and when the set threshold value is unchanged, the negative sample error rate/positive sample passing rate of the judging result of the sample to be tested is kept unchanged even if the target identification models used by the service side are different.
The invention provides a pedestrian re-recognition method, which comprises the steps of firstly establishing a threshold mapping relation table according to a preset recognition model, then obtaining a sample to be detected, selecting a target recognition model from the preset recognition model according to a preset recognition rule, calculating a model similarity score of the sample to be detected according to the target recognition model, converting the model similarity score into a standard similarity score according to a threshold relation conversion formula and the threshold mapping relation table, and finally judging whether two images in the sample to be detected are identical pedestrian images according to the standard similarity score. Compared with the prior art, the embodiment of the invention converts the model similarity score into the standard similarity score through the threshold mapping relation table, so that the negative sample error rate/positive sample passing rate corresponding to the same standard similarity score is the same, and the service side can achieve the same recognition accuracy without changing the threshold according to the service side to update the recognition model, thereby realizing the update of the recognition model by the service side and simultaneously not increasing the workload of the service side.
Further, as an implementation of the method shown in fig. 1, an embodiment of the present invention provides a device for re-identifying a pedestrian, as shown in fig. 3, where the device includes:
the establishing module 31 is configured to establish a threshold mapping relationship table according to preset recognition models, where the number of the preset recognition models is at least 1, and the threshold mapping relationship table includes a standard threshold, an actual threshold, and a negative sample error rate/positive sample passing rate;
an obtaining module 32, configured to obtain a sample to be tested, where the sample to be tested includes two images to be identified;
a selecting module 33, configured to select a target recognition model from the preset recognition models according to a preset recognition rule;
a calculation module 34, configured to calculate a model similarity score of the sample to be tested according to the target recognition model;
the conversion module 35 is configured to convert the model similarity score into a standard similarity score according to a threshold relationship conversion formula and the threshold mapping relationship table;
the judging module 36 is configured to judge whether the two images in the sample to be tested are the same pedestrian image according to the standard similarity score.
The invention provides a pedestrian re-recognition device, which comprises the steps of firstly establishing a threshold mapping relation table according to a preset recognition model, then obtaining a sample to be detected, selecting a target recognition model from the preset recognition model according to a preset recognition rule, calculating a model similarity score of the sample to be detected according to the target recognition model, converting the model similarity score into a standard similarity score according to a threshold relation conversion formula and the threshold mapping relation table, and finally judging whether two images in the sample to be detected are identical pedestrian images according to the standard similarity score. Compared with the prior art, the embodiment of the invention converts the model similarity score into the standard similarity score through the threshold mapping relation table, so that the negative sample error rate/positive sample passing rate corresponding to the same standard similarity score is the same, and the service side can achieve the same recognition accuracy without changing the threshold according to the service side to update the recognition model, thereby realizing the update of the recognition model by the service side and simultaneously not increasing the workload of the service side.
Further, as an implementation of the method shown in fig. 2, another apparatus for re-identifying a pedestrian is provided in an embodiment of the present invention, as shown in fig. 4, where the apparatus includes:
the establishing module 41 is configured to establish a threshold mapping relationship table according to preset recognition models, where the number of the preset recognition models is at least 1, and the threshold mapping relationship table includes a standard threshold, an actual threshold, and a negative sample error rate/positive sample passing rate;
the obtaining module 42 is configured to obtain a sample to be tested, where the sample to be tested includes two images to be identified;
a selecting module 43, configured to select a target recognition model from the preset recognition models according to a preset recognition rule;
a calculating module 44, configured to calculate a model similarity score of the sample to be tested according to the target recognition model;
the conversion module 45 is configured to convert the model similarity score into a standard similarity score according to a threshold relationship conversion formula and the threshold mapping relationship table;
the judging module 46 is configured to judge whether the two images in the sample to be tested are the same pedestrian image according to the standard similarity score.
Further, the establishing module 41 includes:
a first calculating unit 411, configured to calculate the standard threshold according to a preset step size in a preset value range;
a configuration unit 412, configured to configure a negative sample error rate/positive sample passing rate corresponding to the standard threshold;
the second calculating unit 413 is further configured to calculate, according to a preset sample library, that the preset recognition model reaches an actual threshold corresponding to the negative sample error rate/the positive sample passing rate;
a generating unit 414, configured to generate the threshold mapping relation table according to the standard threshold, the actual threshold, and the negative sample error rate/the positive sample passing rate.
Further, the selecting module 43 includes:
an obtaining unit 431, configured to obtain a scene adaptation comparison table of the preset recognition model and the recognition scene;
and a searching unit 432, configured to search the target recognition model corresponding to the pre-selected recognition scene in the scene adaptation comparison table.
Further, the method further comprises:
the dividing module 47 is configured to divide the preset full sample into at least one sub-sample according to the identification scene before the threshold mapping relation table is established according to the preset identification model, where the sub-samples are in one-to-one correspondence with the identification scene;
and the training module 48 is configured to train, according to the subsamples, a preset recognition model that is the same as the recognition scene corresponding to the subsamples.
Further, the conversion module 45 includes:
a searching unit 451, configured to search, in the threshold mapping relationship table, an actual threshold value corresponding to the target recognition model;
an extracting unit 452, configured to extract an actual threshold range to which the model similarity score belongs in an actual threshold corresponding to the target recognition model;
the extracting unit 452 is further configured to extract a standard threshold range corresponding to the actual threshold range;
a calculating unit 453 configured to calculate a standard similarity score corresponding to the model similarity score according to the threshold relationship conversion formula, the standard threshold range, and the actual threshold range, where the threshold relationship conversion formula isWherein s' is the standard similarity score, s is the model similarity score, t - T being the lower boundary in the actual threshold range to which the model similarity score belongs + S being the upper boundary in the actual threshold range to which the model similarity score belongs - Is equal to t - Lower boundary in corresponding standard threshold range, s + Is equal to t + The upper boundary in the corresponding standard threshold range.
Further, the method further comprises:
the updating module 49 is configured to calculate, according to a preset sample library, that an updated recognition model corresponding to the update instruction reaches an updated actual threshold corresponding to the negative sample error rate/the positive sample passing rate after the threshold mapping relation table is established according to the preset recognition model, if an update instruction of the preset recognition model is received;
a saving module 410, configured to save the updated actual threshold value to the threshold mapping relationship table.
Further, the model similarity score is cosine similarity between two images in the sample to be tested.
The invention provides a pedestrian re-recognition device, which comprises the steps of firstly establishing a threshold mapping relation table according to a preset recognition model, then obtaining a sample to be detected, selecting a target recognition model from the preset recognition model according to a preset recognition rule, calculating a model similarity score of the sample to be detected according to the target recognition model, converting the model similarity score into a standard similarity score according to a threshold relation conversion formula and the threshold mapping relation table, and finally judging whether two images in the sample to be detected are identical pedestrian images according to the standard similarity score. Compared with the prior art, the embodiment of the invention converts the model similarity score into the standard similarity score through the threshold mapping relation table, so that the negative sample error rate/positive sample passing rate corresponding to the same standard similarity score is the same, and the service side can achieve the same recognition accuracy without changing the threshold according to the service side to update the recognition model, thereby realizing the update of the recognition model by the service side and simultaneously not increasing the workload of the service side.
According to one embodiment of the present invention, there is provided a storage medium storing at least one executable instruction for performing the pedestrian re-recognition method in any of the above-described method embodiments.
Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention, and the specific embodiment of the present invention is not limited to the specific implementation of the computer device.
As shown in fig. 5, the computer device may include: a processor 502, a communication interface (Communications Interface) 504, a memory 506, and a communication bus 508.
Wherein: processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508.
A communication interface 504 for communicating with network elements of other devices, such as clients or other servers.
The processor 502 is configured to execute the program 510, and may specifically perform relevant steps in the above-described method embodiment of pedestrian re-recognition.
In particular, program 510 may include program code including computer-operating instructions.
The processor 502 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in the computer device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
A memory 506 for storing a program 510. Memory 506 may comprise high-speed RAM memory or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 510 may be specifically operable to cause the processor 502 to:
according to preset identification models, a threshold mapping relation table is established, wherein the number of the preset identification models is at least 1, and the threshold mapping relation table comprises a standard threshold, an actual threshold and a negative sample error rate/positive sample passing rate;
obtaining a sample to be detected, wherein the sample to be detected comprises two images to be identified;
selecting a target recognition model from the preset recognition models according to preset recognition rules;
calculating the model similarity score of the sample to be detected according to the target identification model;
converting the model similarity score into a standard similarity score according to a threshold relation conversion formula and the threshold mapping relation table;
and judging whether the two images in the sample to be detected are the same pedestrian image or not according to the standard similarity score.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. A method of pedestrian re-identification, comprising:
according to preset identification models, a threshold mapping relation table is established, wherein the number of the preset identification models is at least 1, and the threshold mapping relation table comprises a standard threshold, an actual threshold and a negative sample error rate/positive sample passing rate;
obtaining a sample to be detected, wherein the sample to be detected comprises two images to be identified;
selecting a target recognition model from the preset recognition models according to preset recognition rules;
calculating the model similarity score of the sample to be detected according to the target identification model;
searching an actual threshold corresponding to the target recognition model in the threshold mapping relation table;
extracting an actual threshold range of the model similarity score in an actual threshold corresponding to the target recognition model;
extracting a standard threshold range corresponding to the actual threshold range;
calculating a standard similarity score corresponding to the model similarity score according to a threshold relation conversion formula, the standard threshold range and the actual threshold range, wherein the threshold relation conversion formula is as followsWherein->For the standard similarity score, +.>For the model similarity score, +.>For the lower boundary in the actual threshold range to which the model similarity score belongs, +.>For the upper boundary in the actual threshold range to which the model similarity score belongs, +.>Is->Lower boundary in the corresponding standard threshold range, < +.>Is->An upper boundary in a corresponding standard threshold range;
and judging whether the two images in the sample to be detected are the same pedestrian image or not according to the standard similarity score.
2. The method of claim 1, wherein the establishing a threshold mapping table according to a preset recognition model comprises:
calculating the standard threshold value according to a preset step length in a preset value range;
configuring a negative sample error rate/positive sample passing rate corresponding to the standard threshold;
calculating an actual threshold value corresponding to the negative sample error rate/positive sample passing rate reached by the preset recognition model according to a preset sample library;
and generating the threshold mapping relation table according to the standard threshold, the actual threshold and the negative sample error rate/the positive sample passing rate.
3. The method of claim 1, wherein selecting the object recognition model from the preset recognition models according to a preset recognition rule comprises:
acquiring a scene application comparison table of the preset recognition model and the recognition scene;
and searching a target recognition model corresponding to the preselected recognition scene in the scene application comparison table.
4. The method of claim 3, wherein before the establishing the threshold mapping relationship table according to the preset recognition model, the method further comprises:
dividing a preset full sample into at least one sub-sample according to the identification scene, wherein the sub-sample corresponds to the identification scene one by one;
training a preset recognition model which is the same as the recognition scene corresponding to the subsamples according to the subsamples.
5. The method of claim 2, wherein after establishing the threshold mapping table according to the preset recognition model, the method further comprises:
if an update instruction of the preset recognition model is received, calculating an update recognition model corresponding to the update instruction to reach an update actual threshold corresponding to the negative sample error rate/the positive sample passing rate according to a preset sample library;
and storing the updated actual threshold value into the threshold value mapping relation table.
6. The method of any of claims 1-5, wherein the model similarity score is a cosine similarity between two images in the sample under test.
7. An apparatus for pedestrian re-identification, comprising:
the system comprises a building module, a threshold mapping relation table, a judging module and a judging module, wherein the building module is used for building a threshold mapping relation table according to preset identification models, the number of the preset identification models is at least 1, and the threshold mapping relation table comprises a standard threshold, an actual threshold and a negative sample error rate/positive sample passing rate;
the acquisition module is used for acquiring a sample to be detected, wherein the sample to be detected contains two images to be identified;
the selecting module is used for selecting a target recognition model from the preset recognition models according to preset recognition rules;
the calculation module is used for calculating the model similarity score of the sample to be detected according to the target identification model;
the conversion module is used for converting the model similarity score into a standard similarity score according to a threshold relation conversion formula and the threshold mapping relation table;
the judging module is used for judging whether the two images in the sample to be detected are the same pedestrian image according to the standard similarity score;
the conversion module comprises:
the searching unit is used for searching an actual threshold value corresponding to the target identification model in the threshold value mapping relation table;
the extraction unit is used for extracting an actual threshold range of the model similarity score in an actual threshold corresponding to the target recognition model;
the extraction unit is further used for extracting a standard threshold range corresponding to the actual threshold range;
a calculation unit, configured to calculate a standard similarity score corresponding to the model similarity score according to a threshold relationship conversion formula, the standard threshold range, and the actual threshold range, where the threshold relationship conversion formula isWherein->For the standard similarity score, +.>For the model similarity score, +.>For the lower boundary in the actual threshold range to which the model similarity score belongs, +.>For the upper boundary in the actual threshold range to which the model similarity score belongs, +.>Is->Lower boundary in the corresponding standard threshold range, < +.>Is->The upper boundary in the corresponding standard threshold range.
8. A storage medium having stored therein at least one executable instruction that causes a processor to perform operations corresponding to the method of pedestrian re-identification of any one of claims 1-6.
9. A computer device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to perform operations corresponding to the method of pedestrian re-identification of any one of claims 1-6.
CN201910616632.3A 2019-07-09 2019-07-09 Pedestrian re-identification method and device Active CN110472499B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910616632.3A CN110472499B (en) 2019-07-09 2019-07-09 Pedestrian re-identification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910616632.3A CN110472499B (en) 2019-07-09 2019-07-09 Pedestrian re-identification method and device

Publications (2)

Publication Number Publication Date
CN110472499A CN110472499A (en) 2019-11-19
CN110472499B true CN110472499B (en) 2024-01-30

Family

ID=68507578

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910616632.3A Active CN110472499B (en) 2019-07-09 2019-07-09 Pedestrian re-identification method and device

Country Status (1)

Country Link
CN (1) CN110472499B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111582305B (en) * 2020-03-26 2023-08-18 平安科技(深圳)有限公司 Biological feature recognition method, apparatus, computer device and storage medium
CN113435325A (en) * 2021-06-25 2021-09-24 平安科技(深圳)有限公司 Image re-recognition method and device, electronic equipment and storage medium
CN113469015A (en) * 2021-06-29 2021-10-01 浙江大华技术股份有限公司 Face recognition method and device, electronic equipment and computer storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107577687A (en) * 2016-07-20 2018-01-12 北京陌上花科技有限公司 Image search method and device
CN108241868A (en) * 2016-12-26 2018-07-03 浙江宇视科技有限公司 The objective similarity of image is to the mapping method and device of subjective similarity
CN108304435A (en) * 2017-09-08 2018-07-20 腾讯科技(深圳)有限公司 Information recommendation method, device, computer equipment and storage medium
CN108804578A (en) * 2018-05-24 2018-11-13 南京理工大学 The unsupervised video summarization method generated based on consistency segment
CN109740413A (en) * 2018-11-14 2019-05-10 平安科技(深圳)有限公司 Pedestrian recognition methods, device, computer equipment and computer storage medium again

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008016102A1 (en) * 2006-08-03 2008-02-07 Nec Corporation Similarity calculation device and information search device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107577687A (en) * 2016-07-20 2018-01-12 北京陌上花科技有限公司 Image search method and device
CN108241868A (en) * 2016-12-26 2018-07-03 浙江宇视科技有限公司 The objective similarity of image is to the mapping method and device of subjective similarity
CN108304435A (en) * 2017-09-08 2018-07-20 腾讯科技(深圳)有限公司 Information recommendation method, device, computer equipment and storage medium
CN108804578A (en) * 2018-05-24 2018-11-13 南京理工大学 The unsupervised video summarization method generated based on consistency segment
CN109740413A (en) * 2018-11-14 2019-05-10 平安科技(深圳)有限公司 Pedestrian recognition methods, device, computer equipment and computer storage medium again

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
本体算法中相似度矩阵的学习;吴剑章;朱林立;高炜;;小型微型计算机系统;第36卷(第04期);第774-777页 *

Also Published As

Publication number Publication date
CN110472499A (en) 2019-11-19

Similar Documents

Publication Publication Date Title
CN109977262B (en) Method and device for acquiring candidate segments from video and processing equipment
CN109753928B (en) Method and device for identifying illegal buildings
CN110472499B (en) Pedestrian re-identification method and device
US10402627B2 (en) Method and apparatus for determining identity identifier of face in face image, and terminal
US9626551B2 (en) Collation apparatus and method for the same, and image searching apparatus and method for the same
CN109635686B (en) Two-stage pedestrian searching method combining human face and appearance
WO2019071664A1 (en) Human face recognition method and apparatus combined with depth information, and storage medium
CN110147710B (en) Method and device for processing human face features and storage medium
EP1530157A1 (en) Image matching system using 3-dimensional object model, image matching method, and image matching program
JP2018055195A (en) Learning device, image discrimination device, learning method, image discrimination method and program
CN113887387A (en) Ski field target image generation method, system and server
JP2011215716A (en) Position estimation device, position estimation method and program
CN112633221A (en) Face direction detection method and related device
CN109961103B (en) Training method of feature extraction model, and image feature extraction method and device
CN111582282A (en) Text recognition method, device, equipment and storage medium
KR101705584B1 (en) System of Facial Feature Point Descriptor for Face Alignment and Method thereof
JP2012103859A (en) Image processing device, image processing method, and image processing program
CN105229700B (en) Device and method for extracting peak figure picture from multiple continuously shot images
CN113470093B (en) Video jelly effect detection method, device and equipment based on aerial image processing
CN112380938B (en) Face recognition and temperature measurement method, device, equipment and medium
US20200387691A1 (en) A quick match algorithm for biometric data
CN112101479B (en) Hair style identification method and device
CN113947781A (en) Lost child identification method, lost child identification system, terminal equipment and storage medium
JP7253967B2 (en) Object matching device, object matching system, object matching method, and computer program
CN109087351B (en) Method and device for carrying out closed-loop detection on scene picture based on depth information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant